From 14215d715c33f52f86f19f6f6b12b89e6465d4db Mon Sep 17 00:00:00 2001 From: Tex Riddell Date: Mon, 23 Jun 2025 12:13:46 -0700 Subject: [PATCH 1/2] Fix min_vec_size.ll test for changes in vector-combine 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. --- llvm/test/CodeGen/DirectX/min_vec_size.ll | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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> -; 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 From 12687404b7b76cbd79aeade5c3327b9cc41c3361 Mon Sep 17 00:00:00 2001 From: Tex Riddell Date: Mon, 23 Jun 2025 12:36:03 -0700 Subject: [PATCH 2/2] fix value reference in replacement shuffle --- llvm/test/CodeGen/DirectX/min_vec_size.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/test/CodeGen/DirectX/min_vec_size.ll b/llvm/test/CodeGen/DirectX/min_vec_size.ll index a2883a4945774..a8f063cd64a6c 100644 --- a/llvm/test/CodeGen/DirectX/min_vec_size.ll +++ b/llvm/test/CodeGen/DirectX/min_vec_size.ll @@ -6,7 +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:%shuffle = shufflevector <1 x float> %1, <1 x float> poison, <2 x i32> zeroinitializer +; CHECK-NEXT:%shuffle = shufflevector <1 x float> %[[LD]], <1 x float> poison, <2 x i32> zeroinitializer ; CHECK-NEXT:ret <2 x float> %shuffle @a = external local_unnamed_addr constant float