[PATCH] D147715: [ARM] Fix Crashes in fp16/bf16 Inlne Asm

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 08:31:11 PDT 2023


lenary created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
lenary requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We were still seeing occasional crashes with inline assembly blocks
using fp16/bf16 after my previous patches:

- https://reviews.llvm.org/rGff4027d152d0
- https://reviews.llvm.org/rG7d15212b8c0c
- https://reviews.llvm.org/rG20b2d11896d9

It turns out:

- The original two commits were wrong, and we should have always been choosing the SPR register class, not the HPR register class, so that LLVM's SelectionDAGBuilder correctly did the right splits/joins.
- The `splitValueIntoRegisterParts`/`joinRegisterPartsIntoValue` changes from rG20b2d11896d9 <https://reviews.llvm.org/rG20b2d11896d9351ea8347e1342eb0487ecadc70f> are still correct, even though they sometimes result in inefficient codegen of casts between fp16/bf16 and i32/f32 (which is visible in these tests).

This patch fixes crashes in `getCopyToParts` and when trying to select
`(bf16 (bitconvert (fp16 ...)))` dags when Neon is enabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147715

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/test/CodeGen/ARM/inlineasm-fp-half.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147715.511426.patch
Type: text/x-patch
Size: 14003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230406/8d5989d9/attachment.bin>


More information about the llvm-commits mailing list