-//===- llvm/Analysis/InductionVariable.h - Induction variable ----*- C++ -*--=//
+//===- llvm/Analysis/InductionVariable.h - Induction variables --*- C++ -*-===//
//
// This interface is used to identify and classify induction variables that
// exist in the program. Induction variables must contain a PHI node that
class InductionVariable {
public:
enum iType { // Identify the type of this induction variable
- Cannonical, // Starts at 0, counts by 1
+ Canonical, // Starts at 0, counts by 1
SimpleLinear, // Simple linear: Constant start, constant step
Linear, // General linear: loop invariant start, and step
Unknown, // Unknown type. Start & Step are null
enum InductionVariable::iType
InductionVariable::Classify(const Value *Start, const Value *Step,
const Loop *L) {
- // Check for cannonical and simple linear expressions now...
+ // Check for canonical and simple linear expressions now...
if (const ConstantInt *CStart = dyn_cast<ConstantInt>(Start))
if (const ConstantInt *CStep = dyn_cast<ConstantInt>(Step)) {
if (CStart->isNullValue() && CStep->equalsInt(1))
- return Cannonical;
+ return Canonical;
else
return SimpleLinear;
}
}
SetCondInst *SCI = dyn_cast<SetCondInst>(B->getCondition());
- if (SCI && InductionType == Cannonical) {
+ if (SCI && InductionType == Canonical) {
DEBUG(std::cerr << "sci:" << *SCI);
Value *condVal0 = SCI->getOperand(0);
Value *condVal1 = SCI->getOperand(1);
}
return End;
} else {
- DEBUG(std::cerr << "SCI null or non-cannonical ind var\n");
+ DEBUG(std::cerr << "SCI null or non-canonical ind var\n");
}
return NULL;
}
void InductionVariable::print(std::ostream &o) const {
switch (InductionType) {
- case InductionVariable::Cannonical: o << "Cannonical "; break;
+ case InductionVariable::Canonical: o << "Canonical "; break;
case InductionVariable::SimpleLinear: o << "SimpleLinear "; break;
case InductionVariable::Linear: o << "Linear "; break;
case InductionVariable::Unknown: o << "Unrecognized "; break;