diff options
author | Chris Lattner <sabre@nondot.org> | 2001-07-07 19:24:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-07-07 19:24:15 +0000 |
commit | a41f50dea8573e4a610b5aa5e45b5c368559b084 (patch) | |
tree | 4e4bc17fa7fffd16e0f99e9229015ca6654ef802 /lib/Transforms/Scalar/InductionVars.cpp | |
parent | 30f24a402c27919e4809f6a54ec4046a921a889f (diff) |
Broad superficial changes:
* Renamed getOpcode to getOpcodeName
* Changed getOpcodeName to return a const char * instead of string
* Added a getOpcode method to replace getInstType
* Changed code to use getOpcode instead of getInstType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InductionVars.cpp')
-rw-r--r-- | lib/Transforms/Scalar/InductionVars.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/InductionVars.cpp b/lib/Transforms/Scalar/InductionVars.cpp index b39a523f59..c59a441fad 100644 --- a/lib/Transforms/Scalar/InductionVars.cpp +++ b/lib/Transforms/Scalar/InductionVars.cpp @@ -78,7 +78,7 @@ static LIVType isLinearInductionVariableH(cfg::Interval *Int, Value *V, // loop variant computations must be instructions! Instruction *I = V->castInstructionAsserting(); - switch (I->getInstType()) { // Handle each instruction seperately + switch (I->getOpcode()) { // Handle each instruction seperately case Instruction::Neg: { Value *SubV = ((UnaryOperator*)I)->getOperand(0); LIVType SubLIVType = isLinearInductionVariableH(Int, SubV, PN); @@ -107,12 +107,12 @@ static LIVType isLinearInductionVariableH(cfg::Interval *Int, Value *V, // either a Loop Invariant computation, or a LIV type. if (SubLIVType1 == isLIC) { // Loop invariant computation, we know this is a LIV then. - return (I->getInstType() == Instruction::Add) ? + return (I->getOpcode() == Instruction::Add) ? SubLIVType2 : neg(SubLIVType2); } // If the LHS is also a LIV Expression, we cannot add two LIVs together - if (I->getInstType() == Instruction::Add) return isOther; + if (I->getOpcode() == Instruction::Add) return isOther; // We can only subtract two LIVs if they are the same type, which yields // a LIC, because the LIVs cancel each other out. @@ -155,7 +155,7 @@ static inline bool isSimpleInductionVar(PHINode *PN) { Value *StepExpr = PN->getIncomingValue(1); if (!StepExpr->isInstruction() || - ((Instruction*)StepExpr)->getInstType() != Instruction::Add) + ((Instruction*)StepExpr)->getOpcode() != Instruction::Add) return false; BinaryOperator *I = (BinaryOperator*)StepExpr; |