[llvm] c132bd6 - [RISCV] Add test for vmv.s.x of an immediate into a zeroinitializer vector. NFC

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 08:49:04 PDT 2025


Author: Luke Lau
Date: 2025-04-02T16:48:57+01:00
New Revision: c132bd6885a67c7684c8847244a41f4038154c6c

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

LOG: [RISCV] Add test for vmv.s.x of an immediate into a zeroinitializer vector. NFC

The immediate version of ffaaaceaa1cfaa7103196cc7f307ffcb61d73558

Added: 
    

Modified: 
    llvm/test/CodeGen/RISCV/rvv/insertelt-int-rv64.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/RISCV/rvv/insertelt-int-rv64.ll b/llvm/test/CodeGen/RISCV/rvv/insertelt-int-rv64.ll
index 6636789ce7812..0e43cbf0f4518 100644
--- a/llvm/test/CodeGen/RISCV/rvv/insertelt-int-rv64.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/insertelt-int-rv64.ll
@@ -772,3 +772,19 @@ define <vscale x 4 x i32> @insertelt_nxv4i32_zeroinitializer_0(i32 %x) {
   %v = insertelement <vscale x 4 x i32> zeroinitializer, i32 %x, i64 0
   ret <vscale x 4 x i32> %v
 }
+
+define <vscale x 4 x i32> @insertelt_imm_nxv4i32_zeroinitializer_0(i32 %x) {
+; CHECK-LABEL: insertelt_imm_nxv4i32_zeroinitializer_0:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    vsetvli a0, zero, e32, m1, ta, ma
+; CHECK-NEXT:    vmv.v.i v10, 0
+; CHECK-NEXT:    li a0, 42
+; CHECK-NEXT:    vsetvli zero, zero, e32, m1, tu, ma
+; CHECK-NEXT:    vmv.s.x v10, a0
+; CHECK-NEXT:    vsetvli a0, zero, e32, m2, ta, ma
+; CHECK-NEXT:    vmv.v.i v8, 0
+; CHECK-NEXT:    vmv1r.v v8, v10
+; CHECK-NEXT:    ret
+  %v = insertelement <vscale x 4 x i32> zeroinitializer, i32 42, i64 0
+  ret <vscale x 4 x i32> %v
+}


        


More information about the llvm-commits mailing list