[llvm] [SLP] Fix : Do not skip profitable small VFs in Vectorize Stores (PR #177100)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 21 10:57:27 PST 2026
https://github.com/Soumik15630 updated https://github.com/llvm/llvm-project/pull/177100
>From 4d4907bb7fa501a325ab03a45d1e576977aeddfe Mon Sep 17 00:00:00 2001
From: Soumik15630m <soumik15630m at gmail.com>
Date: Wed, 21 Jan 2026 11:51:04 +0530
Subject: [PATCH 1/5] [SLP] Fix : Do not skip profitable small VFs in Vectorize
Stores
---
.../Transforms/Vectorize/SLPVectorizer.cpp | 30 +++++++++----
.../RISCV/stores-equal-to-maxregvf.ll | 42 +++++++++++++++++++
2 files changed, 65 insertions(+), 7 deletions(-)
create mode 100644 llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 762b394f8ea8a..0678a78f5d59e 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -24024,7 +24024,9 @@ bool SLPVectorizerPass::vectorizeStores(
unsigned FirstUnvecStore =
std::distance(RangeSizes.begin(),
find_if(RangeSizes, std::bind(IsNotVectorized,
- VF >= MaxRegVF, _1)));
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
+ VF > MaxRegVF, _1)));
// Form slices of size VF starting from FirstUnvecStore and try to
// vectorize them.
@@ -24032,12 +24034,16 @@ bool SLPVectorizerPass::vectorizeStores(
unsigned FirstVecStore = std::distance(
RangeSizes.begin(),
find_if(RangeSizes.drop_front(FirstUnvecStore),
- std::bind(IsVectorized, VF >= MaxRegVF, _1)));
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
+ std::bind(IsVectorized, VF > MaxRegVF, _1)));
unsigned MaxSliceEnd = FirstVecStore >= End ? End : FirstVecStore;
for (unsigned SliceStartIdx = FirstUnvecStore;
SliceStartIdx + VF <= MaxSliceEnd;) {
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
if (!checkTreeSizes(RangeSizes.slice(SliceStartIdx, VF),
- VF >= MaxRegVF)) {
+ VF > MaxRegVF)) {
++SliceStartIdx;
continue;
}
@@ -24105,13 +24111,17 @@ bool SLPVectorizerPass::vectorizeStores(
}
if (VF > 2 && Res &&
!all_of(RangeSizes.slice(SliceStartIdx, VF),
- std::bind(VFIsProfitable, VF >= MaxRegVF, TreeSize,
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
+ std::bind(VFIsProfitable, VF > MaxRegVF, TreeSize,
_1))) {
SliceStartIdx += VF;
continue;
}
// Check for the very big VFs that we're not rebuilding same
// trees, just with larger number of elements.
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
if (VF > MaxRegVF && TreeSize > 1 &&
all_of(RangeSizes.slice(SliceStartIdx, VF),
std::bind(FirstSizeSame, TreeSize, _1))) {
@@ -24124,7 +24134,9 @@ bool SLPVectorizerPass::vectorizeStores(
if (TreeSize > 1) {
for (std::pair<unsigned, unsigned> &P :
RangeSizes.slice(SliceStartIdx, VF)) {
- if (VF >= MaxRegVF)
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
+ if (VF > MaxRegVF)
P.second = std::max(P.second, TreeSize);
else
P.first = std::max(P.first, TreeSize);
@@ -24141,9 +24153,13 @@ bool SLPVectorizerPass::vectorizeStores(
FirstUnvecStore = std::distance(
RangeSizes.begin(),
find_if(RangeSizes.drop_front(MaxSliceEnd),
- std::bind(IsNotVectorized, VF >= MaxRegVF, _1)));
+ std::bind(IsNotVectorized, VF > MaxRegVF, _1)));
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
}
- if (!AnyProfitableGraph && VF >= MaxRegVF && has_single_bit(VF))
+ if (!AnyProfitableGraph && VF > MaxRegVF && has_single_bit(VF))
+ // to go with the new definition of Large Vf definition of not counting vf which is equal to
+ // maxregvf as large - changed ">=" to ">"
break;
}
// All values vectorized - exit.
diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
new file mode 100644
index 0000000000000..aa0f75c9c3eaf
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
@@ -0,0 +1,42 @@
+define void @foo(ptr %pl, ptr %ps) {
+ %gep_l0 = getelementptr inbounds i32, ptr %pl, i32 92
+ %gep_l1 = getelementptr inbounds i32, ptr %pl, i32 0
+ %gep_l2 = getelementptr inbounds i32, ptr %pl, i32 2
+ %gep_l3 = getelementptr inbounds i32, ptr %pl, i32 3
+ %gep_l4 = getelementptr inbounds i32, ptr %pl, i32 4
+ %gep_l5 = getelementptr inbounds i32, ptr %pl, i32 5
+ %gep_l6 = getelementptr inbounds i32, ptr %pl, i32 7
+ %gep_l7 = getelementptr inbounds i32, ptr %pl, i32 93
+
+ %load0 = load i32, ptr %gep_l0 , align 1
+ %load1 = load i32, ptr %gep_l1 , align 1
+ %load2 = load i32, ptr %gep_l2 , align 1
+ %load3 = load i32, ptr %gep_l3 , align 1
+ %load4 = load i32, ptr %gep_l4 , align 1
+ %load5 = load i32, ptr %gep_l5 , align 1
+ %load6 = load i32, ptr %gep_l6 , align 1
+ %load7 = load i32, ptr %gep_l7 , align 1
+
+ %add6 = add i32 %load6, 2
+ %add7 = add i32 %load7, 2
+
+ %gep_s0 = getelementptr inbounds i32, ptr %ps, i32 0
+ %gep_s1 = getelementptr inbounds i32, ptr %ps, i32 1
+ %gep_s2 = getelementptr inbounds i32, ptr %ps, i32 2
+ %gep_s3 = getelementptr inbounds i32, ptr %ps, i32 3
+ %gep_s4 = getelementptr inbounds i32, ptr %ps, i32 4
+ %gep_s5 = getelementptr inbounds i32, ptr %ps, i32 5
+ %gep_s6 = getelementptr inbounds i32, ptr %ps, i32 6
+ %gep_s7 = getelementptr inbounds i32, ptr %ps, i32 7
+
+ store i32 %load0, ptr %gep_s0, align 1
+ store i32 %load1, ptr %gep_s1, align 1
+ store i32 %load2, ptr %gep_s2, align 1
+ store i32 %load3, ptr %gep_s3, align 1
+ store i32 %load4, ptr %gep_s4, align 1
+ store i32 %load5, ptr %gep_s5, align 1
+ store i32 %add6, ptr %gep_s6, align 1
+ store i32 %add7, ptr %gep_s7, align 1
+
+ ret void
+}
\ No newline at end of file
>From f4904cc456bff28043847c078c6a61dae391e49b Mon Sep 17 00:00:00 2001
From: Soumik15630m <soumik15630m at gmail.com>
Date: Wed, 21 Jan 2026 18:22:47 +0530
Subject: [PATCH 2/5] VF==MaxRegVF(4) testcases are improved with fixed
ordering
---
.../RISCV/stores-equal-to-maxregvf.ll | 59 +++++++++++--------
1 file changed, 35 insertions(+), 24 deletions(-)
diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
index aa0f75c9c3eaf..109d1b614dd2c 100644
--- a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
+++ b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
@@ -1,24 +1,35 @@
-define void @foo(ptr %pl, ptr %ps) {
- %gep_l0 = getelementptr inbounds i32, ptr %pl, i32 92
- %gep_l1 = getelementptr inbounds i32, ptr %pl, i32 0
- %gep_l2 = getelementptr inbounds i32, ptr %pl, i32 2
+; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 -mattr=+m,+v -S | FileCheck %s
+
+define void @test_max_reg_vf_boundary(ptr %pl, ptr %ps) {
+; CHECK-LABEL: @test_max_reg_vf_boundary(
+; ensuring maxregVF slice is vectorized correctly even with the mixed tree sizes
+; CHECK: load <4 x i32>
+; CHECK-NEXT: store <4 x i32>
+
+ ; random offsets scalar tests
+ %gep_l_unrelated_1 = getelementptr inbounds i32, ptr %pl, i32 100
+ %gep_l_unrelated_2 = getelementptr inbounds i32, ptr %pl, i32 200
+
+ ; vf = maxregvf tests
+ %gep_l_contiguous = getelementptr inbounds i32, ptr %pl, i32 2
%gep_l3 = getelementptr inbounds i32, ptr %pl, i32 3
%gep_l4 = getelementptr inbounds i32, ptr %pl, i32 4
%gep_l5 = getelementptr inbounds i32, ptr %pl, i32 5
- %gep_l6 = getelementptr inbounds i32, ptr %pl, i32 7
- %gep_l7 = getelementptr inbounds i32, ptr %pl, i32 93
- %load0 = load i32, ptr %gep_l0 , align 1
- %load1 = load i32, ptr %gep_l1 , align 1
- %load2 = load i32, ptr %gep_l2 , align 1
- %load3 = load i32, ptr %gep_l3 , align 1
- %load4 = load i32, ptr %gep_l4 , align 1
- %load5 = load i32, ptr %gep_l5 , align 1
- %load6 = load i32, ptr %gep_l6 , align 1
- %load7 = load i32, ptr %gep_l7 , align 1
+ ; forcing differing tree sizes
+ %gep_l_op_mismatch_1 = getelementptr inbounds i32, ptr %pl, i32 300
+ %gep_l_op_mismatch_2 = getelementptr inbounds i32, ptr %pl, i32 400
- %add6 = add i32 %load6, 2
- %add7 = add i32 %load7, 2
+ %load0 = load i32, ptr %gep_l_unrelated_1, align 4
+ %load1 = load i32, ptr %gep_l_unrelated_2, align 4
+ %load2 = load i32, ptr %gep_l_contiguous, align 4
+ %load3 = load i32, ptr %gep_l3, align 4
+ %load4 = load i32, ptr %gep_l4, align 4
+ %load5 = load i32, ptr %gep_l5, align 4
+ %load6 = load i32, ptr %gep_l_op_mismatch_1, align 4
+ %load7 = load i32, ptr %gep_l_op_mismatch_2, align 4
+ %add6 = add i32 %load6, 1
+ %add7 = add i32 %load7, 1
%gep_s0 = getelementptr inbounds i32, ptr %ps, i32 0
%gep_s1 = getelementptr inbounds i32, ptr %ps, i32 1
@@ -29,14 +40,14 @@ define void @foo(ptr %pl, ptr %ps) {
%gep_s6 = getelementptr inbounds i32, ptr %ps, i32 6
%gep_s7 = getelementptr inbounds i32, ptr %ps, i32 7
- store i32 %load0, ptr %gep_s0, align 1
- store i32 %load1, ptr %gep_s1, align 1
- store i32 %load2, ptr %gep_s2, align 1
- store i32 %load3, ptr %gep_s3, align 1
- store i32 %load4, ptr %gep_s4, align 1
- store i32 %load5, ptr %gep_s5, align 1
- store i32 %add6, ptr %gep_s6, align 1
- store i32 %add7, ptr %gep_s7, align 1
+ store i32 %load0, ptr %gep_s0, align 4
+ store i32 %load1, ptr %gep_s1, align 4
+ store i32 %load2, ptr %gep_s2, align 4
+ store i32 %load3, ptr %gep_s3, align 4
+ store i32 %load4, ptr %gep_s4, align 4
+ store i32 %load5, ptr %gep_s5, align 4
+ store i32 %add6, ptr %gep_s6, align 4
+ store i32 %add7, ptr %gep_s7, align 4
ret void
}
\ No newline at end of file
>From 2d4da57558ef5c69cd2298b653a563cb546c8465 Mon Sep 17 00:00:00 2001
From: Soumik15630m <soumik15630m at gmail.com>
Date: Wed, 21 Jan 2026 23:44:57 +0530
Subject: [PATCH 3/5] [SLP] NFC: clean-up comments & formatting..
---
.../lib/Transforms/Vectorize/SLPVectorizer.cpp | 18 ++----------------
.../RISCV/stores-equal-to-maxregvf.ll | 1 +
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 0678a78f5d59e..458aca3d87bca 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -24024,9 +24024,9 @@ bool SLPVectorizerPass::vectorizeStores(
unsigned FirstUnvecStore =
std::distance(RangeSizes.begin(),
find_if(RangeSizes, std::bind(IsNotVectorized,
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
VF > MaxRegVF, _1)));
+ // Treat VF==MaxRegVF as a small VF. Large-VF will be considered when VF>MaxRegVF
+ // prevents skipping of viable subslices with mixed tree sizes
// Form slices of size VF starting from FirstUnvecStore and try to
// vectorize them.
@@ -24034,14 +24034,10 @@ bool SLPVectorizerPass::vectorizeStores(
unsigned FirstVecStore = std::distance(
RangeSizes.begin(),
find_if(RangeSizes.drop_front(FirstUnvecStore),
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
std::bind(IsVectorized, VF > MaxRegVF, _1)));
unsigned MaxSliceEnd = FirstVecStore >= End ? End : FirstVecStore;
for (unsigned SliceStartIdx = FirstUnvecStore;
SliceStartIdx + VF <= MaxSliceEnd;) {
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
if (!checkTreeSizes(RangeSizes.slice(SliceStartIdx, VF),
VF > MaxRegVF)) {
++SliceStartIdx;
@@ -24111,8 +24107,6 @@ bool SLPVectorizerPass::vectorizeStores(
}
if (VF > 2 && Res &&
!all_of(RangeSizes.slice(SliceStartIdx, VF),
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
std::bind(VFIsProfitable, VF > MaxRegVF, TreeSize,
_1))) {
SliceStartIdx += VF;
@@ -24120,8 +24114,6 @@ bool SLPVectorizerPass::vectorizeStores(
}
// Check for the very big VFs that we're not rebuilding same
// trees, just with larger number of elements.
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
if (VF > MaxRegVF && TreeSize > 1 &&
all_of(RangeSizes.slice(SliceStartIdx, VF),
std::bind(FirstSizeSame, TreeSize, _1))) {
@@ -24134,8 +24126,6 @@ bool SLPVectorizerPass::vectorizeStores(
if (TreeSize > 1) {
for (std::pair<unsigned, unsigned> &P :
RangeSizes.slice(SliceStartIdx, VF)) {
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
if (VF > MaxRegVF)
P.second = std::max(P.second, TreeSize);
else
@@ -24154,12 +24144,8 @@ bool SLPVectorizerPass::vectorizeStores(
RangeSizes.begin(),
find_if(RangeSizes.drop_front(MaxSliceEnd),
std::bind(IsNotVectorized, VF > MaxRegVF, _1)));
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
}
if (!AnyProfitableGraph && VF > MaxRegVF && has_single_bit(VF))
- // to go with the new definition of Large Vf definition of not counting vf which is equal to
- // maxregvf as large - changed ">=" to ">"
break;
}
// All values vectorized - exit.
diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
index 109d1b614dd2c..579587c50a725 100644
--- a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
+++ b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
@@ -50,4 +50,5 @@ define void @test_max_reg_vf_boundary(ptr %pl, ptr %ps) {
store i32 %add7, ptr %gep_s7, align 4
ret void
+
}
\ No newline at end of file
>From fabcb9e046ff37c73aa44d0c92a3e4231aab73c3 Mon Sep 17 00:00:00 2001
From: Soumik15630m <soumik15630m at gmail.com>
Date: Wed, 21 Jan 2026 23:47:38 +0530
Subject: [PATCH 4/5] [SLP] NFC: clean-up comments & formatting..
---
.../Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
index 579587c50a725..7b543a2fdb7ab 100644
--- a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
+++ b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
@@ -51,4 +51,4 @@ define void @test_max_reg_vf_boundary(ptr %pl, ptr %ps) {
ret void
-}
\ No newline at end of file
+}
>From 85b9828381c565fae74ad104cf6184539daa83e2 Mon Sep 17 00:00:00 2001
From: Soumik15630m <soumik15630m at gmail.com>
Date: Thu, 22 Jan 2026 00:05:50 +0530
Subject: [PATCH 5/5] [SLP] Updated Regression test file
---
.../Transforms/Vectorize/SLPVectorizer.cpp | 3 --
.../RISCV/stores-equal-to-maxregvf.ll | 38 +++++++++++++++----
2 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 458aca3d87bca..ecd523bdc1d12 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -24025,9 +24025,6 @@ bool SLPVectorizerPass::vectorizeStores(
std::distance(RangeSizes.begin(),
find_if(RangeSizes, std::bind(IsNotVectorized,
VF > MaxRegVF, _1)));
- // Treat VF==MaxRegVF as a small VF. Large-VF will be considered when VF>MaxRegVF
- // prevents skipping of viable subslices with mixed tree sizes
-
// Form slices of size VF starting from FirstUnvecStore and try to
// vectorize them.
while (FirstUnvecStore < End) {
diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
index 7b543a2fdb7ab..41f6057f24013 100644
--- a/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
+++ b/llvm/test/Transforms/SLPVectorizer/RISCV/stores-equal-to-maxregvf.ll
@@ -1,22 +1,44 @@
-; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 -mattr=+m,+v -S | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 -mattr=+v -S | FileCheck %s
define void @test_max_reg_vf_boundary(ptr %pl, ptr %ps) {
-; CHECK-LABEL: @test_max_reg_vf_boundary(
-; ensuring maxregVF slice is vectorized correctly even with the mixed tree sizes
-; CHECK: load <4 x i32>
-; CHECK-NEXT: store <4 x i32>
+; CHECK-LABEL: define void @test_max_reg_vf_boundary(
+; CHECK-SAME: ptr [[PL:%.*]], ptr [[PS:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[GEP_L_UNRELATED_1:%.*]] = getelementptr inbounds i32, ptr [[PL]], i32 100
+; CHECK-NEXT: [[GEP_L_UNRELATED_2:%.*]] = getelementptr inbounds i32, ptr [[PL]], i32 200
+; CHECK-NEXT: [[GEP_L_CONTIGUOUS:%.*]] = getelementptr inbounds i32, ptr [[PL]], i32 2
+; CHECK-NEXT: [[GEP_L_OP_MISMATCH_1:%.*]] = getelementptr inbounds i32, ptr [[PL]], i32 300
+; CHECK-NEXT: [[GEP_L_OP_MISMATCH_2:%.*]] = getelementptr inbounds i32, ptr [[PL]], i32 400
+; CHECK-NEXT: [[LOAD0:%.*]] = load i32, ptr [[GEP_L_UNRELATED_1]], align 4
+; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[GEP_L_UNRELATED_2]], align 4
+; CHECK-NEXT: [[LOAD6:%.*]] = load i32, ptr [[GEP_L_OP_MISMATCH_1]], align 4
+; CHECK-NEXT: [[LOAD7:%.*]] = load i32, ptr [[GEP_L_OP_MISMATCH_2]], align 4
+; CHECK-NEXT: [[ADD6:%.*]] = add i32 [[LOAD6]], 1
+; CHECK-NEXT: [[ADD7:%.*]] = add i32 [[LOAD7]], 1
+; CHECK-NEXT: [[GEP_S0:%.*]] = getelementptr inbounds i32, ptr [[PS]], i32 0
+; CHECK-NEXT: [[GEP_S1:%.*]] = getelementptr inbounds i32, ptr [[PS]], i32 1
+; CHECK-NEXT: [[GEP_S2:%.*]] = getelementptr inbounds i32, ptr [[PS]], i32 2
+; CHECK-NEXT: [[GEP_S6:%.*]] = getelementptr inbounds i32, ptr [[PS]], i32 6
+; CHECK-NEXT: [[GEP_S7:%.*]] = getelementptr inbounds i32, ptr [[PS]], i32 7
+; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr [[GEP_L_CONTIGUOUS]], align 4
+; CHECK-NEXT: store i32 [[LOAD0]], ptr [[GEP_S0]], align 4
+; CHECK-NEXT: store i32 [[LOAD1]], ptr [[GEP_S1]], align 4
+; CHECK-NEXT: store <4 x i32> [[TMP1]], ptr [[GEP_S2]], align 4
+; CHECK-NEXT: store i32 [[ADD6]], ptr [[GEP_S6]], align 4
+; CHECK-NEXT: store i32 [[ADD7]], ptr [[GEP_S7]], align 4
+; CHECK-NEXT: ret void
+;
+
- ; random offsets scalar tests
%gep_l_unrelated_1 = getelementptr inbounds i32, ptr %pl, i32 100
%gep_l_unrelated_2 = getelementptr inbounds i32, ptr %pl, i32 200
- ; vf = maxregvf tests
+ ; contagious loads- to fit exactly one register
%gep_l_contiguous = getelementptr inbounds i32, ptr %pl, i32 2
%gep_l3 = getelementptr inbounds i32, ptr %pl, i32 3
%gep_l4 = getelementptr inbounds i32, ptr %pl, i32 4
%gep_l5 = getelementptr inbounds i32, ptr %pl, i32 5
- ; forcing differing tree sizes
%gep_l_op_mismatch_1 = getelementptr inbounds i32, ptr %pl, i32 300
%gep_l_op_mismatch_2 = getelementptr inbounds i32, ptr %pl, i32 400
More information about the llvm-commits
mailing list