14#ifndef LLVM_TRANSFORMS_UTILS_LOOPSPLITUTILS_H
15#define LLVM_TRANSFORMS_UTILS_LOOPSPLITUTILS_H
45 : L(L), LI(LI), SE(SE), DT(DT) {}
55 return L->getInductionVariable(*SE);
99 struct PartitionInfo {
100 PartitionInfo() =
default;
101 PartitionInfo(
const SCEV *StartExpr,
const SCEV *EndExpr)
102 : StartExpr(StartExpr), EndExpr(EndExpr) {}
105 const SCEV *StartExpr =
nullptr;
106 const SCEV *EndExpr =
nullptr;
110 std::unique_ptr<ValueToValueMapTy> VMap;
111 Value *StartVal =
nullptr;
112 Value *SelEnd =
nullptr;
114 BasicBlock *GuardBlock =
nullptr;
115 BasicBlock *Preheader =
nullptr;
116 BasicBlock *Exit =
nullptr;
117 Loop *SubLoop =
nullptr;
118 Value *LatchIndOp =
nullptr;
132 Value *LatchIndOperand =
nullptr;
133 bool InductionIsSigned =
false;
134 const SCEV *InductionEnd =
nullptr;
137 SmallVector<PartitionInfo, 4> Partitions;
143 void expandPartitionBounds(
SplitState &S, SCEVExpander &Expander);
This file defines the SmallVector class.
LocallyHashedType DenseMapInfo< LocallyHashedType >::Empty
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
LLVM_ABI bool split()
Perform the split.
LLVM_ABI unsigned getNumPartitions() const
LLVM_ABI LoopSplitUtils(Loop *L, LoopInfo *LI, ScalarEvolution *SE, DominatorTree *DT)
LLVM_ABI PHINode * getInductionVariable() const
Return the loop's induction variable. Valid only after isLegal() succeeds.
LLVM_ABI bool isLegal()
Analyze L and return true if it is a counted loop this utility can split: a bottom-tested single-exit...
LLVM_ABI void addPartition(const SCEV *Start, const SCEV *End)
Append an inclusive partition range [Start, End] in iteration order.
LLVM_ABI Value * getPartitionValue(Value *V, unsigned PartitionIndex) const
Return the counterpart of original-loop value V in partition PartitionIndex (0-based).
LLVM_ABI const ValueToValueMapTy * getPartitionValueMap(unsigned PartitionIndex) const
Return the original-to-clone value map for the partition at PartitionIndex, for callers that want to ...
LLVM_ABI void avoidPartitionGuard(unsigned PartitionIndex)
Suppress the entry guard for partition PartitionIndex (already added).
Represents a single loop in the control flow graph.
This class uses information about analyze scalars to rewrite expressions in canonical form.
This class represents an analyzed expression in the program.
The main scalar evolution driver.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
Per-split() scratch shared by the phase helpers; lives for one split() call.