mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[SCEV] Refactor out isHighCostExpansion. NFCI.
Summary: Move isHighCostExpansion from IndVarSimplify to SCEVExpander. This exposed function will be used in a subsequent change. Reviewers: bogner, atrick Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8995 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -116,6 +116,13 @@ namespace llvm {
|
||||
ChainedPhis.clear();
|
||||
}
|
||||
|
||||
/// isHighCostExpansion - Return true for expressions that may incur
|
||||
/// non-trivial cost to evaluate at runtime.
|
||||
bool isHighCostExpansion(const SCEV *Expr, Loop *L) {
|
||||
SmallPtrSet<const SCEV *, 8> Processed;
|
||||
return isHighCostExpansionHelper(Expr, L, Processed);
|
||||
}
|
||||
|
||||
/// getOrInsertCanonicalInductionVariable - This method returns the
|
||||
/// canonical induction variable of the specified type for the specified
|
||||
/// loop (inserting one if there is none). A canonical induction variable
|
||||
@@ -192,6 +199,11 @@ namespace llvm {
|
||||
private:
|
||||
LLVMContext &getContext() const { return SE.getContext(); }
|
||||
|
||||
/// isHighCostExpansionHelper - Recursive helper function for
|
||||
/// isHighCostExpansion.
|
||||
bool isHighCostExpansionHelper(const SCEV *S, Loop *L,
|
||||
SmallPtrSetImpl<const SCEV *> &Processed);
|
||||
|
||||
/// InsertBinop - Insert the specified binary operator, doing a small amount
|
||||
/// of work to avoid inserting an obviously redundant operation.
|
||||
Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, Value *RHS);
|
||||
|
Reference in New Issue
Block a user