diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp b/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp index 788419cee4f..5ec5bf79ae1 100644 --- a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp +++ b/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp @@ -1695,7 +1695,7 @@ namespace { if (Constant *C1 = dyn_cast<Constant>(V1)) if (Constant *C2 = dyn_cast<Constant>(V2)) return ConstantExpr::getCompare(Pred, C1, C2) == - Context->getTrue(); + ConstantInt::getTrue(*Context); unsigned n1 = VN.valueNumber(V1, Top); unsigned n2 = VN.valueNumber(V2, Top); @@ -1807,10 +1807,10 @@ namespace { // "icmp ult i32 %a, %y" EQ true then %a u< y // etc. - if (Canonical == Context->getTrue()) { + if (Canonical == ConstantInt::getTrue(*Context)) { add(IC->getOperand(0), IC->getOperand(1), IC->getPredicate(), NewContext); - } else if (Canonical == Context->getFalse()) { + } else if (Canonical == ConstantInt::getFalse(*Context)) { add(IC->getOperand(0), IC->getOperand(1), ICmpInst::getInversePredicate(IC->getPredicate()), NewContext); } @@ -1826,11 +1826,11 @@ namespace { if (isRelatedBy(True, False, ICmpInst::ICMP_NE)) { if (Canonical == VN.canonicalize(True, Top) || isRelatedBy(Canonical, False, ICmpInst::ICMP_NE)) - add(SI->getCondition(), Context->getTrue(), + add(SI->getCondition(), ConstantInt::getTrue(*Context), ICmpInst::ICMP_EQ, NewContext); else if (Canonical == VN.canonicalize(False, Top) || isRelatedBy(Canonical, True, ICmpInst::ICMP_NE)) - add(SI->getCondition(), Context->getFalse(), + add(SI->getCondition(), ConstantInt::getFalse(*Context), ICmpInst::ICMP_EQ, NewContext); } } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { @@ -2054,9 +2054,9 @@ namespace { ICmpInst::Predicate Pred = IC->getPredicate(); if (isRelatedBy(Op0, Op1, Pred)) - add(IC, Context->getTrue(), ICmpInst::ICMP_EQ, NewContext); + add(IC, ConstantInt::getTrue(*Context), ICmpInst::ICMP_EQ, NewContext); else if (isRelatedBy(Op0, Op1, ICmpInst::getInversePredicate(Pred))) - add(IC, Context->getFalse(), + add(IC, ConstantInt::getFalse(*Context), ICmpInst::ICMP_EQ, NewContext); } else if (SelectInst *SI = dyn_cast<SelectInst>(I)) { @@ -2068,9 +2068,9 @@ namespace { // %b EQ %c then %a EQ %b Value *Canonical = VN.canonicalize(SI->getCondition(), Top); - if (Canonical == Context->getTrue()) { + if (Canonical == ConstantInt::getTrue(*Context)) { add(SI, SI->getTrueValue(), ICmpInst::ICMP_EQ, NewContext); - } else if (Canonical == Context->getFalse()) { + } else if (Canonical == ConstantInt::getFalse(*Context)) { add(SI, SI->getFalseValue(), ICmpInst::ICMP_EQ, NewContext); } else if (VN.canonicalize(SI->getTrueValue(), Top) == VN.canonicalize(SI->getFalseValue(), Top)) { @@ -2162,7 +2162,7 @@ namespace { if (Constant *CI_L = dyn_cast<Constant>(O.LHS)) { if (Constant *CI_R = dyn_cast<Constant>(O.RHS)) { if (ConstantExpr::getCompare(O.Op, CI_L, CI_R) == - Context->getFalse()) + ConstantInt::getFalse(*Context)) UB.mark(TopBB); WorkList.pop_front(); @@ -2467,7 +2467,7 @@ namespace { DEBUG(errs() << "(" << DTNode->getBlock()->getName() << ") true set:\n"); VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, Dest); - VRP.add(Context->getTrue(), Condition, ICmpInst::ICMP_EQ); + VRP.add(ConstantInt::getTrue(*Context), Condition, ICmpInst::ICMP_EQ); VRP.solve(); DEBUG(VN.dump()); DEBUG(IG.dump()); @@ -2476,7 +2476,7 @@ namespace { DEBUG(errs() << "(" << DTNode->getBlock()->getName() << ") false set:\n"); VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, Dest); - VRP.add(Context->getFalse(), Condition, ICmpInst::ICMP_EQ); + VRP.add(ConstantInt::getFalse(*Context), Condition, ICmpInst::ICMP_EQ); VRP.solve(); DEBUG(VN.dump()); DEBUG(IG.dump()); |