[PATCH] D24175: IfConversion: Don't count branches in # of duplicates.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 17:08:18 PDT 2016

iteratee created this revision.
iteratee added a reviewer: hfinkel.
iteratee added a subscriber: llvm-commits.
iteratee set the repository for this revision to rL LLVM.

If the entire blocks match, we would count the branch instructions
toward the number of duplicated instructions. This doesn't match what we
do elsewhere, and was causing a bug.




Index: lib/CodeGen/IfConversion.cpp
--- lib/CodeGen/IfConversion.cpp
+++ lib/CodeGen/IfConversion.cpp
@@ -671,7 +671,9 @@
     std::vector<MachineOperand> PredDefs;
     if (TII->DefinesPredicate(*TIB, PredDefs))
       return false;
-    ++Dups1;
+    // If we get all the way to the branch instructions, don't count them.
+    if (!TIE->isBranch())
+      ++Dups1;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24175.70106.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160902/0d24adeb/attachment.bin>

More information about the llvm-commits mailing list