[llvm] X86: Fix asserting on bfloat argument/return without sse2 (PR #93146)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 01:06:28 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)
+; CHECK-NEXT: retl
+ ret bfloat %x
+}
+
+define <2 x bfloat> @return_arg_v2bf16(<2 x bfloat> %x) {
+; CHECK-LABEL: return_arg_v2bf16:
+; CHECK: # %bb.0:
+; CHECK-NEXT: flds {{[0-9]+}}(%esp)
+; CHECK-NEXT: flds {{[0-9]+}}(%esp)
+; CHECK-NEXT: retl
+ ret <2 x bfloat> %x
+}
+
+define <3 x bfloat> @return_arg_v3bf16(<3 x bfloat> %x) {
+; NOSSE-LABEL: return_arg_v3bf16:
+; NOSSE: # %bb.0:
+; NOSSE-NEXT: pushl %edi
+; NOSSE-NEXT: .cfi_def_cfa_offset 8
----------------
phoebewang wrote:
Add nounwind to eliminate this.
https://github.com/llvm/llvm-project/pull/93146
More information about the llvm-commits
mailing list