mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-14 07:31:39 +00:00
Do not clone arbitrary condition instructions.
llvm-svn: 13316
This commit is contained in:
parent
da2d746a3b
commit
d8345001fa
@ -806,7 +806,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||||||
// predecessor and use logical operations to pick the right destination.
|
// predecessor and use logical operations to pick the right destination.
|
||||||
BasicBlock *TrueDest = BI->getSuccessor(0);
|
BasicBlock *TrueDest = BI->getSuccessor(0);
|
||||||
BasicBlock *FalseDest = BI->getSuccessor(1);
|
BasicBlock *FalseDest = BI->getSuccessor(1);
|
||||||
if (Instruction *Cond = dyn_cast<Instruction>(BI->getCondition()))
|
if (BinaryOperator *Cond = dyn_cast<BinaryOperator>(BI->getCondition()))
|
||||||
if (Cond->getParent() == BB && &BB->front() == Cond &&
|
if (Cond->getParent() == BB && &BB->front() == Cond &&
|
||||||
Cond->getNext() == BI && Cond->hasOneUse() &&
|
Cond->getNext() == BI && Cond->hasOneUse() &&
|
||||||
TrueDest != BB && FalseDest != BB)
|
TrueDest != BB && FalseDest != BB)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user