[PATCH] D73771: [AMDGPU] Don't remove short branches over kills

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 02:48:23 PST 2020


foad created this revision.
foad added reviewers: critson, arsenm, nhaehnle, cdevadas, hakzsam.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

D68092 <https://reviews.llvm.org/D68092> introduced a new SIRemoveShortExecBranches optimization pass and
broke some graphics shaders. The problem is that it was removing
branches over KILL pseudo instructions, and the fix is to explicitly
check for that in mustRetainExeczBranch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73771

Files:
  llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp


Index: llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp
+++ llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp
@@ -96,6 +96,9 @@
       if (TII->hasUnwantedEffectsWhenEXECEmpty(*I))
         return true;
 
+      if (TII->isKillTerminator(I->getOpcode()))
+        return true;
+
       // These instructions are potentially expensive even if EXEC = 0.
       if (TII->isSMRD(*I) || TII->isVMEM(*I) || TII->isFLAT(*I) ||
           I->getOpcode() == AMDGPU::S_WAITCNT)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73771.241665.patch
Type: text/x-patch
Size: 600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200131/9baee755/attachment.bin>


More information about the llvm-commits mailing list