summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-14 18:18:02 +0000
committerChris Lattner <sabre@nondot.org>2002-08-14 18:18:02 +0000
commit0513e9fe03f6e3c7d0272b8f4f82359e8d1a2e44 (patch)
tree48844fe35059d833c39726311cfc9b64929da463
parent48a4531ee4ed02f9a9cd937593ae4b188e60531f (diff)
downloadexternal_llvm-0513e9fe03f6e3c7d0272b8f4f82359e8d1a2e44.zip
external_llvm-0513e9fe03f6e3c7d0272b8f4f82359e8d1a2e44.tar.gz
external_llvm-0513e9fe03f6e3c7d0272b8f4f82359e8d1a2e44.tar.bz2
Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3323 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/GCSE.cpp7
-rw-r--r--lib/Transforms/Scalar/LICM.cpp8
-rw-r--r--lib/VMCore/Instruction.cpp7
3 files changed, 8 insertions, 14 deletions
diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp
index 6f86aa8..a99a502 100644
--- a/lib/Transforms/Scalar/GCSE.cpp
+++ b/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/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 1f743ef..8bcb227 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/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) {
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index 3bc642b..e6ff3d2 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -30,14 +30,11 @@ void Instruction::setName(const std::string &name, SymbolTable *ST) {
const char *Instruction::getOpcodeName(unsigned OpCode) {
switch (OpCode) {
// Terminators
- case Ret: return "ret";
- case Br: return "br";
+ case Ret: return "ret";
+ case Br: return "br";
case Switch: return "switch";
case Invoke: return "invoke";
- // Standard unary operators...
- case Not: return "not";
-
// Standard binary operators...
case Add: return "add";
case Sub: return "sub";