Skip to content

Conversation

artagnon
Copy link
Contributor

@artagnon artagnon commented Sep 15, 2025

Invariant stores of reductions are removed early in the VPlan construction, and there is no reason to ignore them while costing.

Invariant stores of reductions are handled early in the VPlan
construction, and there is no reason to ignore them while costing.
@llvmbot
Copy link
Member

llvmbot commented Sep 15, 2025

@llvm/pr-subscribers-vectorizers

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

Changes

Invariant stores of reductions are handled early in the VPlan construction, and there is no reason to ignore them while costing.


Full diff: https://github.com/llvm/llvm-project/pull/158682.diff

2 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (-14)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll (+18-4)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 640a98c622f80..91266328ca93d 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6367,19 +6367,8 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
 
   LoopBlocksDFS DFS(TheLoop);
   DFS.perform(LI);
-  MapVector<Value *, SmallVector<Value *>> DeadInvariantStoreOps;
   for (BasicBlock *BB : reverse(make_range(DFS.beginRPO(), DFS.endRPO())))
     for (Instruction &I : reverse(*BB)) {
-      // Find all stores to invariant variables. Since they are going to sink
-      // outside the loop we do not need calculate cost for them.
-      StoreInst *SI;
-      if ((SI = dyn_cast<StoreInst>(&I)) &&
-          Legal->isInvariantAddressOfReduction(SI->getPointerOperand())) {
-        ValuesToIgnore.insert(&I);
-        DeadInvariantStoreOps[SI->getPointerOperand()].push_back(
-            SI->getValueOperand());
-      }
-
       if (VecValuesToIgnore.contains(&I) || ValuesToIgnore.contains(&I))
         continue;
 
@@ -6426,9 +6415,6 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
     append_range(DeadInterleavePointerOps, Op->operands());
   }
 
-  for (const auto &[_, Ops] : DeadInvariantStoreOps)
-    llvm::append_range(DeadOps, drop_end(Ops));
-
   // Mark ops that would be trivially dead and are only used by ignored
   // instructions as free.
   BasicBlock *Header = TheLoop->getHeader();
diff --git a/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll b/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
index 199f1c15fbc3d..2f74049968544 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
@@ -398,16 +398,30 @@ for.end:                                          ; preds = %for.body
 define void @test_store_of_final_reduction_value(i64 %x, ptr %dst) {
 ; CHECK-LABEL: define void @test_store_of_final_reduction_value(
 ; CHECK-SAME: i64 [[X:%.*]], ptr [[DST:%.*]]) #[[ATTR0]] {
-; CHECK-NEXT:  [[ENTRY:.*]]:
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
+; CHECK:       [[VECTOR_PH]]:
+; CHECK-NEXT:    [[BROADCAST_SPLATINSERT:%.*]] = insertelement <2 x i64> poison, i64 [[X]], i64 0
+; CHECK-NEXT:    [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i64> [[BROADCAST_SPLATINSERT]], <2 x i64> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT:    br label %[[VECTOR_BODY:.*]]
+; CHECK:       [[VECTOR_BODY]]:
+; CHECK-NEXT:    [[VEC_PHI:%.*]] = phi <2 x i64> [ <i64 0, i64 1>, %[[VECTOR_PH]] ], [ [[TMP0:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT:    [[TMP0]] = mul <2 x i64> [[VEC_PHI]], [[BROADCAST_SPLAT]]
+; CHECK-NEXT:    br i1 true, label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP32:![0-9]+]]
+; CHECK:       [[MIDDLE_BLOCK]]:
+; CHECK-NEXT:    [[TMP1:%.*]] = call i64 @llvm.vector.reduce.mul.v2i64(<2 x i64> [[TMP0]])
+; CHECK-NEXT:    store i64 [[TMP1]], ptr [[DST]], align 8
+; CHECK-NEXT:    br label %[[EXIT:.*]]
+; CHECK:       [[SCALAR_PH]]:
 ; CHECK-NEXT:    br label %[[LOOP:.*]]
 ; CHECK:       [[LOOP]]:
-; CHECK-NEXT:    [[IV4:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ]
-; CHECK-NEXT:    [[RED:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[RED_NEXT:%.*]], %[[LOOP]] ]
+; CHECK-NEXT:    [[IV4:%.*]] = phi i64 [ 0, %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ]
+; CHECK-NEXT:    [[RED:%.*]] = phi i64 [ 0, %[[SCALAR_PH]] ], [ [[RED_NEXT:%.*]], %[[LOOP]] ]
 ; CHECK-NEXT:    [[RED_NEXT]] = mul i64 [[RED]], [[X]]
 ; CHECK-NEXT:    store i64 [[RED_NEXT]], ptr [[DST]], align 8
 ; CHECK-NEXT:    [[IV_NEXT]] = add i64 [[IV4]], 1
 ; CHECK-NEXT:    [[EC:%.*]] = icmp eq i64 [[IV4]], 1
-; CHECK-NEXT:    br i1 [[EC]], label %[[EXIT:.*]], label %[[LOOP]]
+; CHECK-NEXT:    br i1 [[EC]], label %[[EXIT]], label %[[LOOP]], !llvm.loop [[LOOP33:![0-9]+]]
 ; CHECK:       [[EXIT]]:
 ; CHECK-NEXT:    ret void
 ;

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, does that mean we now compute the cost of the scalar store for VF = 1, whereas before we would not compute it?

@artagnon
Copy link
Contributor Author

Hmm, does that mean we now compute the cost of the scalar store for VF = 1, whereas before we would not compute it?

Yes, I think so.

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, does that mean we now compute the cost of the scalar store for VF = 1, whereas before we would not compute it?

Yes, I think so.

Ok, that should be more accurate, as the scalar loop must execute the store on each iteration.

LGTM thanks.

@artagnon artagnon merged commit 66fd420 into llvm:main Sep 24, 2025
12 checks passed
@artagnon artagnon deleted the lv-inv-store-cost branch September 24, 2025 10:33
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 24, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-ubuntu-fast running on sie-linux-worker while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/36235

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/LoopVectorize/X86/invariant-store-vectorization.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll | /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# note: command had no output on stdout or stderr
# executed command: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# .---command stderr------------
# | �[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll:402:15: �[0m�[0;1;31merror: �[0m�[1mCHECK-NEXT: expected string not found in input
�[0m# | �[1m�[0m; CHECK-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
# | �[0;1;32m              ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:366:7: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m# | �[1m�[0mentry:
# | �[0;1;32m      ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:394:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m# | �[1m�[0m br i1 %ec, label %exit, label %loop
# | �[0;1;32m ^
�[0m# | �[0;1;32m�[0m
# | Input file: <stdin>
# | Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# | �[1m�[0m�[0;1;30m             1: �[0m�[1m�[0;1;46m; ModuleID = '/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll' �[0m
# | �[0;1;30m             2: �[0m�[1m�[0;1;46msource_filename = "/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll" �[0m
# | �[0;1;30m             3: �[0m�[1m�[0;1;46mtarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" �[0m
# | �[0;1;30m             4: �[0m�[1m�[0;1;46mtarget triple = "x86_64-unknown-linux-gnu" �[0m
# | �[0;1;30m             5: �[0m�[1m�[0;1;46m �[0m
# | �[0;1;30m             6: �[0m�[1m�[0;1;46m�[0mdefine i32 @inv_val_store_to_inv_address_with_reduction(ptr %a, i64 %n, ptr %b) #0 {�[0;1;46m �[0m
# | �[0;1;32mlabel:11'0      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;32mlabel:11'1      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;32msame:12'0                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;32msame:12'1                                                                   ^~                        captured var "A"
�[0m# | �[0;1;32m�[0m�[0;1;32msame:12'2                                                                           ^~                captured var "N"
�[0m# | �[0;1;32m�[0m�[0;1;32msame:12'3                                                                                   ^~        captured var "B"
�[0m# | �[0;1;32m�[0m�[0;1;32msame:12'4                                                                                        ^    captured var "ATTR0"
�[0m# | �[0;1;32m�[0m�[0;1;30m             7: �[0m�[1m�[0;1;46m�[0miter.check:�[0;1;46m �[0m
# | �[0;1;32mnext:13'0       ^~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;32mnext:13'1       ^~~~~~~~~~   captured var "ITER_CHECK"
�[0m# | �[0;1;32m�[0m�[0;1;30m             8: �[0m�[1m�[0;1;46m �[0m%ntrunc = trunc i64 %n to i32�[0;1;46m �[0m
# | �[0;1;32mnext:14'0        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;32mnext:14'1                                       with "N" equal to "%n"
�[0m# | �[0;1;32m�[0m�[0;1;32mnext:14'2        ^~~~~~~                        captured var "NTRUNC"
�[0m# | �[0;1;32m�[0m�[0;1;30m             9: �[0m�[1m�[0;1;46m �[0m%smax2 = call i64 @llvm.smax.i64(i64 %n, i64 1)�[0;1;46m �[0m
# | �[0;1;32mnext:15'0        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 24, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/26087

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/LoopVectorize/X86/invariant-store-vectorization.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/b/ml-opt-dev-x86-64-b1/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll | /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /b/ml-opt-dev-x86-64-b1/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# .---command stderr------------
# | /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll:402:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
# |               ^
# | <stdin>:366:7: note: scanning from here
# | entry:
# |       ^
# | <stdin>:394:2: note: possible intended match here
# |  br i1 %ec, label %exit, label %loop
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           361: for.end: ; preds = %vec.epilog.middle.block, %middle.block, %latch 
# |           362:  ret void 
# |           363: } 
# |           364:  
# |           365: define void @test_store_of_final_reduction_value(i64 %x, ptr %dst) #0 { 
# |           366: entry: 
# | next:402'0           X error: no match found
# |           367:  br label %vector.ph 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~
# |           368:  
# | next:402'0     ~
# |           369: vector.ph: ; preds = %entry 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           370:  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %x, i64 0 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           371:  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 24, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/25932

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/LoopVectorize/X86/invariant-store-vectorization.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/b/ml-opt-devrel-x86-64-b1/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll | /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /b/ml-opt-devrel-x86-64-b1/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# .---command stderr------------
# | /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll:402:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
# |               ^
# | <stdin>:366:7: note: scanning from here
# | entry:
# |       ^
# | <stdin>:394:2: note: possible intended match here
# |  br i1 %ec, label %exit, label %loop
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           361: for.end: ; preds = %vec.epilog.middle.block, %middle.block, %latch 
# |           362:  ret void 
# |           363: } 
# |           364:  
# |           365: define void @test_store_of_final_reduction_value(i64 %x, ptr %dst) #0 { 
# |           366: entry: 
# | next:402'0           X error: no match found
# |           367:  br label %vector.ph 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~
# |           368:  
# | next:402'0     ~
# |           369: vector.ph: ; preds = %entry 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           370:  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %x, i64 0 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           371:  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
...

@fhahn
Copy link
Contributor

fhahn commented Sep 24, 2025

Looks like this needed a rebase before merging. Woul be good to update to latest main before merging and see if everything still passes

@artagnon
Copy link
Contributor Author

Looks like this needed a rebase before merging. Woul be good to update to latest main before merging and see if everything still passes

Sorry, my bad! Currently building opt to fixup test.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 24, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/25930

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/LoopVectorize/X86/invariant-store-vectorization.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/b/ml-opt-rel-x86-64-b1/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll | /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /b/ml-opt-rel-x86-64-b1/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# .---command stderr------------
# | /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll:402:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
# |               ^
# | <stdin>:366:7: note: scanning from here
# | entry:
# |       ^
# | <stdin>:394:2: note: possible intended match here
# |  br i1 %ec, label %exit, label %loop
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           361: for.end: ; preds = %vec.epilog.middle.block, %middle.block, %latch 
# |           362:  ret void 
# |           363: } 
# |           364:  
# |           365: define void @test_store_of_final_reduction_value(i64 %x, ptr %dst) #0 { 
# |           366: entry: 
# | next:402'0           X error: no match found
# |           367:  br label %vector.ph 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~
# |           368:  
# | next:402'0     ~
# |           369: vector.ph: ; preds = %entry 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           370:  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %x, i64 0 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           371:  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 24, 2025

LLVM Buildbot has detected a new failure on builder lld-x86_64-ubuntu-fast running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/23614

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/LoopVectorize/X86/invariant-store-vectorization.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/opt -passes=loop-vectorize -mattr=avx512f -S /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# executed command: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# .---command stderr------------
# | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll:402:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
# |               ^
# | <stdin>:366:7: note: scanning from here
# | entry:
# |       ^
# | <stdin>:394:2: note: possible intended match here
# |  br i1 %ec, label %exit, label %loop
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           361: for.end: ; preds = %vec.epilog.middle.block, %middle.block, %latch 
# |           362:  ret void 
# |           363: } 
# |           364:  
# |           365: define void @test_store_of_final_reduction_value(i64 %x, ptr %dst) #0 { 
# |           366: entry: 
# | next:402'0           X error: no match found
# |           367:  br label %vector.ph 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~
# |           368:  
# | next:402'0     ~
# |           369: vector.ph: ; preds = %entry 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           370:  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %x, i64 0 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           371:  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer 
# | next:402'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants