[llvm] [loongarch][DAG][FREEZE] Fix crash when FREEZE a half(f16) type on loongarch (PR #107791)

YANG Xudong via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 00:14:57 PDT 2024


================
@@ -324,3 +324,18 @@ define void @test_fmul_mem(ptr %p, ptr %q) nounwind {
   store half %r, ptr %p
   ret void
 }
+
+define half @freeze_half() nounwind {
+; LA32-LABEL: freeze_half:
+; LA32:       # %bb.0:
+; LA32-NEXT:    fadd.s	$fa0, $fa0, $fa0
+; LA32-NEXT:    ret
+;
+; LA64-LABEL: freeze_half:
+; LA64:       # %bb.0:
+; LA64-NEXT:    fadd.s	$fa0, $fa0, $fa0
+; LA64-NEXT:    ret
+  %y1 = freeze half undef
----------------
yxd-ym wrote:

added a test of freeze a poison

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


More information about the llvm-commits mailing list