class ScalarEvolution;
class TargetData;
- /// SCEV - This class represent an analyzed expression in the program. These
- /// are reference counted opaque objects that the client is not allowed to
+ /// SCEV - This class represents an analyzed expression in the program. These
+ /// are reference-counted opaque objects that the client is not allowed to
/// do much with directly.
///
class SCEV {
static bool classof(const SCEV *S);
};
- /// SCEVCallbackVH - A CallbackVH to arrange for ScalarEvolution to be
- /// notified whenever a Value is deleted.
- class SCEVCallbackVH : public CallbackVH {
- ScalarEvolution *SE;
- virtual void deleted();
- virtual void allUsesReplacedWith(Value *New);
- public:
- SCEVCallbackVH(Value *V, ScalarEvolution *SE = 0);
- };
-
/// SCEVHandle - This class is used to maintain the SCEV object's refcounts,
/// freeing the objects when the last reference is dropped.
class SCEVHandle {
/// they must ask this class for services.
///
class ScalarEvolution : public FunctionPass {
+ /// SCEVCallbackVH - A CallbackVH to arrange for ScalarEvolution to be
+ /// notified whenever a Value is deleted.
+ class SCEVCallbackVH : public CallbackVH {
+ ScalarEvolution *SE;
+ virtual void deleted();
+ virtual void allUsesReplacedWith(Value *New);
+ public:
+ SCEVCallbackVH(Value *V, ScalarEvolution *SE = 0);
+ };
+
friend class SCEVCallbackVH;
+ friend class SCEVExpander;
/// F - The function we are analyzing.
///
BackedgeTakenInfo HowManyLessThans(const SCEV *LHS, const SCEV *RHS,
const Loop *L, bool isSigned);
+ /// getLoopPredecessor - If the given loop's header has exactly one unique
+ /// predecessor outside the loop, return it. Otherwise return null.
+ BasicBlock *getLoopPredecessor(const Loop *L);
+
/// getPredecessorWithUniqueSuccessorForBB - Return a predecessor of BB
/// (which may not be an immediate predecessor) which has exactly one
/// successor from which BB is reachable, or null if no such block is
/// This method can be used to compute the exit value for a variable defined
/// in a loop by querying what the value will hold in the parent loop.
///
- /// If this value is not computable at this scope, a SCEVCouldNotCompute
- /// object is returned.
+ /// In the case that a relevant loop exit value cannot be computed, the
+ /// original value V is returned.
SCEVHandle getSCEVAtScope(const SCEV *S, const Loop *L);
/// getSCEVAtScope - This is a convenience function which does