summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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