summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
-rw-r--r--llvm/lib/CodeGen/IfConversion.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp
index 109917ba2c0..22fe5288d8d 100644
--- a/llvm/lib/CodeGen/IfConversion.cpp
+++ b/llvm/lib/CodeGen/IfConversion.cpp
@@ -1689,10 +1689,15 @@ bool IfConverter::IfConvertDiamondCommon(
// Remove the conditional branch from entry to the blocks.
BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
- // Initialize liveins to the first BB. These are potentially redefined by
- // predicated instructions.
+ // Initialize the Redefs:
+ // - BB2 live-in regs need implicit uses before being redefined by BB1
+ // instructions.
+ // - BB1 live-out regs need implicit uses before being redefined by BB2
+ // instructions. We start with BB1 live-ins so we have the live-out regs
+ // after tracking the BB1 instructions.
Redefs.init(TRI);
Redefs.addLiveIns(*BBI1->BB);
+ Redefs.addLiveIns(*BBI2->BB);
// Remove the duplicated instructions at the beginnings of both paths.
// Skip dbg_value instructions
OpenPOWER on IntegriCloud