Skip to content

Commit 31f593e

Browse files
committed
[LAA] Also clear DiffChecks in LAI::reset().
DiffChecks will get populated twice when re-trying with runtime checks. Without clearing it like the regular Checks vector, it will contain some duplicates and the order the checks are created may not match the order the checks have been queued when re-trying.
1 parent 1360b9d commit 31f593e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

llvm/include/llvm/Analysis/LoopAccessAnalysis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ class RuntimePointerChecking {
486486
Need = false;
487487
Pointers.clear();
488488
Checks.clear();
489+
DiffChecks.clear();
489490
}
490491

491492
/// Insert a pointer and calculate the start and end SCEVs.

llvm/test/Transforms/LoopVectorize/runtime-checks-difference-simplifications.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ define void @check_creation_order(ptr %a, ptr %b, i32 %m) {
232232
; CHECK-NEXT: [[INVARIANT_GEP:%.*]] = getelementptr double, ptr [[A]], i64 [[M_EXT]]
233233
; CHECK-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_MEMCHECK:%.*]]
234234
; CHECK: vector.memcheck:
235-
; CHECK-NEXT: [[TMP0:%.*]] = sub i64 [[A1]], [[B2]]
235+
; CHECK-NEXT: [[TMP0:%.*]] = mul nsw i64 [[M_EXT]], -8
236236
; CHECK-NEXT: [[DIFF_CHECK:%.*]] = icmp ult i64 [[TMP0]], 32
237-
; CHECK-NEXT: [[TMP1:%.*]] = mul nsw i64 [[M_EXT]], -8
237+
; CHECK-NEXT: [[TMP1:%.*]] = sub i64 [[A1]], [[B2]]
238238
; CHECK-NEXT: [[DIFF_CHECK3:%.*]] = icmp ult i64 [[TMP1]], 32
239239
; CHECK-NEXT: [[CONFLICT_RDX:%.*]] = or i1 [[DIFF_CHECK]], [[DIFF_CHECK3]]
240240
; CHECK-NEXT: br i1 [[CONFLICT_RDX]], label [[SCALAR_PH]], label [[VECTOR_PH:%.*]]

0 commit comments

Comments
 (0)