[llvm-commits] [llvm] r108530 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
Owen Anderson
resistor at mac.com
Fri Jul 16 09:39:00 PDT 2010
Author: resistor
Date: Fri Jul 16 11:39:00 2010
New Revision: 108530
URL: http://llvm.org/viewvc/llvm-project?rev=108530&view=rev
Log:
Remove the rest of my instcombine changes. Back to the drawing board on this one.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=108530&r1=108529&r2=108530&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Fri Jul 16 11:39:00 2010
@@ -699,34 +699,6 @@
SI.setOperand(2, TrueVal);
return &SI;
}
-
- // select (A == 0 | B == 0), T, F--> select (A != 0 & B != 0), F, T
- // Note: This is a canonicalization rather than an optimization, and is used
- // to expose opportunities to other instcombine transforms.
- Instruction* CondInst = dyn_cast<Instruction>(CondVal);
- if (CondInst && CondInst->hasOneUse() &&
- CondInst->getOpcode() == Instruction::Or) {
- ICmpInst *LHSCmp = dyn_cast<ICmpInst>(CondInst->getOperand(0));
- ICmpInst *RHSCmp = dyn_cast<ICmpInst>(CondInst->getOperand(1));
- if (LHSCmp && LHSCmp->hasOneUse() &&
- LHSCmp->getPredicate() == ICmpInst::ICMP_EQ &&
- RHSCmp && RHSCmp->hasOneUse() &&
- RHSCmp->getPredicate() == ICmpInst::ICMP_EQ) {
- ConstantInt* C1 = dyn_cast<ConstantInt>(LHSCmp->getOperand(1));
- ConstantInt* C2 = dyn_cast<ConstantInt>(RHSCmp->getOperand(1));
- if (C1 && C1->isZero() && C2 && C2->isZero()) {
- LHSCmp->setPredicate(ICmpInst::ICMP_NE);
- RHSCmp->setPredicate(ICmpInst::ICMP_NE);
- Value *And =
- InsertNewInstBefore(BinaryOperator::CreateAnd(LHSCmp, RHSCmp,
- "and."+CondVal->getName()), SI);
- SI.setOperand(0, And);
- SI.setOperand(1, FalseVal);
- SI.setOperand(2, TrueVal);
- return &SI;
- }
- }
- }
return 0;
}
More information about the llvm-commits
mailing list