[llvm] [DAG] canCreateUndefOrPoison – mark fneg/fadd/fsub/fmul/fdiv/frem as not poison generating (PR #142345)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 02:22:05 PDT 2025


================
@@ -0,0 +1,211 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 < %s | FileCheck %s
+
+define float @freeze_fneg(float %input) nounwind {
+; CHECK-LABEL: freeze_fneg:
+; CHECK:       ; %bb.0:
+; CHECK-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; CHECK-NEXT:    s_setpc_b64 s[30:31]
+  %x = fneg reassoc nsz arcp contract afn float %input
+  %y = freeze float %x
+  %z = fneg reassoc nsz arcp contract afn float %y
+  ret float %z
+}
+
+define <8 x float> @freeze_fneg_vec(<8 x float> %input) nounwind {
+; CHECK-LABEL: freeze_fneg_vec:
+; CHECK:       ; %bb.0:
+; CHECK-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; CHECK-NEXT:    s_setpc_b64 s[30:31]
+  %x = fneg <8 x float> %input
+  %y = freeze <8 x float> %x
+  %z = fneg <8 x float> %y
+  ret <8 x float> %z
+}
----------------
arsenm wrote:

In this case the different vector type tests aren't that useful 

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


More information about the llvm-commits mailing list