[llvm] [AMDGPU] Do not propagate ninf/nsz from sqrt when forming rsq (PR #217599)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 20 11:16:09 PDT 2026
================
@@ -742,9 +742,13 @@ Value *AMDGPUCodeGenPrepareImpl::optimizeWithRsq(
// TODO: Handle other numerator values with arcp.
if (CLHS->isOne() || (IsNegative = CLHS->isMinusOne())) {
- // Add in the sqrt flags.
+ // Add sqrt flags, but keep ninf/nsz from the div: they don't say
+ // anything about the quotient.
IRBuilder<>::FastMathFlagGuard Guard(Builder);
- Builder.setFastMathFlags(DivFMF | SqrtFMF);
+ FastMathFlags NewFMF = DivFMF | SqrtFMF;
----------------
aobolensk wrote:
Shall we introduce one more? That will do all `&` there? unionValue and intersectRewrite are not suitable here
https://github.com/llvm/llvm-project/pull/217599
More information about the llvm-commits
mailing list