Move more functionality over to LLVMContext.
[oota-llvm.git] / lib / Transforms / Scalar / Reassociate.cpp
index 054e09d3c5b7b5de0d2a64b64500a712434e93bb..6465fc1b96e0f6e94eefd9ea4dc40919bdfa0ad4 100644 (file)
@@ -201,7 +201,7 @@ static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {
 static Instruction *LowerNegateToMultiply(Instruction *Neg,
                               std::map<AssertingVH<>, unsigned> &ValueRankMap,
                               LLVMContext *Context) {
-  Constant *Cst = Context->getConstantIntAllOnesValue(Neg->getType());
+  Constant *Cst = Context->getAllOnesValue(Neg->getType());
 
   Instruction *Res = BinaryOperator::CreateMul(Neg->getOperand(1), Cst, "",Neg);
   ValueRankMap.erase(Neg);
@@ -626,7 +626,7 @@ Value *Reassociate::OptimizeExpression(BinaryOperator *I,
             return Context->getNullValue(X->getType());
           } else if (Opcode == Instruction::Or) {   // ...|X|~X = -1
             ++NumAnnihil;
-            return Context->getConstantIntAllOnesValue(X->getType());
+            return Context->getAllOnesValue(X->getType());
           }
         }
       }