[llvm] [InstSimplify] Fold poison/nnan/ninf on @llvm.sqrt (PR #141821)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed May 28 11:54:10 PDT 2025
https://github.com/nikic commented:
I think the correct starting point here would be to support poison propagation in ConstantFolding rather than InstSimplify. I think https://github.com/llvm/llvm-project/blob/b03558080eda9ebe3955afdd52aed902c5087310/llvm/lib/Analysis/ConstantFolding.cpp#L2209 is the relevant code for this case.
To generalize things, something to consider would be to handle this centrally based on the propagatesPoison() VT query. Which, incidentally, does not list the FP intrinsics.
https://github.com/llvm/llvm-project/pull/141821
More information about the llvm-commits
mailing list