summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-12-13 04:18:32 +0000
committerChris Lattner <sabre@nondot.org>2010-12-13 04:18:32 +0000
commit9b1af510cb2a63e23b2dae82745ce00c734c9c4d (patch)
tree3cb59374fe04541e35db795c27fd3abcdc61c168 /llvm/lib/Transforms
parent395252d93eb68e1c3e9bbd8106f1512abd745761 (diff)
downloadbcm5719-llvm-9b1af510cb2a63e23b2dae82745ce00c734c9c4d.tar.gz
bcm5719-llvm-9b1af510cb2a63e23b2dae82745ce00c734c9c4d.zip
don't bother handling non-canonical icmp's
llvm-svn: 121676
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index d3181b138a7..a1e7486ba50 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -306,11 +306,10 @@ GatherConstantSetEQs(Value *V, std::vector<ConstantInt*> &Values,
Values.push_back(C);
return Inst->getOperand(0);
}
- if (ConstantInt *C = GetConstantInt(Inst->getOperand(0), TD)) {
- Values.push_back(C);
- return Inst->getOperand(1);
- }
- } else if (Inst->getOpcode() == Instruction::Or) {
+ return 0;
+ }
+
+ if (Inst->getOpcode() == Instruction::Or) {
if (Value *LHS = GatherConstantSetEQs(Inst->getOperand(0), Values, TD))
if (Value *RHS = GatherConstantSetEQs(Inst->getOperand(1), Values, TD))
if (LHS == RHS)
@@ -329,16 +328,15 @@ GatherConstantSetNEs(Value *V, std::vector<ConstantInt*> &Values,
if (Inst == 0) return 0;
if (Inst->getOpcode() == Instruction::ICmp &&
- cast<ICmpInst>(Inst)->getPredicate() == ICmpInst::ICMP_NE) {
+ cast<ICmpInst>(Inst)->getPredicate() == ICmpInst::ICMP_NE) {
if (ConstantInt *C = GetConstantInt(Inst->getOperand(1), TD)) {
Values.push_back(C);
return Inst->getOperand(0);
}
- if (ConstantInt *C = GetConstantInt(Inst->getOperand(0), TD)) {
- Values.push_back(C);
- return Inst->getOperand(1);
- }
- } else if (Inst->getOpcode() == Instruction::And) {
+ return 0;
+ }
+
+ if (Inst->getOpcode() == Instruction::And) {
if (Value *LHS = GatherConstantSetNEs(Inst->getOperand(0), Values, TD))
if (Value *RHS = GatherConstantSetNEs(Inst->getOperand(1), Values, TD))
if (LHS == RHS)
OpenPOWER on IntegriCloud