forked from OSchip/llvm-project
parent
8391387f7b
commit
a74f4ae404
|
@ -289,16 +289,16 @@ public:
|
|||
/// induction, the induction descriptor \p D will contain the data describing
|
||||
/// this induction. If by some other means the caller has a better SCEV
|
||||
/// expression for \p Phi than the one returned by the ScalarEvolution
|
||||
/// analysis, it can be passed through \p Expr. If the def-use chain
|
||||
/// analysis, it can be passed through \p Expr. If the def-use chain
|
||||
/// associated with the phi includes casts (that we know we can ignore
|
||||
/// under proper runtime checks), they are passed through \p CastsToIgnore.
|
||||
static bool
|
||||
static bool
|
||||
isInductionPHI(PHINode *Phi, const Loop* L, ScalarEvolution *SE,
|
||||
InductionDescriptor &D, const SCEV *Expr = nullptr,
|
||||
SmallVectorImpl<Instruction *> *CastsToIgnore = nullptr);
|
||||
|
||||
/// Returns true if \p Phi is a floating point induction in the loop \p L.
|
||||
/// If \p Phi is an induction, the induction descriptor \p D will contain
|
||||
/// If \p Phi is an induction, the induction descriptor \p D will contain
|
||||
/// the data describing this induction.
|
||||
static bool isFPInductionPHI(PHINode *Phi, const Loop* L,
|
||||
ScalarEvolution *SE, InductionDescriptor &D);
|
||||
|
@ -334,11 +334,11 @@ public:
|
|||
Instruction::BinaryOpsEnd;
|
||||
}
|
||||
|
||||
/// Returns a reference to the type cast instructions in the induction
|
||||
/// Returns a reference to the type cast instructions in the induction
|
||||
/// update chain, that are redundant when guarded with a runtime
|
||||
/// SCEV overflow check.
|
||||
const SmallVectorImpl<Instruction *> &getCastInsts() const {
|
||||
return RedundantCasts;
|
||||
const SmallVectorImpl<Instruction *> &getCastInsts() const {
|
||||
return RedundantCasts;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -923,13 +923,13 @@ bool InductionDescriptor::isFPInductionPHI(PHINode *Phi, const Loop *TheLoop,
|
|||
}
|
||||
|
||||
/// This function is called when we suspect that the update-chain of a phi node
|
||||
/// (whose symbolic SCEV expression sin \p PhiScev) contains redundant casts,
|
||||
/// that can be ignored. (This can happen when the PSCEV rewriter adds a runtime
|
||||
/// predicate P under which the SCEV expression for the phi can be the
|
||||
/// AddRecurrence \p AR; See createAddRecFromPHIWithCast). We want to find the
|
||||
/// cast instructions that are involved in the update-chain of this induction.
|
||||
/// A caller that adds the required runtime predicate can be free to drop these
|
||||
/// cast instructions, and compute the phi using \p AR (instead of some scev
|
||||
/// (whose symbolic SCEV expression sin \p PhiScev) contains redundant casts,
|
||||
/// that can be ignored. (This can happen when the PSCEV rewriter adds a runtime
|
||||
/// predicate P under which the SCEV expression for the phi can be the
|
||||
/// AddRecurrence \p AR; See createAddRecFromPHIWithCast). We want to find the
|
||||
/// cast instructions that are involved in the update-chain of this induction.
|
||||
/// A caller that adds the required runtime predicate can be free to drop these
|
||||
/// cast instructions, and compute the phi using \p AR (instead of some scev
|
||||
/// expression with casts).
|
||||
///
|
||||
/// For example, without a predicate the scev expression can take the following
|
||||
|
@ -964,7 +964,7 @@ static bool getCastsForInductionPHI(PredicatedScalarEvolution &PSE,
|
|||
assert(PSE.getSCEV(PN) == AR && "Unexpected phi node SCEV expression");
|
||||
const Loop *L = AR->getLoop();
|
||||
|
||||
// Find any cast instructions that participate in the def-use chain of
|
||||
// Find any cast instructions that participate in the def-use chain of
|
||||
// PhiScev in the loop.
|
||||
// FORNOW/TODO: We currently expect the def-use chain to include only
|
||||
// two-operand instructions, where one of the operands is an invariant.
|
||||
|
|
Loading…
Reference in New Issue