summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-11-15 07:47:32 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-11-15 07:47:32 +0000
commit95148689c9fcc79b0d9dcc44f8a341fe7f5fa06a (patch)
treebf4fb816aef0e887ee4430b0048f5cb3ad1898b3 /llvm/lib/Transforms
parentffaacb14e3f7b86de9a01d31ca47d33763568fb1 (diff)
downloadbcm5719-llvm-95148689c9fcc79b0d9dcc44f8a341fe7f5fa06a.tar.gz
bcm5719-llvm-95148689c9fcc79b0d9dcc44f8a341fe7f5fa06a.zip
Revert r88830 and r88831 which appear to have caused a selfhost buildbot some
grief. I suspect this patch merely exposed a bug else. llvm-svn: 88841
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 14a482dd6e8..efda6608e44 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -8539,34 +8539,6 @@ Instruction *InstCombiner::transformZExtICmp(ICmpInst *ICI, Instruction &CI,
}
}
- // icmp ne A, B is equal to xor A, B when A and B only really have one bit.
- // It is also profitable to transform icmp eq into not(xor(A, B)) because that
- // may lead to additional simplifications.
- if (CI.getType() == ICI->getOperand(0)->getType()) {
- if (const IntegerType *ITy = dyn_cast<IntegerType>(CI.getType())) {
- Value *LHS = ICI->getOperand(0);
- Value *RHS = ICI->getOperand(1);
-
- uint32_t BitWidth = ITy->getBitWidth();
- APInt KnownZeroLHS(BitWidth, 0), KnownOneLHS(BitWidth, 0);
- APInt KnownZeroRHS(BitWidth, 0), KnownOneRHS(BitWidth, 0);
- APInt TypeMask(APInt::getAllOnesValue(BitWidth));
- ComputeMaskedBits(LHS, TypeMask, KnownZeroLHS, KnownOneLHS);
- ComputeMaskedBits(RHS, TypeMask, KnownZeroRHS, KnownOneRHS);
-
- if (KnownZeroLHS.countLeadingOnes() == BitWidth-1 &&
- KnownZeroRHS.countLeadingOnes() == BitWidth-1) {
- if (!DoXform) return ICI;
-
- Value *Xor = Builder->CreateXor(LHS, RHS);
- if (ICI->isTrueWhenEqual())
- Xor = Builder->CreateXor(Xor, ConstantInt::get(ITy, 1));
- Xor->takeName(ICI);
- return ReplaceInstUsesWith(CI, Xor);
- }
- }
- }
-
return 0;
}
OpenPOWER on IntegriCloud