[llvm] X86: Fix asserting on bfloat argument/return without sse2 (PR #93146)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 06:46:34 PDT 2024


================
@@ -0,0 +1,1441 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=i386-linux-gnu < %s | FileCheck -check-prefixes=CHECK,NOSSE %s
+; RUN: llc -mtriple=i386-linux-gnu -mattr=+sse < %s | FileCheck -check-prefixes=CHECK,SSE %s
+
+; Make sure no assert without SSE2 and bfloat. Issue 92899
+
+define bfloat @return_arg_bf16(bfloat %x) {
+; CHECK-LABEL: return_arg_bf16:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
----------------
phoebewang wrote:

I mean you need to add back splitValueIntoRegisterParts/joinRegisterPartsIntoValue, otherwise you just load/store in 32-bits width.

The assertions is not the key. The key is LLVM17 contains https://github.com/llvm/llvm-project/pull/76901 (removed since 18) which equals the patch is this case. What I want to show is even with this, we have another bar there.

Think again, I think this can be taken as a precedent how we handle ABI unsuppoted cases: https://godbolt.org/z/z5YdGdaWs
Maybe we just need to emit an error like that for BF16 without SSE2.

https://github.com/llvm/llvm-project/pull/93146


More information about the llvm-commits mailing list