[all-commits] [llvm/llvm-project] 9ee4fe: [ARM] Fix Crashes in fp16/bf16 Inline Asm

Sam Elliott via All-commits all-commits at lists.llvm.org
Thu Apr 13 07:34:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ee4fe63bc0ad4c685760272e464c1591bfc16ea
      https://github.com/llvm/llvm-project/commit/9ee4fe63bc0ad4c685760272e464c1591bfc16ea
  Author: Archibald Elliott <archibald.elliott at arm.com>
  Date:   2023-04-13 (Thu, 13 Apr 2023)

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

  Log Message:
  -----------
  [ARM] Fix Crashes in fp16/bf16 Inline Asm

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 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.

This patch also adds support for passing fp16/bf16 values using the 'x'
constraint that is LLVM-specific. This should broadly match how we pass
with 't' and 'w', but with a different set of valid S registers.

Differential Revision: https://reviews.llvm.org/D147715




More information about the All-commits mailing list