-
Notifications
You must be signed in to change notification settings - Fork 14.3k
LAA: fix logic for MaxTargetVectorWidth #125487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-analysis Author: Ramkumar Ramachandra (artagnon) ChangesUse TargetTransformInfo::enableScalableVectorization to choose Fixed register bitwidth. Patch is 29.87 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/125487.diff 3 Files Affected:
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index ac8a35fbc54fb1d..0ba654a6141e5bb 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -2999,20 +2999,12 @@ LoopAccessInfo::LoopAccessInfo(Loop *L, ScalarEvolution *SE,
: PSE(std::make_unique<PredicatedScalarEvolution>(*SE, *L)),
PtrRtChecking(nullptr), TheLoop(L) {
unsigned MaxTargetVectorWidthInBits = std::numeric_limits<unsigned>::max();
- if (TTI) {
- TypeSize FixedWidth =
- TTI->getRegisterBitWidth(TargetTransformInfo::RGK_FixedWidthVector);
- if (FixedWidth.isNonZero()) {
- // Scale the vector width by 2 as rough estimate to also consider
- // interleaving.
- MaxTargetVectorWidthInBits = FixedWidth.getFixedValue() * 2;
- }
+ if (TTI && !TTI->enableScalableVectorization())
+ // Scale the vector width by 2 as rough estimate to also consider
+ // interleaving.
+ MaxTargetVectorWidthInBits =
+ TTI->getRegisterBitWidth(TargetTransformInfo::RGK_FixedWidthVector) * 2;
- TypeSize ScalableWidth =
- TTI->getRegisterBitWidth(TargetTransformInfo::RGK_ScalableVector);
- if (ScalableWidth.isNonZero())
- MaxTargetVectorWidthInBits = std::numeric_limits<unsigned>::max();
- }
DepChecker = std::make_unique<MemoryDepChecker>(*PSE, L, SymbolicStrides,
MaxTargetVectorWidthInBits);
PtrRtChecking = std::make_unique<RuntimePointerChecking>(*DepChecker, SE);
diff --git a/llvm/test/Analysis/LoopAccessAnalysis/multiple-strides-rt-memory-checks.ll b/llvm/test/Analysis/LoopAccessAnalysis/multiple-strides-rt-memory-checks.ll
index cb50b2c75ccb7b9..20fc0bea43b71bf 100644
--- a/llvm/test/Analysis/LoopAccessAnalysis/multiple-strides-rt-memory-checks.ll
+++ b/llvm/test/Analysis/LoopAccessAnalysis/multiple-strides-rt-memory-checks.ll
@@ -1,10 +1,11 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes='print<access-info>' -disable-output < %s 2>&1 | FileCheck %s
; This is the test case from PR26314.
-; When we were retrying dependence checking with memchecks only,
-; the loop-invariant access in the inner loop was incorrectly determined to be wrapping
+; When we were retrying dependence checking with memchecks only,
+; the loop-invariant access in the inner loop was incorrectly determined to be wrapping
; because it was not strided in the inner loop.
-
+
; #define Z 32
; typedef struct s {
; int v1[Z];
@@ -21,19 +22,52 @@
; }
; }
-; CHECK: function 'Test':
-; CHECK: .inner:
-; CHECK-NEXT: Memory dependences are safe with run-time checks
-; CHECK-NEXT: Dependences:
-; CHECK-NEXT: Run-time memory checks:
-; CHECK: Check 0:
-; CHECK: Check 1:
-
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
%struct.s = type { [32 x i32], [32 x i32], [32 x [32 x i32]] }
define void @Test(ptr nocapture %obj, i64 %z) #0 {
+; CHECK-LABEL: 'Test'
+; CHECK-NEXT: .inner:
+; CHECK-NEXT: Memory dependences are safe with a maximum safe vector width of 2048 bits with run-time checks
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Check 0:
+; CHECK-NEXT: Comparing group ([[GRP1:0x[0-9a-f]+]]):
+; CHECK-NEXT: %6 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 2, i64 %i, i64 %j
+; CHECK-NEXT: Against group ([[GRP2:0x[0-9a-f]+]]):
+; CHECK-NEXT: %2 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 0, i64 %j
+; CHECK-NEXT: Check 1:
+; CHECK-NEXT: Comparing group ([[GRP1]]):
+; CHECK-NEXT: %6 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 2, i64 %i, i64 %j
+; CHECK-NEXT: Against group ([[GRP3:0x[0-9a-f]+]]):
+; CHECK-NEXT: %1 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 1, i64 %i
+; CHECK-NEXT: Grouped accesses:
+; CHECK-NEXT: Group [[GRP1]]:
+; CHECK-NEXT: (Low: {(256 + %obj)<nuw>,+,128}<nuw><%.outer.preheader> High: {(256 + (4 * %z) + %obj),+,128}<nw><%.outer.preheader>)
+; CHECK-NEXT: Member: {{\{\{}}(256 + %obj)<nuw>,+,128}<nuw><%.outer.preheader>,+,4}<nuw><%.inner>
+; CHECK-NEXT: Group [[GRP2]]:
+; CHECK-NEXT: (Low: %obj High: ((4 * %z) + %obj))
+; CHECK-NEXT: Member: {%obj,+,4}<nuw><%.inner>
+; CHECK-NEXT: Group [[GRP3]]:
+; CHECK-NEXT: (Low: {(128 + %obj)<nuw>,+,4}<nuw><%.outer.preheader> High: {(132 + %obj),+,4}<nw><%.outer.preheader>)
+; CHECK-NEXT: Member: {(128 + %obj)<nuw>,+,4}<nuw><%.outer.preheader>
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+; CHECK-NEXT: .outer.preheader:
+; CHECK-NEXT: Report: loop is not the innermost loop
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Grouped accesses:
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+;
br label %.outer.preheader
@@ -44,7 +78,7 @@ define void @Test(ptr nocapture %obj, i64 %z) #0 {
.exit:
ret void
-
+
.outer:
%i.next = add nuw nsw i64 %i, 1
%exitcond.outer = icmp eq i64 %i.next, 32
@@ -59,7 +93,7 @@ define void @Test(ptr nocapture %obj, i64 %z) #0 {
%6 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 2, i64 %i, i64 %j
%7 = load i32, ptr %6
%8 = add nsw i32 %5, %7
- store i32 %8, ptr %6
+ store i32 %8, ptr %6
%j.next = add nuw nsw i64 %j, 1
%exitcond.inner = icmp eq i64 %j.next, %z
br i1 %exitcond.inner, label %.outer, label %.inner
diff --git a/llvm/test/Analysis/LoopAccessAnalysis/non-constant-distance-backward.ll b/llvm/test/Analysis/LoopAccessAnalysis/non-constant-distance-backward.ll
index 0058135a30d670b..e03872e00efb4fe 100644
--- a/llvm/test/Analysis/LoopAccessAnalysis/non-constant-distance-backward.ll
+++ b/llvm/test/Analysis/LoopAccessAnalysis/non-constant-distance-backward.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
-; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck --check-prefixes=COMMON,MAXLEN %s
-; RUN: opt -passes='print<access-info>' -disable-output -mtriple=arm64-apple-macosx %s 2>&1 | FileCheck --check-prefixes=COMMON,VW128 %s
-; RUN: opt -passes='print<access-info>' -disable-output -mtriple=arm64-apple-macosx -mattr=+sve %s 2>&1 | FileCheck --check-prefixes=COMMON,MAXLEN %s
+; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck %s
+; RUN: opt -passes='print<access-info>' -disable-output -mtriple=arm64-apple-macosx %s 2>&1 | FileCheck --check-prefixes=VW128 %s
+; RUN: opt -passes='print<access-info>' -disable-output -mtriple=arm64-apple-macosx -mattr=+sve %s 2>&1 | FileCheck --check-prefixes=MAXLEN %s
; REQUIRES: aarch64-registered-target
@@ -10,38 +10,104 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
; If the dependence distance is not a constant, whether it gets identified as backwards or unknown depends on the minimum distance and the target's vector length.
define void @backward_min_distance_8(ptr %A, i64 %N) {
-; COMMON-LABEL: 'backward_min_distance_8'
-; COMMON-NEXT: loop:
-; COMMON-NEXT: Memory dependences are safe with run-time checks
-; COMMON-NEXT: Dependences:
-; COMMON-NEXT: Run-time memory checks:
-; COMMON-NEXT: Check 0:
-; COMMON-NEXT: Comparing group ([[GRP1:0x[0-9a-f]+]]):
-; COMMON-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
-; COMMON-NEXT: Against group ([[GRP2:0x[0-9a-f]+]]):
-; COMMON-NEXT: %gep = getelementptr inbounds i8, ptr %A, i64 %iv
-; COMMON-NEXT: Grouped accesses:
-; COMMON-NEXT: Group [[GRP1]]:
-; COMMON-NEXT: (Low: {(1 + %A)<nuw>,+,1}<nuw><%outer.header> High: {(257 + %A),+,1}<nw><%outer.header>)
-; COMMON-NEXT: Member: {{\{\{}}(1 + %A)<nuw>,+,1}<nuw><%outer.header>,+,1}<nuw><%loop>
-; COMMON-NEXT: Group [[GRP2]]:
-; COMMON-NEXT: (Low: %A High: (256 + %A))
-; COMMON-NEXT: Member: {%A,+,1}<nuw><%loop>
-; COMMON-EMPTY:
-; COMMON-NEXT: Non vectorizable stores to invariant address were not found in loop.
-; COMMON-NEXT: SCEV assumptions:
-; COMMON-EMPTY:
-; COMMON-NEXT: Expressions re-written:
-; COMMON-NEXT: outer.header:
-; COMMON-NEXT: Report: loop is not the innermost loop
-; COMMON-NEXT: Dependences:
-; COMMON-NEXT: Run-time memory checks:
-; COMMON-NEXT: Grouped accesses:
-; COMMON-EMPTY:
-; COMMON-NEXT: Non vectorizable stores to invariant address were not found in loop.
-; COMMON-NEXT: SCEV assumptions:
-; COMMON-EMPTY:
-; COMMON-NEXT: Expressions re-written:
+; CHECK-LABEL: 'backward_min_distance_8'
+; CHECK-NEXT: loop:
+; CHECK-NEXT: Memory dependences are safe with run-time checks
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Check 0:
+; CHECK-NEXT: Comparing group ([[GRP1:0x[0-9a-f]+]]):
+; CHECK-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
+; CHECK-NEXT: Against group ([[GRP2:0x[0-9a-f]+]]):
+; CHECK-NEXT: %gep = getelementptr inbounds i8, ptr %A, i64 %iv
+; CHECK-NEXT: Grouped accesses:
+; CHECK-NEXT: Group [[GRP1]]:
+; CHECK-NEXT: (Low: {(1 + %A)<nuw>,+,1}<nuw><%outer.header> High: {(257 + %A),+,1}<nw><%outer.header>)
+; CHECK-NEXT: Member: {{\{\{}}(1 + %A)<nuw>,+,1}<nuw><%outer.header>,+,1}<nuw><%loop>
+; CHECK-NEXT: Group [[GRP2]]:
+; CHECK-NEXT: (Low: %A High: (256 + %A))
+; CHECK-NEXT: Member: {%A,+,1}<nuw><%loop>
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+; CHECK-NEXT: outer.header:
+; CHECK-NEXT: Report: loop is not the innermost loop
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Grouped accesses:
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+;
+; VW128-LABEL: 'backward_min_distance_8'
+; VW128-NEXT: loop:
+; VW128-NEXT: Memory dependences are safe with run-time checks
+; VW128-NEXT: Dependences:
+; VW128-NEXT: Run-time memory checks:
+; VW128-NEXT: Check 0:
+; VW128-NEXT: Comparing group ([[GRP3:0x[0-9a-f]+]]):
+; VW128-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
+; VW128-NEXT: Against group ([[GRP4:0x[0-9a-f]+]]):
+; VW128-NEXT: %gep = getelementptr inbounds i8, ptr %A, i64 %iv
+; VW128-NEXT: Grouped accesses:
+; VW128-NEXT: Group [[GRP3]]:
+; VW128-NEXT: (Low: {(1 + %A)<nuw>,+,1}<nuw><%outer.header> High: {(257 + %A),+,1}<nw><%outer.header>)
+; VW128-NEXT: Member: {{\{\{}}(1 + %A)<nuw>,+,1}<nuw><%outer.header>,+,1}<nuw><%loop>
+; VW128-NEXT: Group [[GRP4]]:
+; VW128-NEXT: (Low: %A High: (256 + %A))
+; VW128-NEXT: Member: {%A,+,1}<nuw><%loop>
+; VW128-EMPTY:
+; VW128-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; VW128-NEXT: SCEV assumptions:
+; VW128-EMPTY:
+; VW128-NEXT: Expressions re-written:
+; VW128-NEXT: outer.header:
+; VW128-NEXT: Report: loop is not the innermost loop
+; VW128-NEXT: Dependences:
+; VW128-NEXT: Run-time memory checks:
+; VW128-NEXT: Grouped accesses:
+; VW128-EMPTY:
+; VW128-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; VW128-NEXT: SCEV assumptions:
+; VW128-EMPTY:
+; VW128-NEXT: Expressions re-written:
+;
+; MAXLEN-LABEL: 'backward_min_distance_8'
+; MAXLEN-NEXT: loop:
+; MAXLEN-NEXT: Memory dependences are safe with run-time checks
+; MAXLEN-NEXT: Dependences:
+; MAXLEN-NEXT: Run-time memory checks:
+; MAXLEN-NEXT: Check 0:
+; MAXLEN-NEXT: Comparing group ([[GRP5:0x[0-9a-f]+]]):
+; MAXLEN-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
+; MAXLEN-NEXT: Against group ([[GRP6:0x[0-9a-f]+]]):
+; MAXLEN-NEXT: %gep = getelementptr inbounds i8, ptr %A, i64 %iv
+; MAXLEN-NEXT: Grouped accesses:
+; MAXLEN-NEXT: Group [[GRP5]]:
+; MAXLEN-NEXT: (Low: {(1 + %A)<nuw>,+,1}<nuw><%outer.header> High: {(257 + %A),+,1}<nw><%outer.header>)
+; MAXLEN-NEXT: Member: {{\{\{}}(1 + %A)<nuw>,+,1}<nuw><%outer.header>,+,1}<nuw><%loop>
+; MAXLEN-NEXT: Group [[GRP6]]:
+; MAXLEN-NEXT: (Low: %A High: (256 + %A))
+; MAXLEN-NEXT: Member: {%A,+,1}<nuw><%loop>
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; MAXLEN-NEXT: SCEV assumptions:
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Expressions re-written:
+; MAXLEN-NEXT: outer.header:
+; MAXLEN-NEXT: Report: loop is not the innermost loop
+; MAXLEN-NEXT: Dependences:
+; MAXLEN-NEXT: Run-time memory checks:
+; MAXLEN-NEXT: Grouped accesses:
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; MAXLEN-NEXT: SCEV assumptions:
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Expressions re-written:
;
entry:
br label %outer.header
@@ -72,38 +138,97 @@ exit:
}
define void @backward_min_distance_120(ptr %A, i64 %N) {
-; COMMON-LABEL: 'backward_min_distance_120'
-; COMMON-NEXT: loop:
-; COMMON-NEXT: Memory dependences are safe with run-time checks
-; COMMON-NEXT: Dependences:
-; COMMON-NEXT: Run-time memory checks:
-; COMMON-NEXT: Check 0:
-; COMMON-NEXT: Comparing group ([[GRP3:0x[0-9a-f]+]]):
-; COMMON-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
-; COMMON-NEXT: Against group ([[GRP4:0x[0-9a-f]+]]):
-; COMMON-NEXT: %gep = getelementptr inbounds i8, ptr %A, i64 %iv
-; COMMON-NEXT: Grouped accesses:
-; COMMON-NEXT: Group [[GRP3]]:
-; COMMON-NEXT: (Low: {(15 + %A)<nuw>,+,1}<nuw><%outer.header> High: {(271 + %A),+,1}<nw><%outer.header>)
-; COMMON-NEXT: Member: {{\{\{}}(15 + %A)<nuw>,+,1}<nuw><%outer.header>,+,1}<nuw><%loop>
-; COMMON-NEXT: Group [[GRP4]]:
-; COMMON-NEXT: (Low: %A High: (256 + %A))
-; COMMON-NEXT: Member: {%A,+,1}<nuw><%loop>
-; COMMON-EMPTY:
-; COMMON-NEXT: Non vectorizable stores to invariant address were not found in loop.
-; COMMON-NEXT: SCEV assumptions:
-; COMMON-EMPTY:
-; COMMON-NEXT: Expressions re-written:
-; COMMON-NEXT: outer.header:
-; COMMON-NEXT: Report: loop is not the innermost loop
-; COMMON-NEXT: Dependences:
-; COMMON-NEXT: Run-time memory checks:
-; COMMON-NEXT: Grouped accesses:
-; COMMON-EMPTY:
-; COMMON-NEXT: Non vectorizable stores to invariant address were not found in loop.
-; COMMON-NEXT: SCEV assumptions:
-; COMMON-EMPTY:
-; COMMON-NEXT: Expressions re-written:
+; CHECK-LABEL: 'backward_min_distance_120'
+; CHECK-NEXT: loop:
+; CHECK-NEXT: Memory dependences are safe with a maximum safe vector width of 120 bits
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: BackwardVectorizable:
+; CHECK-NEXT: %l = load i8, ptr %gep, align 4 ->
+; CHECK-NEXT: store i8 %add, ptr %gep.off.iv, align 4
+; CHECK-EMPTY:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Grouped accesses:
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+; CHECK-NEXT: outer.header:
+; CHECK-NEXT: Report: loop is not the innermost loop
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Grouped accesses:
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+;
+; VW128-LABEL: 'backward_min_distance_120'
+; VW128-NEXT: loop:
+; VW128-NEXT: Memory dependences are safe with run-time checks
+; VW128-NEXT: Dependences:
+; VW128-NEXT: Run-time memory checks:
+; VW128-NEXT: Check 0:
+; VW128-NEXT: Comparing group ([[GRP7:0x[0-9a-f]+]]):
+; VW128-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
+; VW128-NEXT: Against group ([[GRP8:0x[0-9a-f]+]]):
+; VW128-NEXT: %gep = getelementptr inbounds i8, ptr %A, i64 %iv
+; VW128-NEXT: Grouped accesses:
+; VW128-NEXT: Group [[GRP7]]:
+; VW128-NEXT: (Low: {(15 + %A)<nuw>,+,1}<nuw><%outer.header> High: {(271 + %A),+,1}<nw><%outer.header>)
+; VW128-NEXT: Member: {{\{\{}}(15 + %A)<nuw>,+,1}<nuw><%outer.header>,+,1}<nuw><%loop>
+; VW128-NEXT: Group [[GRP8]]:
+; VW128-NEXT: (Low: %A High: (256 + %A))
+; VW128-NEXT: Member: {%A,+,1}<nuw><%loop>
+; VW128-EMPTY:
+; VW128-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; VW128-NEXT: SCEV assumptions:
+; VW128-EMPTY:
+; VW128-NEXT: Expressions re-written:
+; VW128-NEXT: outer.header:
+; VW128-NEXT: Report: loop is not the innermost loop
+; VW128-NEXT: Dependences:
+; VW128-NEXT: Run-time memory checks:
+; VW128-NEXT: Grouped accesses:
+; VW128-EMPTY:
+; VW128-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; VW128-NEXT: SCEV assumptions:
+; VW128-EMPTY:
+; VW128-NEXT: Expressions re-written:
+;
+; MAXLEN-LABEL: 'backward_min_distance_120'
+; MAXLEN-NEXT: loop:
+; MAXLEN-NEXT: Memory dependences are safe with run-time checks
+; MAXLEN-NEXT: Dependences:
+; MAXLEN-NEXT: Run-time memory checks:
+; MAXLEN-NEXT: Check 0:
+; MAXLEN-NEXT: Comparing group ([[GRP9:0x[0-9a-f]+]]):
+; MAXLEN-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
+; MAXLEN-NEXT: Against group ([[GRP10:0x[0-9a-f]+]]):
+; MAXLEN-NEXT: %gep = getelementptr inbounds i8, ptr %A, i64 %iv
+; MAXLEN-NEXT: Grouped accesses:
+; MAXLEN-NEXT: Group [[GRP9]]:
+; MAXLEN-NEXT: (Low: {(15 + %A)<nuw>,+,1}<nuw><%outer.header> High: {(271 + %A),+,1}<nw><%outer.header>)
+; MAXLEN-NEXT: Member: {{\{\{}}(15 + %A)<nuw>,+,1}<nuw><%outer.header>,+,1}<nuw><%loop>
+; MAXLEN-NEXT: Group [[GRP10]]:
+; MAXLEN-NEXT: (Low: %A High: (256 + %A))
+; MAXLEN-NEXT: Member: {%A,+,1}<nuw><%loop>
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; MAXLEN-NEXT: SCEV assumptions:
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Expressions re-written:
+; MAXLEN-NEXT: outer.header:
+; MAXLEN-NEXT: Report: loop is not the innermost loop
+; MAXLEN-NEXT: Dependences:
+; MAXLEN-NEXT: Run-time memory checks:
+; MAXLEN-NEXT: Grouped accesses:
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; MAXLEN-NEXT: SCEV assumptions:
+; MAXLEN-EMPTY:
+; MAXLEN-NEXT: Expressions re-written:
;
entry:
br label %outer.header
@@ -134,38 +259,97 @@ exit:
}
define void @backward_min_distance_128(ptr %A, i64 %N) {
-; COMMON-LABEL: 'backward_min_distance_128'
-; COMMON-NEXT: loop:
-; COMMON-NEXT: Memory dependences are safe with run-time checks
-; COMMON-NEXT: Dependences:
-; COMMON-NEXT: Run-time memory checks:
-; COMMON-NEXT: Check 0:
-; COMMON-NEXT: Comparing group ([[GRP13:0x[0-9a-f]+]]):
-; COMMON-NEXT: %gep.off.iv = getelementptr inbounds i8, ptr %gep.off, i64 %iv
-; COMMON-NEXT: Against group ([[GRP14:0x[0-9a-f]+]]):
-; COMMON-NEXT: %gep = getelementptr in...
[truncated]
|
Gentle ping. |
llvm/test/Analysis/LoopAccessAnalysis/non-constant-distance-backward.ll
Outdated
Show resolved
Hide resolved
Use TargetTransformInfo::enableScalableVectorization to choose Fixed register bitwidth.
223f602
to
cd3e262
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Left one more comment inline to check if COMMON could be used there.
Might be good to clarify in the commit message/title that this now uses the fixed register width if scalable vectorization is not enabled (via TargetTransformInfo::enableScalableVectorization) and that this improves results if there are scalable vector registers, but they shouldn't be used.
Uses the fixed register width if scalable vectorization is not enabled (via TargetTransformInfo::enableScalableVectorization) and improves results if there are scalable vector registers, but they shouldn't be used.
Uses the fixed register width if scalable vectorization is not enabled (via TargetTransformInfo::enableScalableVectorization) and improves results if there are scalable vector registers, but they shouldn't be used.
Uses the fixed register width if scalable vectorization is not enabled (via TargetTransformInfo::enableScalableVectorization) and improves results if there are scalable vector registers, but they shouldn't be used.
Uses the fixed register width if scalable vectorization is not enabled (via TargetTransformInfo::enableScalableVectorization) and improves results if there are scalable vector registers, but they shouldn't be used.