[PATCH] D152228: [AMDGPU] WQM: Ensure exact mode placement before branches

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 22:59:33 PDT 2023


critson created this revision.
critson added reviewers: arsenm, foad, piotr.
Herald added subscribers: StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
critson requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Fix for D151797 <https://reviews.llvm.org/D151797> where the change accidentally allowed exit to
exact mode between branch instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152228

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


Index: llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -1373,6 +1373,10 @@
         Needs = StateExact | StateWQM | StateStrict;
       }
 
+      // Exact mode exit can occur in terminators, but must be before branches.
+      if (MI.isBranch() && OutNeeds == StateExact)
+        Needs = StateExact;
+
       ++Next;
     } else {
       // End of basic block


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152228.528689.patch
Type: text/x-patch
Size: 522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230606/9de0529e/attachment.bin>


More information about the llvm-commits mailing list