summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
authorKyle Butt <kyle+llvm@iteratee.net>2016-09-02 01:20:06 +0000
committerKyle Butt <kyle+llvm@iteratee.net>2016-09-02 01:20:06 +0000
commit93e94e8a12fb4320ee15338a13af72058090387e (patch)
treeec899b2fed75a359b32a255a498236008bd64d6b /llvm/lib/CodeGen/IfConversion.cpp
parentc906ff63da6709a6adb4e3bb7038dd5348981556 (diff)
downloadbcm5719-llvm-93e94e8a12fb4320ee15338a13af72058090387e.tar.gz
bcm5719-llvm-93e94e8a12fb4320ee15338a13af72058090387e.zip
IfConversion: Don't count branches in # of duplicates.
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. llvm-svn: 280448
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
-rw-r--r--llvm/lib/CodeGen/IfConversion.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp
index 2110f443a19..76b4f3432a6 100644
--- a/llvm/lib/CodeGen/IfConversion.cpp
+++ b/llvm/lib/CodeGen/IfConversion.cpp
@@ -671,7 +671,9 @@ bool IfConverter::CountDuplicatedInstructions(
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 (!TIB->isBranch())
+ ++Dups1;
++TIB;
++FIB;
}
OpenPOWER on IntegriCloud