[llvm] 34a785f - [InstSimplify] add test for over-shift of scalable vector; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 7 13:30:14 PDT 2022


Author: Sanjay Patel
Date: 2022-08-07T16:26:05-04:00
New Revision: 34a785fee747f45607ec2882f1accebf2cff9006

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

LOG: [InstSimplify] add test for over-shift of scalable vector; NFC

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/shift.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/shift.ll b/llvm/test/Transforms/InstSimplify/shift.ll
index 98a5a526ea83..8f2f02600ded 100644
--- a/llvm/test/Transforms/InstSimplify/shift.ll
+++ b/llvm/test/Transforms/InstSimplify/shift.ll
@@ -340,3 +340,14 @@ define i32 @all_ones_left_right_not_same_shift(i32 %x, i32 %y) {
   %right = ashr i32 %left, %y
   ret i32 %right
 }
+
+; shift by splat of bitwidth or more is poison
+
+define <vscale x 4 x i16> @lshr_scalable_overshift(<vscale x 4 x i16> %va) {
+; CHECK-LABEL: @lshr_scalable_overshift(
+; CHECK-NEXT:    [[VC:%.*]] = lshr <vscale x 4 x i16> [[VA:%.*]], shufflevector (<vscale x 4 x i16> insertelement (<vscale x 4 x i16> poison, i16 16, i32 0), <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer)
+; CHECK-NEXT:    ret <vscale x 4 x i16> [[VC]]
+;
+  %vc = lshr <vscale x 4 x i16> %va, shufflevector (<vscale x 4 x i16> insertelement (<vscale x 4 x i16> poison, i16 16, i32 0), <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer)
+  ret <vscale x 4 x i16> %vc
+}


        


More information about the llvm-commits mailing list