[llvm] [ValueTracking] Fix poison propagation in `matchFastFloatClamp` (PR #144215)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 00:45:01 PDT 2025


nikic wrote:

> BTW, I think it is effectively dead as it is unlikely to set FMF on the second fcmp+select pair, while the first one is guaranteed not to generate poison. In addition, `*FC1 < *FC2` never holds on real-world code: https://dtcxzyw.github.io/llvm-opt-benchmark/coverage/data/zyw/opt-ci/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-project/llvm/lib/Analysis/ValueTracking.cpp.html#L8187

I think I'd favor completely removing the fold in that case -- or moving it to InstCombine so we can drop flags as needed. Keeping the code to handle an unlikely mixed FMF case doesn't seem worthwhile...

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


More information about the llvm-commits mailing list