mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 21:20:37 +00:00
Switch inst insertion in instcombine transform to IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
62fb3556ea
commit
e87ca454ba
@ -604,9 +604,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
return BinaryOperator::CreateOr(CondVal, FalseVal);
|
||||
}
|
||||
// Change: A = select B, false, C --> A = and !B, C
|
||||
Value *NotCond =
|
||||
InsertNewInstBefore(BinaryOperator::CreateNot(CondVal,
|
||||
"not."+CondVal->getName()), SI);
|
||||
Value *NotCond = Builder->CreateNot(CondVal, "not."+CondVal->getName());
|
||||
return BinaryOperator::CreateAnd(NotCond, FalseVal);
|
||||
} else if (ConstantInt *C = dyn_cast<ConstantInt>(FalseVal)) {
|
||||
if (C->getZExtValue() == false) {
|
||||
@ -614,9 +612,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
return BinaryOperator::CreateAnd(CondVal, TrueVal);
|
||||
}
|
||||
// Change: A = select B, C, true --> A = or !B, C
|
||||
Value *NotCond =
|
||||
InsertNewInstBefore(BinaryOperator::CreateNot(CondVal,
|
||||
"not."+CondVal->getName()), SI);
|
||||
Value *NotCond = Builder->CreateNot(CondVal, "not."+CondVal->getName());
|
||||
return BinaryOperator::CreateOr(NotCond, TrueVal);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user