[llvm-commits] [llvm] r80454 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Dan Gohman
gohman at apple.com
Sat Aug 29 16:39:38 PDT 2009
Author: djg
Date: Sat Aug 29 18:39:38 2009
New Revision: 80454
URL: http://llvm.org/viewvc/llvm-project?rev=80454&view=rev
Log:
Remove an unnecessary Context argument.
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=80454&r1=80453&r2=80454&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sat Aug 29 18:39:38 2009
@@ -412,7 +412,7 @@
// 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 @@
//
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 @@
/// 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.
More information about the llvm-commits
mailing list