DominatorTree *DT,
const SmallVector<int, 8> *PtrToPartition = nullptr);
- /// \brief Returns true if we need memchecks to disambiguate may-aliasing
- /// accesses.
- bool needsRuntimeChecks() const;
-
/// \brief Performs the CFG manipulation part of versioning the loop including
/// the DominatorTree and LoopInfo updates.
///
/// loop may alias (memchecks failed).
Loop *NonVersionedLoop;
- /// \brief For each memory pointer it contains the partitionId it is used in.
- /// If nullptr, no partitioning is used.
- ///
- /// The I-th entry corresponds to I-th entry in LAI.getRuntimePointerCheck().
- /// If the pointer is used in multiple partitions the entry is set to -1.
- const SmallVector<int, 8> *PtrToPartition;
-
/// \brief This maps the instructions from VersionedLoop to their counterpart
/// in NonVersionedLoop.
ValueToValueMapTy VMap;
SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks,
const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI, DominatorTree *DT,
const SmallVector<int, 8> *PtrToPartition)
- : VersionedLoop(L), NonVersionedLoop(nullptr),
- PtrToPartition(PtrToPartition), Checks(std::move(Checks)), LAI(LAI),
- LI(LI), DT(DT) {
+ : VersionedLoop(L), NonVersionedLoop(nullptr), Checks(std::move(Checks)),
+ LAI(LAI), LI(LI), DT(DT) {
assert(L->getExitBlock() && "No single exit block");
assert(L->getLoopPreheader() && "No preheader");
}
-bool LoopVersioning::needsRuntimeChecks() const {
- return LAI.getRuntimePointerChecking()->needsAnyChecking(PtrToPartition);
-}
-
void LoopVersioning::versionLoop(Pass *P) {
Instruction *FirstCheckInst;
Instruction *MemRuntimeCheck;