mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[LAA] Remove one addRuntimeChecks function (NFC).
In order to reduce the API surface area (preparation for D78460), remove a addRuntimeChecks() function and do the additional check in the single caller. Reviewers: Ayal, anemet Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D79679
This commit is contained in:
parent
b3c5529405
commit
08756fc67b
@ -541,15 +541,8 @@ public:
|
|||||||
unsigned getNumStores() const { return NumStores; }
|
unsigned getNumStores() const { return NumStores; }
|
||||||
unsigned getNumLoads() const { return NumLoads;}
|
unsigned getNumLoads() const { return NumLoads;}
|
||||||
|
|
||||||
/// Add code that checks at runtime if the accessed arrays overlap.
|
/// Add code that checks at runtime if the accessed arrays \in p PointerChecks
|
||||||
///
|
/// overlap.
|
||||||
/// Returns a pair of instructions where the first element is the first
|
|
||||||
/// instruction generated in possibly a sequence of instructions and the
|
|
||||||
/// second value is the final comparator value or NULL if no check is needed.
|
|
||||||
std::pair<Instruction *, Instruction *>
|
|
||||||
addRuntimeChecks(Instruction *Loc) const;
|
|
||||||
|
|
||||||
/// Generete the instructions for the checks in \p PointerChecks.
|
|
||||||
///
|
///
|
||||||
/// Returns a pair of instructions where the first element is the first
|
/// Returns a pair of instructions where the first element is the first
|
||||||
/// instruction generated in possibly a sequence of instructions and the
|
/// instruction generated in possibly a sequence of instructions and the
|
||||||
|
@ -2275,14 +2275,6 @@ std::pair<Instruction *, Instruction *> LoopAccessInfo::addRuntimeChecks(
|
|||||||
return std::make_pair(FirstInst, Check);
|
return std::make_pair(FirstInst, Check);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<Instruction *, Instruction *>
|
|
||||||
LoopAccessInfo::addRuntimeChecks(Instruction *Loc) const {
|
|
||||||
if (!PtrRtChecking->Need)
|
|
||||||
return std::make_pair(nullptr, nullptr);
|
|
||||||
|
|
||||||
return addRuntimeChecks(Loc, PtrRtChecking->getChecks());
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoopAccessInfo::collectStridedAccess(Value *MemAccess) {
|
void LoopAccessInfo::collectStridedAccess(Value *MemAccess) {
|
||||||
Value *Ptr = nullptr;
|
Value *Ptr = nullptr;
|
||||||
if (LoadInst *LI = dyn_cast<LoadInst>(MemAccess))
|
if (LoadInst *LI = dyn_cast<LoadInst>(MemAccess))
|
||||||
|
@ -2785,12 +2785,15 @@ void InnerLoopVectorizer::emitMemRuntimeChecks(Loop *L, BasicBlock *Bypass) {
|
|||||||
// Generate the code that checks in runtime if arrays overlap. We put the
|
// Generate the code that checks in runtime if arrays overlap. We put the
|
||||||
// checks into a separate block to make the more common case of few elements
|
// checks into a separate block to make the more common case of few elements
|
||||||
// faster.
|
// faster.
|
||||||
|
auto *LAI = Legal->getLAI();
|
||||||
|
const auto &RtPtrChecking = *LAI->getRuntimePointerChecking();
|
||||||
|
if (!RtPtrChecking.Need)
|
||||||
|
return;
|
||||||
Instruction *FirstCheckInst;
|
Instruction *FirstCheckInst;
|
||||||
Instruction *MemRuntimeCheck;
|
Instruction *MemRuntimeCheck;
|
||||||
std::tie(FirstCheckInst, MemRuntimeCheck) =
|
std::tie(FirstCheckInst, MemRuntimeCheck) = LAI->addRuntimeChecks(
|
||||||
Legal->getLAI()->addRuntimeChecks(MemCheckBlock->getTerminator());
|
MemCheckBlock->getTerminator(), RtPtrChecking.getChecks());
|
||||||
if (!MemRuntimeCheck)
|
assert(MemRuntimeCheck && "Expected runtime checks to be generated");
|
||||||
return;
|
|
||||||
|
|
||||||
if (MemCheckBlock->getParent()->hasOptSize()) {
|
if (MemCheckBlock->getParent()->hasOptSize()) {
|
||||||
assert(Cost->Hints->getForce() == LoopVectorizeHints::FK_Enabled &&
|
assert(Cost->Hints->getForce() == LoopVectorizeHints::FK_Enabled &&
|
||||||
|
Loading…
Reference in New Issue
Block a user