diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-08-14 18:18:02 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-08-14 18:18:02 +0000 |
| commit | b193ff8f708ccf3f9d5beaf9ed4d32801f00c2be (patch) | |
| tree | 5e479ebc2dd2042ac4edcdbbf9c10602d35e2611 /llvm/lib/Transforms | |
| parent | 0f4093938a5cfd18e14f42c7949a3920a21609d3 (diff) | |
| download | bcm5719-llvm-b193ff8f708ccf3f9d5beaf9ed4d32801f00c2be.tar.gz bcm5719-llvm-b193ff8f708ccf3f9d5beaf9ed4d32801f00c2be.zip | |
Remove support for NOT instruction
llvm-svn: 3323
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GCSE.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 8 |
2 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/GCSE.cpp b/llvm/lib/Transforms/Scalar/GCSE.cpp index 6f86aa85a44..a99a502348e 100644 --- a/llvm/lib/Transforms/Scalar/GCSE.cpp +++ b/llvm/lib/Transforms/Scalar/GCSE.cpp @@ -48,10 +48,9 @@ namespace { // instruction being checked. They should return true if a common // subexpression was folded. // - bool visitUnaryOperator(Instruction &I); bool visitBinaryOperator(Instruction &I); bool visitGetElementPtrInst(GetElementPtrInst &I); - bool visitCastInst(CastInst &I){return visitUnaryOperator((Instruction&)I);} + bool visitCastInst(CastInst &I); bool visitShiftInst(ShiftInst &I) { return visitBinaryOperator((Instruction&)I); } @@ -254,14 +253,14 @@ void GCSE::CommonSubExpressionFound(Instruction *I, Instruction *Other) { // //===----------------------------------------------------------------------===// -bool GCSE::visitUnaryOperator(Instruction &I) { +bool GCSE::visitCastInst(CastInst &I) { Value *Op = I.getOperand(0); Function *F = I.getParent()->getParent(); for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end(); UI != UE; ++UI) if (Instruction *Other = dyn_cast<Instruction>(*UI)) - // Check to see if this new binary operator is not I, but same operand... + // Check to see if this new cast is not I, but has the same operand... if (Other != &I && Other->getOpcode() == I.getOpcode() && Other->getOperand(0) == Op && // Is the operand the same? // Is it embeded in the same function? (This could be false if LHS diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 1f743efe9bf..8bcb227e74b 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -84,15 +84,13 @@ namespace { // the specified instruction types are hoisted. // friend class InstVisitor<LICM>; - void visitUnaryOperator(Instruction &I) { - if (isLoopInvariant(I.getOperand(0))) hoist(I); - } void visitBinaryOperator(Instruction &I) { if (isLoopInvariant(I.getOperand(0)) && isLoopInvariant(I.getOperand(1))) hoist(I); } - - void visitCastInst(CastInst &I) { visitUnaryOperator((Instruction&)I); } + void visitCastInst(CastInst &I) { + if (isLoopInvariant(I.getOperand(0))) hoist((Instruction&)I); + } void visitShiftInst(ShiftInst &I) { visitBinaryOperator((Instruction&)I); } void visitGetElementPtrInst(GetElementPtrInst &GEPI) { |

