[llvm-branch-commits] [llvm] ValueTracking: Improve handling for fma/fmuladd (PR #175614)

Yingwei Zheng via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 13 08:50:46 PST 2026


================
@@ -84,11 +84,11 @@ define float @ret_fmuladd_different_same_arg_positive_addend(float noundef %arg0
 
 ; 1. operand0=positive, operand1=negative, operand2=positive
 define half @ret_fma__pos0__neg1__pos2() {
-; CHECK-LABEL: define half @ret_fma__pos0__neg1__pos2() {
+; CHECK-LABEL: define nofpclass(nzero) half @ret_fma__pos0__neg1__pos2() {
----------------
dtcxzyw wrote:

dtcxzyw at zyq004:/data/zyw/dev/alive2/build$ ./alive-tv test.ll --disable-undef-input --disable-poison-input --smt-to=1000000

---

define half @src(half nofpclass(60) %pos0, half nofpclass(960) %neg1, half nofpclass(60) %pos2) {
#0:
%result = fma half nofpclass(60) %pos0, half nofpclass(960) %neg1, half nofpclass(60) %pos2
ret half %result
}
=>
define half @tgt(half nofpclass(60) %pos0, half nofpclass(960) %neg1, half nofpclass(60) %pos2) nofpclass(32) {
#0:
%result = fma half nofpclass(60) %pos0, half nofpclass(960) %neg1, half nofpclass(60) %pos2
ret half %result
}
Transformation doesn't verify!

ERROR: Target is more poisonous than source

Example:
half nofpclass(60) %pos0 = #x0001 (0.000000059604?)
half nofpclass(960) %neg1 = #xa621 (-0.023941040039?)
half nofpclass(60) %pos2 = #x0000 (+0.0)

Source:
half %result = #x8000 (-0.0)

Target:
half %result = #x8000 (-0.0)
Source value: #x8000 (-0.0)
Target value: poison



alive2: https://alive2.llvm.org/ce/z/N53FjR

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


More information about the llvm-branch-commits mailing list