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

Yueh-Ting (eop) Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 25 07:40:22 PDT 2023


eopXD created this revision.
eopXD added reviewers: craig.topper, efriedma, sdesmalen, rogfer01, frasercrmck, lebedev.ri, david-arm, jdoerfert, reames, kito-cheng.
Herald added subscribers: luke, kosarev, mattd, gchakrabarti, asavonic, foad, StephenFan, kerbowa, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, jvesely, arsenm.
Herald added a project: All.
eopXD requested review of this revision.
Herald added subscribers: llvm-commits, alextsao1999, pcwang-thead, MaskRay, jholewinski.
Herald added a project: LLVM.

This patch is originates from D98169 <https://reviews.llvm.org/D98169>.

This patch allows aggregate type (StructType) that contains homogeneous
scalable vector types to be a target of load/store/alloca.

The main changes in this patch are:

- Extend `StructLayout::StructSize` from `uint64_t` to `TypeSize` to

accomodate an expression of scalable size.

- Allow checking conditions of `StructType::isSized` to also allow a

structure of homogeneous scalable vector type to pass. The rationale
behind this is that preserving the current semantic of `isSized` lets us
find places elsewhere that needs to be changed for this special case
faster.

Authored-by: Hsiangkai Wang <kai.wang at sifive.com>
Co-Authored-by: eop Chen <eop.chen at sifive.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146872

Files:
  llvm/include/llvm/CodeGen/Analysis.h
  llvm/include/llvm/IR/DataLayout.h
  llvm/include/llvm/IR/DerivedTypes.h
  llvm/include/llvm/IR/Instructions.h
  llvm/lib/Analysis/Loads.cpp
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/CodeGen/Analysis.cpp
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
  llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/IR/DataLayout.cpp
  llvm/lib/IR/Type.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/lib/Transforms/Scalar/SROA.cpp
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
  llvm/test/CodeGen/RISCV/rvv/alloca-load-store-scalable-struct.ll
  llvm/test/Other/load-scalable-vector-struct.ll
  llvm/test/Other/store-scalable-vector-struct.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146872.508307.patch
Type: text/x-patch
Size: 40389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230325/c0446573/attachment-0001.bin>


More information about the llvm-commits mailing list