[llvm] [SDISel][Builder] Fix the instantiation of <1 x bfloat|half> (PR #94591)

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 07:50:02 PDT 2024


================
@@ -0,0 +1,110 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -global-isel=0 -mcpu=generic -mtriple=x86_64-apple-darwin %s -o - | FileCheck %s
+
+; For all these tests we disable optimizations through function attributes
+; because the code we are exercising here needs phis and we want to keep the
+; IR small.
+
+; This code used to crash in SDISel because f16 was promoted to f32 through
+; a `f32 = vector_extract_elt <1 x f16>, i32 0`, which is illegal.
+; The invalid SDNode and thus, the crash was only exposed by the constant
+; folding.
+define void @phi_vec1half_to_f32_with_const_folding(ptr %dst) #0 {
----------------
qcolombet wrote:

@phoebewang you're right, it doesn't crash. I could have sworn it was.
Anyhow, I'll update the comments.

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


More information about the llvm-commits mailing list