[PATCH] D146872: [1/11][IR] Permit load/store/alloca for struct of the same scalable vector type

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 04:46:41 PDT 2023


paulwalker-arm added inline comments.
Herald added a subscriber: wangpc.


================
Comment at: llvm/test/CodeGen/RISCV/rvv/alloca-load-store-scalable-struct.ll:18-19
+; CHECK-NEXT:    .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x02, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 2 * vlenb
+; CHECK-NEXT:    addi a2, a0, 8
+; CHECK-NEXT:    vl1re64.v v8, (a2)
+; CHECK-NEXT:    vl1re64.v v9, (a0)
----------------
Apologies for any naivety here but is the code generation here correct?  I'm trying to figure out the patch's objective because it looks like it has enable support within the IR but ignored code generation.  My interpretation of this output is that whilst it correctly allocates the vscale relative stack space:
```
csrrs a2, vlenb, zero
slli a2, a2, 1
sub sp, sp, a2
```
it then simply falls back to fixed length offsets when accessing it:
```
addi a2, a0, 8
vl1re64.v v8, (a2)
```
Is my interpretation here correct? or have I misunderstood something?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146872/new/

https://reviews.llvm.org/D146872



More information about the llvm-commits mailing list