[PATCH] D17430: [ifcvn] Don't duplicate blocks containing convergent instructions.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 15:59:04 PST 2016


jlebar updated this revision to Diff 48554.
jlebar added a comment.

Just add comments explaining why current code is safe.


http://reviews.llvm.org/D17430

Files:
  lib/CodeGen/IfConversion.cpp

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,9 @@
     if (I->isDebugValue())
       continue;
 
+    // Don't need to check isConvergent(). It's OK to duplicate convergent
+    // instructions here, because we'll only push convergent operations up the
+    // CFG -- this can only *remove* control-flow dependencies.
     if (I->isNotDuplicable())
       BBI.CannotBeCopied = true;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17430.48554.patch
Type: text/x-patch
Size: 947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160219/eb5004b2/attachment.bin>


More information about the llvm-commits mailing list