[PATCH] D155040: [LegalizeDAG] Prevent LegalizeLoadOps from creating extloads that mix int and fp types.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 21:59:18 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: arsenm, asb, wangpc.
Herald added subscribers: luke, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: MaskRay, wdng.
Herald added a project: LLVM.

For RISC-V, getRegisterType for fp16 returns i16. i16->fp64 extload
is considered legal because the LoadExtActions defaults to Legal
for all entries. Only fp/fp and int/int entries are changed to
Expand fore RISC-V.

This patch detects the FP-ness has changed and won't try to call
isLoadExtLegal.

Alternatively, we could add Expand for int/fp and fp/int, but that
seemed a little silly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155040

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  llvm/test/CodeGen/RISCV/pr63816.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155040.539374.patch
Type: text/x-patch
Size: 4367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230712/884126b7/attachment.bin>


More information about the llvm-commits mailing list