[llvm] ab1d988 - [InstCombine] Add test for incorrect fshr transform (#89338)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 22:02:34 PDT 2024


Author: Nikita Popov
Date: 2024-04-19T14:02:22+09:00
New Revision: ab1d988e1483895a71dcd257bdcaf6fdb0a83d62

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

LOG: [InstCombine] Add test for incorrect fshr transform (#89338)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/fsh.ll b/llvm/test/Transforms/InstCombine/fsh.ll
index 6c85169453d15a..3bd44ece306b9a 100644
--- a/llvm/test/Transforms/InstCombine/fsh.ll
+++ b/llvm/test/Transforms/InstCombine/fsh.ll
@@ -1001,3 +1001,13 @@ define <2 x i32> @fsh_unary_shuffle_ops_partial_widening(<3 x i32> %x, <2 x i32>
   %r = call <2 x i32> @llvm.fshr.v2i32(<2 x i32> %a, <2 x i32> %b, <2 x i32> %c)
   ret <2 x i32> %r
 }
+
+; FIXME: This is a miscompile.
+define <2 x i32> @fshr_vec_zero_elem(<2 x i32> %x, <2 x i32> %y) {
+; CHECK-LABEL: @fshr_vec_zero_elem(
+; CHECK-NEXT:    [[FSH:%.*]] = call <2 x i32> @llvm.fshl.v2i32(<2 x i32> [[X:%.*]], <2 x i32> [[Y:%.*]], <2 x i32> <i32 30, i32 0>)
+; CHECK-NEXT:    ret <2 x i32> [[FSH]]
+;
+  %fsh = call <2 x i32> @llvm.fshr.v2i32(<2 x i32> %x, <2 x i32> %y, <2 x i32> <i32 2, i32 0>)
+  ret <2 x i32> %fsh
+}


        


More information about the llvm-commits mailing list