OSDN Git Service

[AMDGPU] SDWA operands should not intersect with potential MIs
authorSam Kolton <Sam.Kolton@amd.com>
Thu, 18 May 2017 12:12:03 +0000 (12:12 +0000)
committerSam Kolton <Sam.Kolton@amd.com>
Thu, 18 May 2017 12:12:03 +0000 (12:12 +0000)
commit5190dd7dddcc2847a0ac358da816ee6ddedc7187
treea120c6c7683491d8dad78b6c57480e24b49b359d
parentbe169add2e27af741d7c2ee49a8f5cd129a76853
[AMDGPU] SDWA operands should not intersect with potential MIs

Summary:
There should be no intesection between SDWA operands and potential MIs. E.g.:
```
v_and_b32 v0, 0xff, v1 -> src:v1 sel:BYTE_0
v_and_b32 v2, 0xff, v0 -> src:v0 sel:BYTE_0
v_add_u32 v3, v4, v2
```
In that example it is possible that we would fold 2nd instruction into 3rd (v_add_u32_sdwa) and then try to fold 1st instruction into 2nd (that was already destroyed). So if SDWAOperand is also a potential MI then do not apply it.

Reviewers: vpykhtin, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

Differential Revision: https://reviews.llvm.org/D32804

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303347 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIPeepholeSDWA.cpp
test/CodeGen/AMDGPU/sdwa-peephole.ll