[PATCH] D151534: [RISCV] Add more tests in zdinx-boundary-check.ll

Shao-Ce SUN via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 21:57:38 PDT 2023


sunshaoce created this revision.
sunshaoce added reviewers: craig.topper, jrtc27, asb, StephenFan, liaolucy.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, arichardson.
Herald added a project: All.
sunshaoce requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151534

Files:
  llvm/test/CodeGen/RISCV/zdinx-boundary-check.ll


Index: llvm/test/CodeGen/RISCV/zdinx-boundary-check.ll
===================================================================
--- llvm/test/CodeGen/RISCV/zdinx-boundary-check.ll
+++ llvm/test/CodeGen/RISCV/zdinx-boundary-check.ll
@@ -143,3 +143,41 @@
   store double %d, ptr %add.ptr, align 8
   ret void
 }
+
+ at Constants = constant [5 x double] [double 3.140000e+00, double 2.710000e+00, double 1.410000e+00, double 6.200000e-01, double 1.620000e+00], align 16
+
+define void @foo6(ptr %p) #0 {
+; RV32ZDINX-LABEL: foo6:
+; RV32ZDINX:       # %bb.0: # %entry
+; RV32ZDINX-NEXT:    addi sp, sp, -16
+; RV32ZDINX-NEXT:    .cfi_def_cfa_offset 16
+; RV32ZDINX-NEXT:    lui a1, %hi(Constants)
+; RV32ZDINX-NEXT:    addi a1, a1, %lo(Constants)
+; RV32ZDINX-NEXT:    lw a2, 16(a1)
+; RV32ZDINX-NEXT:    lw a3, 20(a1)
+; RV32ZDINX-NEXT:    sw a0, 8(sp)
+; RV32ZDINX-NEXT:    addi a0, a0, 2047
+; RV32ZDINX-NEXT:    sw a2, -3(a0)
+; RV32ZDINX-NEXT:    sw a3, 1(a0)
+; RV32ZDINX-NEXT:    addi sp, sp, 16
+; RV32ZDINX-NEXT:    ret
+;
+; RV64ZDINX-LABEL: foo6:
+; RV64ZDINX:       # %bb.0: # %entry
+; RV64ZDINX-NEXT:    addi sp, sp, -16
+; RV64ZDINX-NEXT:    .cfi_def_cfa_offset 16
+; RV64ZDINX-NEXT:    lui a1, %hi(Constants+16)
+; RV64ZDINX-NEXT:    ld a1, %lo(Constants+16)(a1)
+; RV64ZDINX-NEXT:    sd a0, 8(sp)
+; RV64ZDINX-NEXT:    sd a1, 2044(a0)
+; RV64ZDINX-NEXT:    addi sp, sp, 16
+; RV64ZDINX-NEXT:    ret
+entry:
+  %p.addr = alloca ptr, align 8
+  store ptr %p, ptr %p.addr, align 8
+  %0 = load double, ptr getelementptr inbounds ([5 x double], ptr @Constants, i64 0, i64 2), align 16
+  %1 = load ptr, ptr %p.addr, align 8
+  %add.ptr = getelementptr inbounds i8, ptr %1, i64 2044
+  store double %0, ptr %add.ptr, align 8
+  ret void
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151534.525941.patch
Type: text/x-patch
Size: 1741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230526/f2ad5bf6/attachment.bin>


More information about the llvm-commits mailing list