Skip to content

Conversation

@tex3d
Copy link
Contributor

@tex3d tex3d commented Jun 23, 2025

Running the vector-combine pass on this test now produces a single shuffle on a loaded <1 x float> instead of an insert into a <2 x float> followed by a shuffle.

This test change matches changes in other tests in PR #144690, which introduced the optimization.

Running the `vector-combine` pass on this test now produces a single shuffle on a loaded `<1 x float>` instead of an insert into a `<2 x float>` followed by a shuffle. This looks like a valid optimization.
@llvmbot
Copy link
Member

llvmbot commented Jun 23, 2025

@llvm/pr-subscribers-backend-directx

Author: Tex Riddell (tex3d)

Changes

Running the vector-combine pass on this test now produces a single shuffle on a loaded &lt;1 x float&gt; instead of an insert into a &lt;2 x float&gt; followed by a shuffle. This looks like a valid optimization.


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

1 Files Affected:

  • (modified) llvm/test/CodeGen/DirectX/min_vec_size.ll (+1-2)
diff --git a/llvm/test/CodeGen/DirectX/min_vec_size.ll b/llvm/test/CodeGen/DirectX/min_vec_size.ll
index ba6e83ea83733..a2883a4945774 100644
--- a/llvm/test/CodeGen/DirectX/min_vec_size.ll
+++ b/llvm/test/CodeGen/DirectX/min_vec_size.ll
@@ -6,8 +6,7 @@ target triple = "dxil-unknown-shadermodel6.7-library"
 ; Make sure vec combine min vec size is 1 instead of 4 for float.
 ; CHECK:@foo()
 ; CHECK-NEXT:%[[LD:[0-9]+]] = load <1 x float>, ptr @a, align 8
-; CHECK-NEXT:%insert = shufflevector <1 x float> %[[LD]], <1 x float> poison, <2 x i32> <i32 0, i32 poison>
-; CHECK-NEXT:%shuffle = shufflevector <2 x float> %insert, <2 x float> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT:%shuffle = shufflevector <1 x float> %1, <1 x float> poison, <2 x i32> zeroinitializer
 ; CHECK-NEXT:ret <2 x float> %shuffle
 
 @a = external local_unnamed_addr constant float

@bogner
Copy link
Contributor

bogner commented Jun 23, 2025

Might be worth mentioning #144690 in the commit message as the reason this changed. Note that the test change here does match the test changes that were introduced in that PR.

@tex3d
Copy link
Contributor Author

tex3d commented Jun 23, 2025

The failures from the Build and Test Linux check must be unrelated:

Unresolved Tests (3):
  lldb-api :: commands/expression/import-std-module/basic/TestImportStdModule.py
  lldb-api :: commands/expression/import-std-module/conflicts/TestStdModuleWithConflicts.py
  lldb-api :: commands/expression/import-std-module/retry-with-std-module/TestRetryWithStdModule.py

@tex3d tex3d merged commit 509fb93 into llvm:main Jun 23, 2025
7 of 8 checks passed
@tex3d tex3d deleted the fix-min_vec_size branch June 23, 2025 21:54
DrSergei pushed a commit to DrSergei/llvm-project that referenced this pull request Jun 24, 2025
Running the `vector-combine` pass on this test now produces a single
shuffle on a loaded `<1 x float>` instead of an insert into a `<2 x
float>` followed by a shuffle.

This test change matches changes in other tests in PR llvm#144690, which
introduced the optimization.
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
Running the `vector-combine` pass on this test now produces a single
shuffle on a loaded `<1 x float>` instead of an insert into a `<2 x
float>` followed by a shuffle.

This test change matches changes in other tests in PR llvm#144690, which
introduced the optimization.
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.

5 participants