[PATCH] D128539: [GISel] Don't fold convergent instruction across CFG

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 10:24:37 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf4145ddf5bed: [GISel] Don't fold convergent instruction across CFG (authored by qcolombet).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128539/new/

https://reviews.llvm.org/D128539

Files:
  llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp


Index: llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
+++ llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
@@ -59,6 +59,10 @@
       std::next(MI.getIterator()) == IntoMI.getIterator())
     return true;
 
+  // Convergent instructions cannot be moved in the CFG.
+  if (MI.isConvergent() && MI.getParent() != IntoMI.getParent())
+    return false;
+
   return !MI.mayLoadOrStore() && !MI.mayRaiseFPException() &&
          !MI.hasUnmodeledSideEffects() && MI.implicit_operands().empty();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128539.441735.patch
Type: text/x-patch
Size: 624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220701/97674133/attachment.bin>


More information about the llvm-commits mailing list