diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-29 23:39:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-29 23:39:38 +0000 |
commit | 5d138f96f048cc7009397708ed10edea7cede5a6 (patch) | |
tree | c4a7df769360280d714da123324c653608d06dc7 /lib/Transforms | |
parent | f928ad4af07aaac5e7e81757dcd514acbb5cb39c (diff) | |
download | external_llvm-5d138f96f048cc7009397708ed10edea7cede5a6.zip external_llvm-5d138f96f048cc7009397708ed10edea7cede5a6.tar.gz external_llvm-5d138f96f048cc7009397708ed10edea7cede5a6.tar.bz2 |
Remove an unnecessary Context argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 62ac9c9..f21dece 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -412,7 +412,7 @@ X("instcombine", "Combine redundant instructions"); // getComplexity: Assign a complexity or rank value to LLVM Values... // 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst -static unsigned getComplexity(LLVMContext *Context, Value *V) { +static unsigned getComplexity(Value *V) { if (isa<Instruction>(V)) { if (BinaryOperator::isNeg(V) || BinaryOperator::isFNeg(V) || @@ -512,8 +512,7 @@ static bool ValueRequiresCast(Instruction::CastOps opcode, const Value *V, // bool InstCombiner::SimplifyCommutative(BinaryOperator &I) { bool Changed = false; - if (getComplexity(Context, I.getOperand(0)) < - getComplexity(Context, I.getOperand(1))) + if (getComplexity(I.getOperand(0)) < getComplexity(I.getOperand(1))) Changed = !I.swapOperands(); if (!I.isAssociative()) return Changed; @@ -551,8 +550,7 @@ bool InstCombiner::SimplifyCommutative(BinaryOperator &I) { /// so that theyare listed from right (least complex) to left (most complex). /// This puts constants before unary operators before binary operators. bool InstCombiner::SimplifyCompare(CmpInst &I) { - if (getComplexity(Context, I.getOperand(0)) >= - getComplexity(Context, I.getOperand(1))) + if (getComplexity(I.getOperand(0)) >= getComplexity(I.getOperand(1))) return false; I.swapOperands(); // Compare instructions are not associative so there's nothing else we can do. |