aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-13 22:18:28 +0000
committerOwen Anderson <resistor@mac.com>2009-07-13 22:18:28 +0000
commitfa82b6eba4e1584d7dba291c28fe908272e1e002 (patch)
tree033b1e9a873ad04863a5c5849ab515ba31d17e60 /lib/Transforms
parent0c39e3839a7d7e0dbd49b6b2d3e1bdc735b2b3aa (diff)
These don't really need contexts either.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp8
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp12
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 3254a7caa4..5b9659e200 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -410,8 +410,8 @@ X("instcombine", "Combine redundant instructions");
// 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst
static unsigned getComplexity(LLVMContext *Context, Value *V) {
if (isa<Instruction>(V)) {
- if (BinaryOperator::isNeg(*Context, V) ||
- BinaryOperator::isFNeg(*Context, V) ||
+ if (BinaryOperator::isNeg(V) ||
+ BinaryOperator::isFNeg(V) ||
BinaryOperator::isNot(V))
return 3;
return 4;
@@ -573,7 +573,7 @@ bool InstCombiner::SimplifyCompare(CmpInst &I) {
// if the LHS is a constant zero (which is the 'negate' form).
//
static inline Value *dyn_castNegVal(Value *V, LLVMContext *Context) {
- if (BinaryOperator::isNeg(*Context, V))
+ if (BinaryOperator::isNeg(V))
return BinaryOperator::getNegArgument(V);
// Constants can be considered to be negated values if they can be folded.
@@ -592,7 +592,7 @@ static inline Value *dyn_castNegVal(Value *V, LLVMContext *Context) {
// form).
//
static inline Value *dyn_castFNegVal(Value *V, LLVMContext *Context) {
- if (BinaryOperator::isFNeg(*Context, V))
+ if (BinaryOperator::isFNeg(V))
return BinaryOperator::getFNegArgument(V);
// Constants can be considered to be negated values if they can be folded.
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 6465fc1b96..2877852d3d 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -178,7 +178,7 @@ unsigned Reassociate::getRank(Value *V) {
// If this is a not or neg instruction, do not count it for rank. This
// assures us that X and ~X will have the same rank.
if (!I->getType()->isInteger() ||
- (!BinaryOperator::isNot(I) && !BinaryOperator::isNeg(*Context, I)))
+ (!BinaryOperator::isNot(I) && !BinaryOperator::isNeg(I)))
++Rank;
//DOUT << "Calculated Rank[" << V->getName() << "] = "
@@ -264,12 +264,12 @@ void Reassociate::LinearizeExprTree(BinaryOperator *I,
// If this is a multiply expression tree and it contains internal negations,
// transform them into multiplies by -1 so they can be reassociated.
if (I->getOpcode() == Instruction::Mul) {
- if (!LHSBO && LHS->hasOneUse() && BinaryOperator::isNeg(*Context, LHS)) {
+ if (!LHSBO && LHS->hasOneUse() && BinaryOperator::isNeg(LHS)) {
LHS = LowerNegateToMultiply(cast<Instruction>(LHS),
ValueRankMap, Context);
LHSBO = isReassociableOp(LHS, Opcode);
}
- if (!RHSBO && RHS->hasOneUse() && BinaryOperator::isNeg(*Context, RHS)) {
+ if (!RHSBO && RHS->hasOneUse() && BinaryOperator::isNeg(RHS)) {
RHS = LowerNegateToMultiply(cast<Instruction>(RHS),
ValueRankMap, Context);
RHSBO = isReassociableOp(RHS, Opcode);
@@ -409,7 +409,7 @@ static Value *NegateValue(LLVMContext *Context, Value *V, Instruction *BI) {
/// X-Y into (X + -Y).
static bool ShouldBreakUpSubtract(LLVMContext *Context, Instruction *Sub) {
// If this is a negation, we can't split it up!
- if (BinaryOperator::isNeg(*Context, Sub))
+ if (BinaryOperator::isNeg(Sub))
return false;
// Don't bother to break this up unless either the LHS is an associable add or
@@ -663,7 +663,7 @@ Value *Reassociate::OptimizeExpression(BinaryOperator *I,
for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
assert(i < Ops.size());
// Check for X and -X in the operand list.
- if (BinaryOperator::isNeg(*Context, Ops[i].Op)) {
+ if (BinaryOperator::isNeg(Ops[i].Op)) {
Value *X = BinaryOperator::getNegArgument(Ops[i].Op);
unsigned FoundX = FindInOperandList(Ops, i, X);
if (FoundX != i) {
@@ -801,7 +801,7 @@ void Reassociate::ReassociateBB(BasicBlock *BB) {
if (ShouldBreakUpSubtract(Context, BI)) {
BI = BreakUpSubtract(Context, BI, ValueRankMap);
MadeChange = true;
- } else if (BinaryOperator::isNeg(*Context, BI)) {
+ } else if (BinaryOperator::isNeg(BI)) {
// Otherwise, this is a negation. See if the operand is a multiply tree
// and if this is not an inner node of a multiply tree.
if (isReassociableOp(BI->getOperand(1), Instruction::Mul) &&