[llvm] b8e3d80 - [InstCombine] Add test for incorrect shuffle of unop transform (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 06:44:28 PDT 2024


Author: Nikita Popov
Date: 2024-05-21T15:42:26+02:00
New Revision: b8e3d8021648478229697edeeb8539c99dbe5503

URL: https://github.com/llvm/llvm-project/commit/b8e3d8021648478229697edeeb8539c99dbe5503
DIFF: https://github.com/llvm/llvm-project/commit/b8e3d8021648478229697edeeb8539c99dbe5503.diff

LOG: [InstCombine] Add test for incorrect shuffle of unop transform (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/vec_shuffle.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/vec_shuffle.ll b/llvm/test/Transforms/InstCombine/vec_shuffle.ll
index 7217e1ac4aa92..00c7a4ca32a02 100644
--- a/llvm/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/llvm/test/Transforms/InstCombine/vec_shuffle.ll
@@ -1280,6 +1280,18 @@ define <2 x float> @fneg(<2 x float> %x) {
   ret <2 x float> %r
 }
 
+; FIXME: This is a miscompile.
+define <2 x float> @fneg_not_single_source(<2 x float> %x) {
+; CHECK-LABEL: @fneg_not_single_source(
+; CHECK-NEXT:    [[TMP1:%.*]] = shufflevector <2 x float> [[X:%.*]], <2 x float> poison, <2 x i32> <i32 0, i32 poison>
+; CHECK-NEXT:    [[SPLAT:%.*]] = fneg <2 x float> [[TMP1]]
+; CHECK-NEXT:    ret <2 x float> [[SPLAT]]
+;
+  %neg = fneg <2 x float> %x
+  %splat = shufflevector <2 x float> %neg, <2 x float> undef, <2 x i32> <i32 0, i32 2>
+  ret <2 x float> %splat
+}
+
 define <2 x float> @fmul_splat_constant(<2 x float> %x) {
 ; CHECK-LABEL: @fmul_splat_constant(
 ; CHECK-NEXT:    [[TMP1:%.*]] = fmul <2 x float> [[X:%.*]], <float 4.200000e+01, float poison>


        


More information about the llvm-commits mailing list