[PATCH] D17518: [ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 11:16:33 PST 2016

jlebar created this revision.
jlebar added a reviewer: resistor.
jlebar added subscribers: echristo, tra, llvm-commits.

Also add a comment briefly explaining what ifcnv is.

No functional changes.

Originally (accidentally) landed as r261543, then reverted as r261547.



Index: lib/CodeGen/IfConversion.cpp
--- lib/CodeGen/IfConversion.cpp
+++ lib/CodeGen/IfConversion.cpp
@@ -7,7 +7,8 @@
-// This file implements the machine instruction level if-conversion pass.
+// This file implements the machine instruction level if-conversion pass, which
+// tries to convert conditional branches into predicated instructions.
@@ -673,6 +674,12 @@
     if (I->isDebugValue())
+    // We don't need to set CannotBeCopied to true if BBI contains a convergent
+    // op.  CannotBeCopied prevents us from moving a BB into a predecessor and
+    // predicating it, if the BB that has more than one predecessor.  But this
+    // transformation is safe on BBs that contain convergent ops, as we're
+    // moving the convergent op *up* the CFG, thus removing, rather than adding,
+    // control-flow dependencies.
     if (I->isNotDuplicable())
       BBI.CannotBeCopied = true;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17518.48713.patch
Type: text/x-patch
Size: 1161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160222/96a802a7/attachment.bin>

More information about the llvm-commits mailing list