Skip to content

Commit d78421a

Browse files
Add HasCompletePtrRtChecking
This records whether canCheckPtrAtRT succeeded, and is used to decide if we print the "checks are incomplete" message.
1 parent 686b462 commit d78421a

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

llvm/include/llvm/Analysis/LoopAccessAnalysis.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,8 @@ class LoopAccessInfo {
781781
/// We need to check that all of the pointers in this list are disjoint
782782
/// at runtime. Using std::unique_ptr to make using move ctor simpler.
783783
/// This list may contain only partial information when we've failed to
784-
/// analyze all the memory accesses in the loop (i.e. CanVecMem is false).
784+
/// analyze all the memory accesses in the loop, in which case
785+
/// HasCompletePtrRtChecking will be false.
785786
std::unique_ptr<RuntimePointerChecking> PtrRtChecking;
786787

787788
/// The Memory Dependence Checker which can determine the
@@ -798,6 +799,7 @@ class LoopAccessInfo {
798799
/// Cache the result of analyzeLoop.
799800
bool CanVecMem = false;
800801
bool HasConvergentOp = false;
802+
bool HasCompletePtrRtChecking = false;
801803

802804
/// Indicator that there are two non vectorizable stores to the same uniform
803805
/// address.

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,9 +2640,9 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
26402640
// Find pointers with computable bounds. We are going to use this information
26412641
// to place a runtime bound check.
26422642
Value *UncomputablePtr = nullptr;
2643-
bool CanDoRTIfNeeded = Accesses.canCheckPtrAtRT(
2643+
HasCompletePtrRtChecking = Accesses.canCheckPtrAtRT(
26442644
*PtrRtChecking, PSE->getSE(), TheLoop, SymbolicStrides, UncomputablePtr);
2645-
if (!CanDoRTIfNeeded) {
2645+
if (!HasCompletePtrRtChecking) {
26462646
const auto *I = dyn_cast_or_null<Instruction>(UncomputablePtr);
26472647
recordAnalysis("CantIdentifyArrayBounds", I)
26482648
<< "cannot identify array bounds";
@@ -2671,11 +2671,11 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
26712671

26722672
auto *SE = PSE->getSE();
26732673
UncomputablePtr = nullptr;
2674-
CanDoRTIfNeeded = Accesses.canCheckPtrAtRT(
2674+
HasCompletePtrRtChecking = Accesses.canCheckPtrAtRT(
26752675
*PtrRtChecking, SE, TheLoop, SymbolicStrides, UncomputablePtr);
26762676

26772677
// Check that we found the bounds for the pointer.
2678-
if (!CanDoRTIfNeeded) {
2678+
if (!HasCompletePtrRtChecking) {
26792679
auto *I = dyn_cast_or_null<Instruction>(UncomputablePtr);
26802680
recordAnalysis("CantCheckMemDepsAtRunTime", I)
26812681
<< "cannot check memory dependencies at runtime";
@@ -3009,7 +3009,7 @@ void LoopAccessInfo::print(raw_ostream &OS, unsigned Depth) const {
30093009

30103010
// List the pair of accesses need run-time checks to prove independence.
30113011
PtrRtChecking->print(OS, Depth);
3012-
if (PtrRtChecking->Need && !CanVecMem)
3012+
if (PtrRtChecking->Need && !HasCompletePtrRtChecking)
30133013
OS.indent(Depth) << "Generated run-time checks are incomplete\n";
30143014
OS << "\n";
30153015

llvm/test/Analysis/LoopAccessAnalysis/nusw-predicates.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ define void @int_and_multiple_pointer_predicates(ptr %v, ptr %w, i32 %N) {
9595
; CHECK-NEXT: Group [[GRP5]]:
9696
; CHECK-NEXT: (Low: %w High: (6 + (4 * (trunc i32 %N to i16)) + %w))
9797
; CHECK-NEXT: Member: {%w,+,4}<%loop>
98-
; CHECK-NEXT: Generated run-time checks are incomplete
9998
; CHECK-EMPTY:
10099
; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
101100
; CHECK-NEXT: SCEV assumptions:

llvm/test/Analysis/LoopAccessAnalysis/pointer-phis.ll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ define i32 @store_with_pointer_phi_incoming_phi(ptr %A, ptr %B, ptr %C, i1 %c.0,
287287
; CHECK-NEXT: (Low: %A High: (256000 + %A))
288288
; CHECK-NEXT: Member: {%A,+,8}<nuw><%loop.header>
289289
; CHECK-NEXT: Member: %A
290-
; CHECK-NEXT: Generated run-time checks are incomplete
291290
; CHECK-EMPTY:
292291
; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
293292
; CHECK-NEXT: SCEV assumptions:
@@ -371,7 +370,6 @@ define i32 @store_with_pointer_phi_incoming_phi_irreducible_cycle(ptr %A, ptr %B
371370
; CHECK-NEXT: (Low: %A High: (256000 + %A))
372371
; CHECK-NEXT: Member: {%A,+,8}<nuw><%loop.header>
373372
; CHECK-NEXT: Member: %A
374-
; CHECK-NEXT: Generated run-time checks are incomplete
375373
; CHECK-EMPTY:
376374
; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
377375
; CHECK-NEXT: SCEV assumptions:
@@ -542,7 +540,6 @@ define void @phi_load_store_memdep_check(i1 %c, ptr %A, ptr %B, ptr %C) {
542540
; CHECK-NEXT: (Low: %B High: (2 + %B))
543541
; CHECK-NEXT: Member: %B
544542
; CHECK-NEXT: Member: %B
545-
; CHECK-NEXT: Generated run-time checks are incomplete
546543
; CHECK-EMPTY:
547544
; CHECK-NEXT: Non vectorizable stores to invariant address were found in loop.
548545
; CHECK-NEXT: SCEV assumptions:

llvm/test/Analysis/LoopAccessAnalysis/unsafe-and-rt-checks-convergent.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ define void @rtchecks_needed(ptr %a, ptr %b, ptr %c) {
4040
; CHECK-NEXT: Group [[GRP3]]:
4141
; CHECK-NEXT: (Low: %c High: (40 + %c))
4242
; CHECK-NEXT: Member: {%c,+,2}<nuw><%for.body>
43-
; CHECK-NEXT: Generated run-time checks are incomplete
4443
; CHECK-EMPTY:
4544
; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
4645
; CHECK-NEXT: SCEV assumptions:

0 commit comments

Comments
 (0)