]> granicus.if.org Git - llvm/commit
[AMDGPU] Fix DPP combiner check for exec modification
authorJay Foad <jay.foad@gmail.com>
Fri, 12 Jul 2019 15:59:40 +0000 (15:59 +0000)
committerJay Foad <jay.foad@gmail.com>
Fri, 12 Jul 2019 15:59:40 +0000 (15:59 +0000)
commit7f18dddc3dc1263802ec6e1d1aac50f3c30c8d5b
tree78960e2641816b134f68076672dc1b30f50ed4b9
parent47c0a924d480e1fb6f72d174111ad259fe4e3da3
[AMDGPU] Fix DPP combiner check for exec modification

Summary:
r363675 changed the exec modification helper function, now called
execMayBeModifiedBeforeUse, so that if no UseMI is specified it checks
all instructions in the basic block, even beyond the last use. That
meant that the DPP combiner no longer worked in any basic block that
ended with a control flow instruction, and in particular it didn't work
on code sequences generated by the atomic optimizer.

Fix it by reinstating the old behaviour but in a new helper function
execMayBeModifiedBeforeAnyUse, and limiting the number of instructions
scanned.

Reviewers: arsenm, vpykhtin

Subscribers: kzhuravl, nemanjai, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kbarton, MaskRay, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365910 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/GCNDPPCombine.cpp
lib/Target/AMDGPU/SIFoldOperands.cpp
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstrInfo.h
test/CodeGen/AMDGPU/atomic_optimizations_global_pointer.ll
test/CodeGen/AMDGPU/atomic_optimizations_local_pointer.ll
test/CodeGen/AMDGPU/atomic_optimizations_pixelshader.ll
test/CodeGen/AMDGPU/atomic_optimizations_raw_buffer.ll
test/CodeGen/AMDGPU/atomic_optimizations_struct_buffer.ll
test/CodeGen/AMDGPU/dpp_combine.mir