[llvm] [SLP] More accurately cost RISCV scalar splats (PR #213104)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 22:48:56 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 139258 tests passed
* 3613 tests skipped
* 4 tests failed

## Failed Tests
(click on a test name to see its output)

### LLVM
<details>
<summary>LLVM.Transforms/SLPVectorizer/RISCV/check-node-without-vector-user.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mattr=+v < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\check-node-without-vector-user.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\check-node-without-vector-user.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mattr=+v
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\check-node-without-vector-user.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\check-node-without-vector-user.ll:9:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[TMP3:%.*]] = call <4 x i8> @llvm.experimental.vp.strided.load.v4i8.p0.i64(ptr align 1 getelementptr (i8, ptr @r, i64 -24147), i64 8049, <4 x i1> splat (i1 true), i32 4)
# |               ^
# | <stdin>:8:39: note: scanning from here
# | define void @test(i64 %0, ptr %1) #0 {
# |                                       ^
# | <stdin>:8:39: note: pattern attempts to capture variables: "TMP3"
# | define void @test(i64 %0, ptr %1) #0 {
# |                                       ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\check-node-without-vector-user.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           1: ; ModuleID = '<stdin>' 
# |           2: source_filename = "<stdin>" 
# |           3: target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128" 
# |           4: target triple = "riscv64-unknown-linux-gnu" 
# |           5:  
# |           6: @r = external global [8 x i8] 
# |           7:  
# |           8: define void @test(i64 %0, ptr %1) #0 { 
# | next:9'0                                          {   search range start (exclusive)
# | next:9'1                                              error: no match found in search range
# | next:9'2                                              pattern attempts to capture variables: "TMP3"
# |           9:  %3 = load i8, ptr @r, align 1 
# |          10:  %4 = trunc i8 %3 to i1 
# |          11:  %5 = select i1 %4, i64 %0, i64 0 
# |          12:  %6 = getelementptr i8, ptr @r, i64 %5 
# |          13:  %7 = load i8, ptr %6, align 1 
# |           .
# |           .
# |           .
# |          39:  %33 = add i32 %25, %32 
# |          40:  store i32 %33, ptr %1, align 4 
# |          41:  ret void 
# |          42: } 
# |          43:  
# |          44: attributes #0 = { "target-features"="+v" } 
# | next:9'3                                                } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/SLPVectorizer/RISCV/folded-broadcast-cost.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\folded-broadcast-cost.ll -passes=slp-vectorizer -mtriple=riscv64 -mattr=+v -S -disable-output -debug-only=SLP 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\folded-broadcast-cost.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -passes=slp-vectorizer -mtriple=riscv64 -mattr=+v -S -disable-output -debug-only=SLP
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\folded-broadcast-cost.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\folded-broadcast-cost.ll:27:10: error: CHECK: expected string not found in input
# | ; CHECK: SLP: Adding cost 0 for bundle Idx: 2, n=4 [i32 %s, ..].
# |          ^
# | <stdin>:601:56: note: scanning from here
# | SLP: Adding cost 0 for bundle Idx: 2, n=4 [i32 %s, ..].
# |                                                        ^
# | <stdin>:635:1: note: possible intended match here
# | SLP: Adding cost 0 for bundle Idx: 4, n=4 [i32 %s, ..].
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\folded-broadcast-cost.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           596: SLP: ScalarCost = 4 
# |           597: SLP: ReuseShuffleCost + VecCost - ScalarCost = -3 
# |           598: SLP: Adding cost -3 for bundle Idx: 1, n=4 [ %m0 = add i32 %s, %a0, ..]. 
# |           599: SLP: Current total cost = -6 
# |           600: SLP: perfect diamond match for gather bundle Idx: 2, n=4 [i32 %s, ..]. 
# |           601: SLP: Adding cost 0 for bundle Idx: 2, n=4 [i32 %s, ..]. 
# | check:27'0                                                           {   search range start (exclusive)
# | check:27'1                                                               error: no match found in search range
# |           602: SLP: Current total cost = -6 
# |           603: SLP: Calculated costs for Tree: 
# |           604: 3. 
# |           605: Operand 0: 
# |           606:  i32 %s 
# |             .
# |             .
# |             .
# |           630: SLP: ScalarCost = 4 
# |           631: SLP: ReuseShuffleCost + VecCost - ScalarCost = -3 
# |           632: SLP: Adding cost -3 for bundle Idx: 3, n=4 [ %a0 = add i32 %s, %b0, ..]. 
# |           633: SLP: Current total cost = -9 
# |           634: SLP: perfect diamond match for gather bundle Idx: 4, n=4 [i32 %s, ..]. 
# |           635: SLP: Adding cost 0 for bundle Idx: 4, n=4 [i32 %s, ..]. 
# | check:27'2     ?                                                         possible intended match
# |           636: SLP: Current total cost = -9 
# |           637: SLP: Calculated costs for Tree: 
# |           638: 5. 
# |           639: Operand 0: 
# |           640:  i32 %s 
# |             .
# |             .
# |             .
# |           841: SLP: validating user: %b2 = add i32 %s, %x2. 
# |           842: SLP: Erasing scalar: %x2 = load i32, ptr %p2, align 4. 
# |           843: SLP: validating user: %b3 = add i32 %s, %x3. 
# |           844: SLP: Erasing scalar: %x3 = load i32, ptr %p3, align 4. 
# |           845: SLP: Optimizing 2 gather sequences instructions. 
# |           846: SLP: vectorized "fmul_splat_nested" 
# | check:27'3                                         } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/SLPVectorizer/RISCV/remark-zext-incoming-for-neg-icmp.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mattr=+v -pass-remarks-output=C:\_work\llvm-project\llvm-project\build\test\Transforms\SLPVectorizer\RISCV\Output\remark-zext-incoming-for-neg-icmp.ll.tmp < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\remark-zext-incoming-for-neg-icmp.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\remark-zext-incoming-for-neg-icmp.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mattr=+v '-pass-remarks-output=C:\_work\llvm-project\llvm-project\build\test\Transforms\SLPVectorizer\RISCV\Output\remark-zext-incoming-for-neg-icmp.ll.tmp'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\remark-zext-incoming-for-neg-icmp.ll'
# note: command had no output on stdout or stderr
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe --input-file=C:\_work\llvm-project\llvm-project\build\test\Transforms\SLPVectorizer\RISCV\Output\remark-zext-incoming-for-neg-icmp.ll.tmp --check-prefix=YAML C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\remark-zext-incoming-for-neg-icmp.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' '--input-file=C:\_work\llvm-project\llvm-project\build\test\Transforms\SLPVectorizer\RISCV\Output\remark-zext-incoming-for-neg-icmp.ll.tmp' --check-prefix=YAML 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\remark-zext-incoming-for-neg-icmp.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\remark-zext-incoming-for-neg-icmp.ll:11:14: error: YAML-NEXT: expected string not found in input
# | ; YAML-NEXT: - Cost: '-12'
# |              ^
# | C:\_work\llvm-project\llvm-project\build\test\Transforms\SLPVectorizer\RISCV\Output\remark-zext-incoming-for-neg-icmp.ll.tmp:6:56: note: scanning from here
# |  - String: 'Vectorized horizontal reduction with cost '
# |                                                        ^
# | C:\_work\llvm-project\llvm-project\build\test\Transforms\SLPVectorizer\RISCV\Output\remark-zext-incoming-for-neg-icmp.ll.tmp:7:2: note: possible intended match here
# |  - Cost: '-10'
# |  ^
# | 
# | Input file: C:\_work\llvm-project\llvm-project\build\test\Transforms\SLPVectorizer\RISCV\Output\remark-zext-incoming-for-neg-icmp.ll.tmp
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\remark-zext-incoming-for-neg-icmp.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: --- !Passed 
# |            2: Pass: slp-vectorizer 
# |            3: Name: VectorizedHorizontalReduction 
# |            4: Function: test 
# |            5: Args: 
# |            6:  - String: 'Vectorized horizontal reduction with cost ' 
# | next:11'0                                                           {   search range start (exclusive)
# | next:11'1                                                               error: no match found in search range
# |            7:  - Cost: '-10' 
# | next:11'2      ?               possible intended match
# |            8:  - String: ' and with tree size ' 
# |            9:  - TreeSize: '8' 
# |           10: ... 
# | next:11'3         } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/SLPVectorizer/RISCV/reordered-buildvector-scalars.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mcpu=sifive-x280 < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mcpu=sifive-x280
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll'
# note: command had no output on stdout or stderr
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mcpu=sifive-x280 < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll -slp-threshold=-3 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll --check-prefix=THRESH
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mcpu=sifive-x280 -slp-threshold=-3
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll' --check-prefix=THRESH
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll:57:16: error: THRESH-NEXT: is not on the line after the previous match
# | ; THRESH-NEXT: [[TMP30:%.*]] = insertelement <2 x i32> poison, i32 [[TMP0]], i64 0
# |                ^
# | <stdin>:16:2: note: 'next' match was here
# |  %2 = insertelement <2 x i32> poison, i32 %0, i64 0
# |  ^
# | <stdin>:13:28: note: previous match ended here
# |  %mul1445.i = shl i32 %0, 1
# |                            ^
# | <stdin>:14:1: note: non-matching line after previous match is here
# |  %add2235.i16 = or i32 %0, 1
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\SLPVectorizer\RISCV\reordered-buildvector-scalars.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |            8:  
# |            9: @images = external global %struct.ImageParameters 
# |           10:  
# |           11: define fastcc i32 @test(i32 %0, i32 %add111.i.i, <4 x i32> %PredPel.i.sroa.86.72.vec.extract, <4 x i32> %1) #0 { 
# |           12: entry: 
# |           13:  %mul1445.i = shl i32 %0, 1 
# | next:57'0                               {   search range start (exclusive)
# |           14:  %add2235.i16 = or i32 %0, 1 
# |           15:  %add2323.i = add i32 %0, 1 
# |           16:  %2 = insertelement <2 x i32> poison, i32 %0, i64 0 
# | next:57'1      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   error: match on wrong line
# |           17:  %3 = shufflevector <2 x i32> %2, <2 x i32> poison, <2 x i32> zeroinitializer 
# |           18:  %4 = add <2 x i32> %3, <i32 0, i32 1> 
# |           19:  %5 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 0> 
# |           20:  %6 = ashr <4 x i32> %5, <i32 1, i32 0, i32 0, i32 1> 
# |           21:  %7 = insertelement <3 x i32> poison, i32 %add111.i.i, i64 0 
# |            .
# |            .
# |            .
# |           48:  %34 = shufflevector <15 x i16> %33, <15 x i16> poison, <32 x i32> <i32 0, i32 8, i32 9, i32 1, i32 11, i32 2, i32 3, i32 4, i32 5, i32 6, i32 0, i32 8, i32 9, i32 1, i32 11, i32 10, i32 12, i32 4, i32 5, i32 6, i32 0, i32 8, i32 9, i32 7, i32 13, i32 10, i32 12, i32 4, i32 5, i32 6, i32 0, i32 14> 
# |           49:  store <32 x i16> %34, ptr getelementptr inbounds nuw (i8, ptr @images, i64 8170), align 2 
# |           50:  ret i32 0 
# |           51: } 
# |           52:  
# |           53: attributes #0 = { "target-cpu"="sifive-x280" } 
# | next:57'2                                                    } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/213104


More information about the llvm-commits mailing list