Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Dec 11, 2025

We have other target intrinsics already in ValueTracking functions,
and no access to TTI.

Copy link
Contributor Author

arsenm commented Dec 11, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm arsenm added backend:AMDGPU floating-point Floating-point math labels Dec 11, 2025 — with Graphite App
@arsenm arsenm marked this pull request as ready for review December 11, 2025 14:29
@arsenm arsenm requested a review from nikic as a code owner December 11, 2025 14:29
@llvmbot llvmbot added llvm:analysis Includes value tracking, cost tables and constant folding llvm:transforms labels Dec 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 11, 2025

@llvm/pr-subscribers-llvm-transforms
@llvm/pr-subscribers-llvm-analysis

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

Changes

We have other target intrinsics already in ValueTracking functions,
and no access to TTI.


Full diff: https://github.com/llvm/llvm-project/pull/171837.diff

2 Files Affected:

  • (modified) llvm/lib/Analysis/ValueTracking.cpp (+31)
  • (modified) llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-rsq.ll (+42-42)
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index e98d13486d023..c856f60270d9b 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -5553,6 +5553,37 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
 
       // TODO: Copy inf handling from instructions
       break;
+    case Intrinsic::amdgcn_rsq: {
+      KnownFPClass KnownSrc;
+      // The only negative value that can be returned is -0 for -0 inputs.
+      Known.knownNot(fcNegInf | fcNegSubnormal | fcNegNormal);
+
+      computeKnownFPClass(II->getArgOperand(0), DemandedElts, InterestedClasses,
+                          KnownSrc, Q, Depth + 1);
+
+      if (KnownSrc.isKnownNever(fcSNan))
+        Known.knownNot(fcSNan);
+
+      // Negative -> nan
+      if (KnownSrc.isKnownNeverNaN() && KnownSrc.cannotBeOrderedLessThanZero())
+        Known.knownNot(fcNan);
+
+      Type *EltTy = II->getType()->getScalarType();
+
+      // f32 denormal always flushed.
+      if (EltTy->isFloatTy())
+        Known.knownNot(fcPosSubnormal);
+      else {
+        const Function *F = II->getFunction();
+        if (Q.IIQ.hasNoSignedZeros(II) ||
+            (F && KnownSrc.isKnownNeverLogicalNegZero(
+                      F->getDenormalMode(EltTy->getFltSemantics()))))
+          Known.knownNot(fcNegZero);
+      }
+
+      // TODO: Infer if this can be +inf
+      break;
+    }
     default:
       break;
     }
diff --git a/llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-rsq.ll b/llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-rsq.ll
index bbff327cf403b..17f176d041595 100644
--- a/llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-rsq.ll
+++ b/llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-rsq.ll
@@ -6,9 +6,9 @@ declare float @llvm.amdgcn.rsq.f32(float)
 declare double @llvm.amdgcn.rsq.f64(double)
 
 define half @ret_rsq_f16(half %arg) {
-; CHECK-LABEL: define half @ret_rsq_f16(
+; CHECK-LABEL: define nofpclass(ninf nsub nnorm) half @ret_rsq_f16(
 ; CHECK-SAME: half [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call half @llvm.amdgcn.rsq.f16(half [[ARG]]) #[[ATTR4:[0-9]+]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf nsub nnorm) half @llvm.amdgcn.rsq.f16(half [[ARG]]) #[[ATTR4:[0-9]+]]
 ; CHECK-NEXT:    ret half [[CALL]]
 ;
   %call = call half @llvm.amdgcn.rsq.f16(half %arg)
@@ -16,9 +16,9 @@ define half @ret_rsq_f16(half %arg) {
 }
 
 define float @ret_rsq_f32(float %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32(
 ; CHECK-SAME: float [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -26,9 +26,9 @@ define float @ret_rsq_f32(float %arg) {
 }
 
 define double @ret_rsq_f64(double %arg) {
-; CHECK-LABEL: define double @ret_rsq_f64(
+; CHECK-LABEL: define nofpclass(ninf nsub nnorm) double @ret_rsq_f64(
 ; CHECK-SAME: double [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call double @llvm.amdgcn.rsq.f64(double [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf nsub nnorm) double @llvm.amdgcn.rsq.f64(double [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret double [[CALL]]
 ;
   %call = call double @llvm.amdgcn.rsq.f64(double %arg)
@@ -37,9 +37,9 @@ define double @ret_rsq_f64(double %arg) {
 
 ; Result could still be -0 if negative argument is flushed.
 define float @ret_rsq_f32_dynamic_denormal_input(float %arg) #0 {
-; CHECK-LABEL: define float @ret_rsq_f32_dynamic_denormal_input(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_dynamic_denormal_input(
 ; CHECK-SAME: float [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -47,9 +47,9 @@ define float @ret_rsq_f32_dynamic_denormal_input(float %arg) #0 {
 }
 
 define float @ret_rsq_f32_dynamic_denormal_input_known_nzero(float nofpclass(nzero) %arg) #0 {
-; CHECK-LABEL: define float @ret_rsq_f32_dynamic_denormal_input_known_nzero(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_dynamic_denormal_input_known_nzero(
 ; CHECK-SAME: float nofpclass(nzero) [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float nofpclass(nzero) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(nzero) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -57,9 +57,9 @@ define float @ret_rsq_f32_dynamic_denormal_input_known_nzero(float nofpclass(nze
 }
 
 define float @ret_rsq_f32_dynamic_denormal_input_known_nzero_nsub(float nofpclass(nzero nsub) %arg) #0 {
-; CHECK-LABEL: define float @ret_rsq_f32_dynamic_denormal_input_known_nzero_nsub(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_dynamic_denormal_input_known_nzero_nsub(
 ; CHECK-SAME: float nofpclass(nzero nsub) [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float nofpclass(nzero nsub) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(nzero nsub) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -67,9 +67,9 @@ define float @ret_rsq_f32_dynamic_denormal_input_known_nzero_nsub(float nofpclas
 }
 
 define double @ret_rsq_f64_dynamic_denormal_input(double %arg) #1 {
-; CHECK-LABEL: define double @ret_rsq_f64_dynamic_denormal_input(
+; CHECK-LABEL: define nofpclass(ninf nsub nnorm) double @ret_rsq_f64_dynamic_denormal_input(
 ; CHECK-SAME: double [[ARG:%.*]]) #[[ATTR3:[0-9]+]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call double @llvm.amdgcn.rsq.f64(double [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf nsub nnorm) double @llvm.amdgcn.rsq.f64(double [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret double [[CALL]]
 ;
   %call = call double @llvm.amdgcn.rsq.f64(double %arg)
@@ -77,9 +77,9 @@ define double @ret_rsq_f64_dynamic_denormal_input(double %arg) #1 {
 }
 
 define double @ret_rsq_f64_dynamic_denormal_input_known_nzero(double nofpclass(nzero) %arg) #0 {
-; CHECK-LABEL: define double @ret_rsq_f64_dynamic_denormal_input_known_nzero(
+; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) double @ret_rsq_f64_dynamic_denormal_input_known_nzero(
 ; CHECK-SAME: double nofpclass(nzero) [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call double @llvm.amdgcn.rsq.f64(double nofpclass(nzero) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) double @llvm.amdgcn.rsq.f64(double nofpclass(nzero) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret double [[CALL]]
 ;
   %call = call double @llvm.amdgcn.rsq.f64(double %arg)
@@ -87,9 +87,9 @@ define double @ret_rsq_f64_dynamic_denormal_input_known_nzero(double nofpclass(n
 }
 
 define double @ret_rsq_f64_dynamic_denormal_input_known_nzero_nsub(double nofpclass(nzero nsub) %arg) #0 {
-; CHECK-LABEL: define double @ret_rsq_f64_dynamic_denormal_input_known_nzero_nsub(
+; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) double @ret_rsq_f64_dynamic_denormal_input_known_nzero_nsub(
 ; CHECK-SAME: double nofpclass(nzero nsub) [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call double @llvm.amdgcn.rsq.f64(double nofpclass(nzero nsub) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) double @llvm.amdgcn.rsq.f64(double nofpclass(nzero nsub) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret double [[CALL]]
 ;
   %call = call double @llvm.amdgcn.rsq.f64(double %arg)
@@ -97,9 +97,9 @@ define double @ret_rsq_f64_dynamic_denormal_input_known_nzero_nsub(double nofpcl
 }
 
 define float @ret_rsq_f32__no_snan_input(float nofpclass(snan) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32__no_snan_input(
+; CHECK-LABEL: define nofpclass(snan ninf sub nnorm) float @ret_rsq_f32__no_snan_input(
 ; CHECK-SAME: float nofpclass(snan) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float nofpclass(snan) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(snan ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(snan) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -107,9 +107,9 @@ define float @ret_rsq_f32__no_snan_input(float nofpclass(snan) %arg) {
 }
 
 define float @ret_rsq_f32_nsz(float %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_nsz(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_nsz(
 ; CHECK-SAME: float [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call nsz float @llvm.amdgcn.rsq.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nsz nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call nsz float @llvm.amdgcn.rsq.f32(float %arg)
@@ -117,9 +117,9 @@ define float @ret_rsq_f32_nsz(float %arg) {
 }
 
 define float @ret_rsq_f32_known_no_neg_zero(float nofpclass(nzero) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_neg_zero(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_known_no_neg_zero(
 ; CHECK-SAME: float nofpclass(nzero) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call nsz float @llvm.amdgcn.rsq.f32(float nofpclass(nzero) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nsz nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(nzero) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call nsz float @llvm.amdgcn.rsq.f32(float %arg)
@@ -127,9 +127,9 @@ define float @ret_rsq_f32_known_no_neg_zero(float nofpclass(nzero) %arg) {
 }
 
 define float @ret_rsq_f32_known_no_nan(float nofpclass(nan) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_nan(
+; CHECK-LABEL: define nofpclass(snan ninf sub nnorm) float @ret_rsq_f32_known_no_nan(
 ; CHECK-SAME: float nofpclass(nan) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call nsz float @llvm.amdgcn.rsq.f32(float nofpclass(nan) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nsz nofpclass(snan ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(nan) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call nsz float @llvm.amdgcn.rsq.f32(float %arg)
@@ -137,9 +137,9 @@ define float @ret_rsq_f32_known_no_nan(float nofpclass(nan) %arg) {
 }
 
 define float @ret_rsq_f32_known_no_inf(float nofpclass(inf) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_inf(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_known_no_inf(
 ; CHECK-SAME: float nofpclass(inf) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call nsz float @llvm.amdgcn.rsq.f32(float nofpclass(inf) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nsz nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(inf) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call nsz float @llvm.amdgcn.rsq.f32(float %arg)
@@ -147,9 +147,9 @@ define float @ret_rsq_f32_known_no_inf(float nofpclass(inf) %arg) {
 }
 
 define float @ret_rsq_f32_known_no_nan_no_inf(float nofpclass(nan inf) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_nan_no_inf(
+; CHECK-LABEL: define nofpclass(snan ninf sub nnorm) float @ret_rsq_f32_known_no_nan_no_inf(
 ; CHECK-SAME: float nofpclass(nan inf) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call nsz float @llvm.amdgcn.rsq.f32(float nofpclass(nan inf) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nsz nofpclass(snan ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(nan inf) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call nsz float @llvm.amdgcn.rsq.f32(float %arg)
@@ -157,9 +157,9 @@ define float @ret_rsq_f32_known_no_nan_no_inf(float nofpclass(nan inf) %arg) {
 }
 
 define float @ret_rsq_f32_poison() {
-; CHECK-LABEL: define float @ret_rsq_f32_poison(
+; CHECK-LABEL: define nofpclass(nan ninf sub nnorm) float @ret_rsq_f32_poison(
 ; CHECK-SAME: ) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float poison) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(nan ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float poison) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float poison)
@@ -167,9 +167,9 @@ define float @ret_rsq_f32_poison() {
 }
 
 define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal(float nofpclass(nsub nnorm) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal(
 ; CHECK-SAME: float nofpclass(nsub nnorm) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float nofpclass(nsub nnorm) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(nsub nnorm) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -177,9 +177,9 @@ define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal(float nofpclass(n
 }
 
 define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf(float nofpclass(ninf nsub nnorm) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf(
 ; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float nofpclass(ninf nsub nnorm) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(ninf nsub nnorm) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -187,9 +187,9 @@ define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf(float
 }
 
 define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_neg_zero(float nofpclass(ninf nzero nsub nnorm) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_neg_zero(
+; CHECK-LABEL: define nofpclass(ninf sub nnorm) float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_neg_zero(
 ; CHECK-SAME: float nofpclass(ninf nzero nsub nnorm) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float nofpclass(ninf nzero nsub nnorm) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(ninf nzero nsub nnorm) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -197,9 +197,9 @@ define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_neg
 }
 
 define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_nan(float nofpclass(nan ninf nsub nnorm) %arg) {
-; CHECK-LABEL: define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_nan(
+; CHECK-LABEL: define nofpclass(nan ninf sub nnorm) float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_nan(
 ; CHECK-SAME: float nofpclass(nan ninf nsub nnorm) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call float @llvm.amdgcn.rsq.f32(float nofpclass(nan ninf nsub nnorm) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nofpclass(nan ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(nan ninf nsub nnorm) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call float @llvm.amdgcn.rsq.f32(float %arg)
@@ -207,9 +207,9 @@ define float @ret_rsq_f32_known_no_neg_normal_no_neg_subnormal_no_neg_inf_no_nan
 }
 
 define float @ret_rsq_f32_nnan_known_no_neg_normal_no_neg_subnormal_no_neg_inf(float nofpclass(ninf nsub nnorm) %arg) {
-; CHECK-LABEL: define nofpclass(nan) float @ret_rsq_f32_nnan_known_no_neg_normal_no_neg_subnormal_no_neg_inf(
+; CHECK-LABEL: define nofpclass(nan ninf sub nnorm) float @ret_rsq_f32_nnan_known_no_neg_normal_no_neg_subnormal_no_neg_inf(
 ; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT:    [[CALL:%.*]] = call nnan nofpclass(nan) float @llvm.amdgcn.rsq.f32(float nofpclass(ninf nsub nnorm) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT:    [[CALL:%.*]] = call nnan nofpclass(nan ninf sub nnorm) float @llvm.amdgcn.rsq.f32(float nofpclass(ninf nsub nnorm) [[ARG]]) #[[ATTR4]]
 ; CHECK-NEXT:    ret float [[CALL]]
 ;
   %call = call nnan float @llvm.amdgcn.rsq.f32(float %arg)

We have other target intrinsics already in ValueTracking functions,
and no access to TTI.
@arsenm arsenm force-pushed the users/arsenm/value-tracking/add-baseline-test-nofpclass-amdgcn-rsq branch from aa828cc to e97e744 Compare December 11, 2025 16:13
@arsenm arsenm force-pushed the users/arsenm/value-tracking/handle-amdgcn-rsq-computeKnownFPClass branch from 496a450 to d269be7 Compare December 11, 2025 16:13
@github-actions
Copy link

🪟 Windows x64 Test Results

  • 125587 tests passed
  • 2775 tests skipped

All executed tests passed, but another part of the build failed. Click on a failure below to see the details.

[code=4294967295] bin/clang-move.exe
FAILED: [code=4294967295] bin/clang-move.exe
cmd.exe /C "cd . && C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E vs_link_exe --intdir=tools\clang\tools\extra\clang-move\tool\CMakeFiles\clang-move.dir --rc="C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe" --mt="C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\mt.exe" --manifests  -- C:\clang\clang-msvc\bin\lld-link.exe /nologo tools\clang\tools\extra\clang-move\tool\CMakeFiles\clang-move.dir\ClangMove.cpp.obj tools\clang\tools\extra\clang-move\tool\CMakeFiles\clang-move.dir\C_\_work\llvm-project\llvm-project\llvm\resources\windows_version_resource.rc.res  /out:bin\clang-move.exe /implib:lib\clang-move.lib /pdb:bin\clang-move.pdb /version:0.0 /MANIFEST:NO /STACK:10000000 /INCREMENTAL:NO /subsystem:console  lib\LLVMSupport.lib  lib\LLVMFrontendOpenMP.lib  lib\clangAST.lib  lib\clangASTMatchers.lib  lib\clangBasic.lib  lib\clangFormat.lib  lib\clangFrontend.lib  lib\clangRewrite.lib  lib\clangSerialization.lib  lib\clangTooling.lib  lib\clangToolingCore.lib  lib\clangMove.lib  lib\clangTooling.lib  lib\clangFormat.lib  lib\clangToolingInclusions.lib  lib\clangDependencyScanning.lib  lib\clangDriver.lib  lib\clangFrontend.lib  lib\clangParse.lib  lib\clangSerialization.lib  lib\clangSema.lib  lib\clangAPINotes.lib  lib\clangEdit.lib  lib\clangAnalysisLifetimeSafety.lib  lib\clangSupport.lib  lib\clangOptions.lib  version.lib  lib\LLVMWindowsDriver.lib  lib\LLVMOption.lib  lib\clangToolingCore.lib  lib\clangRewrite.lib  lib\clangAnalysis.lib  lib\clangASTMatchers.lib  lib\clangAST.lib  lib\clangLex.lib  lib\clangBasic.lib  lib\LLVMFrontendOpenMP.lib  lib\LLVMScalarOpts.lib  lib\LLVMAggressiveInstCombine.lib  lib\LLVMInstCombine.lib  lib\LLVMFrontendOffloading.lib  lib\LLVMTransformUtils.lib  lib\LLVMObjectYAML.lib  lib\LLVMFrontendAtomic.lib  lib\LLVMAnalysis.lib  lib\LLVMFrontendHLSL.lib  lib\LLVMProfileData.lib  lib\LLVMSymbolize.lib  lib\LLVMDebugInfoGSYM.lib  lib\LLVMDebugInfoPDB.lib  lib\LLVMDebugInfoCodeView.lib  "C:\BuildTools\DIA SDK\lib\amd64\diaguids.lib"  lib\LLVMDebugInfoMSF.lib  lib\LLVMDebugInfoBTF.lib  lib\LLVMDebugInfoDWARF.lib  lib\LLVMObject.lib  lib\LLVMMCParser.lib  lib\LLVMMC.lib  lib\LLVMDebugInfoDWARFLowLevel.lib  lib\LLVMIRReader.lib  lib\LLVMBitReader.lib  lib\LLVMAsmParser.lib  lib\LLVMCore.lib  lib\LLVMRemarks.lib  lib\LLVMBitstreamReader.lib  lib\LLVMTextAPI.lib  lib\LLVMBinaryFormat.lib  lib\LLVMFrontendDirective.lib  lib\LLVMTargetParser.lib  lib\LLVMSupport.lib  psapi.lib  shell32.lib  ole32.lib  uuid.lib  advapi32.lib  ws2_32.lib  ntdll.lib  delayimp.lib  -delayload:shell32.dll  -delayload:ole32.dll  lib\LLVMDemangle.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\clang\clang-msvc\bin\lld-link.exe /nologo tools\clang\tools\extra\clang-move\tool\CMakeFiles\clang-move.dir\ClangMove.cpp.obj tools\clang\tools\extra\clang-move\tool\CMakeFiles\clang-move.dir\C_\_work\llvm-project\llvm-project\llvm\resources\windows_version_resource.rc.res /out:bin\clang-move.exe /implib:lib\clang-move.lib /pdb:bin\clang-move.pdb /version:0.0 /MANIFEST:NO /STACK:10000000 /INCREMENTAL:NO /subsystem:console lib\LLVMSupport.lib lib\LLVMFrontendOpenMP.lib lib\clangAST.lib lib\clangASTMatchers.lib lib\clangBasic.lib lib\clangFormat.lib lib\clangFrontend.lib lib\clangRewrite.lib lib\clangSerialization.lib lib\clangTooling.lib lib\clangToolingCore.lib lib\clangMove.lib lib\clangTooling.lib lib\clangFormat.lib lib\clangToolingInclusions.lib lib\clangDependencyScanning.lib lib\clangDriver.lib lib\clangFrontend.lib lib\clangParse.lib lib\clangSerialization.lib lib\clangSema.lib lib\clangAPINotes.lib lib\clangEdit.lib lib\clangAnalysisLifetimeSafety.lib lib\clangSupport.lib lib\clangOptions.lib version.lib lib\LLVMWindowsDriver.lib lib\LLVMOption.lib lib\clangToolingCore.lib lib\clangRewrite.lib lib\clangAnalysis.lib lib\clangASTMatchers.lib lib\clangAST.lib lib\clangLex.lib lib\clangBasic.lib lib\LLVMFrontendOpenMP.lib lib\LLVMScalarOpts.lib lib\LLVMAggressiveInstCombine.lib lib\LLVMInstCombine.lib lib\LLVMFrontendOffloading.lib lib\LLVMTransformUtils.lib lib\LLVMObjectYAML.lib lib\LLVMFrontendAtomic.lib lib\LLVMAnalysis.lib lib\LLVMFrontendHLSL.lib lib\LLVMProfileData.lib lib\LLVMSymbolize.lib lib\LLVMDebugInfoGSYM.lib lib\LLVMDebugInfoPDB.lib lib\LLVMDebugInfoCodeView.lib C:\BuildTools\DIA SDK\lib\amd64\diaguids.lib lib\LLVMDebugInfoMSF.lib lib\LLVMDebugInfoBTF.lib lib\LLVMDebugInfoDWARF.lib lib\LLVMObject.lib lib\LLVMMCParser.lib lib\LLVMMC.lib lib\LLVMDebugInfoDWARFLowLevel.lib lib\LLVMIRReader.lib lib\LLVMBitReader.lib lib\LLVMAsmParser.lib lib\LLVMCore.lib lib\LLVMRemarks.lib lib\LLVMBitstreamReader.lib lib\LLVMTextAPI.lib lib\LLVMBinaryFormat.lib lib\LLVMFrontendDirective.lib lib\LLVMTargetParser.lib lib\LLVMSupport.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib ws2_32.lib ntdll.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll lib\LLVMDemangle.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" failed (exit code 1) with the following output:
lld-link: error: undefined symbol: public: void __cdecl clang::CallGraphNode::print(class llvm::raw_ostream &) const
>>> referenced by clangMove.lib(HelperDeclRefGraph.cpp.obj):(private: void __cdecl clang::move::HelperDeclRefGraph::print(class llvm::raw_ostream &) const)
>>> referenced by clangMove.lib(HelperDeclRefGraph.cpp.obj):(private: void __cdecl clang::move::HelperDeclRefGraph::print(class llvm::raw_ostream &) const)

lld-link: error: undefined symbol: void __cdecl clang::threadSafety::threadSafetyCleanup(class clang::threadSafety::BeforeSet *)
>>> referenced by clangSema.lib(Sema.cpp.obj):(public: __cdecl clang::Sema::~Sema(void))

lld-link: error: undefined symbol: public: __cdecl clang::AnalysisDeclContext::AnalysisDeclContext(class clang::AnalysisDeclContextManager *, class clang::Decl const *)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: void __cdecl clang::AnalysisDeclContext::registerForcedBlockExpression(class clang::Stmt const *)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: class clang::CFG * __cdecl clang::AnalysisDeclContext::getCFG(void)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))
>>> referenced 13 more times

lld-link: error: undefined symbol: public: class clang::CFGReverseBlockReachabilityAnalysis * __cdecl clang::AnalysisDeclContext::getCFGReachablityAnalysis(void)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: class clang::CFGBlock const * __cdecl clang::AnalysisDeclContext::getBlockForRegisteredExpression(class clang::Stmt const *)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))
>>> referenced 1 more times

lld-link: error: undefined symbol: public: bool __cdecl clang::CFGReverseBlockReachabilityAnalysis::isReachable(class clang::CFGBlock const *, class clang::CFGBlock const *)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: __cdecl clang::AnalysisDeclContext::~AnalysisDeclContext(void)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::issueWarningsForRegisteredVarDecl(class clang::VarDecl *))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: void __cdecl clang::reachable_code::FindUnreachableCode(class clang::AnalysisDeclContext &, class clang::Preprocessor &, class clang::reachable_code::Callback &)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: void __cdecl clang::threadSafety::runThreadSafetyAnalysis(class clang::AnalysisDeclContext &, class clang::threadSafety::ThreadSafetyHandler &, class clang::threadSafety::BeforeSet **)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: virtual __cdecl clang::threadSafety::ThreadSafetyHandler::~ThreadSafetyHandler(void)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: virtual void * __cdecl clang::threadSafety::`anonymous namespace'::ThreadSafetyReporter::`scalar deleting dtor'(unsigned int))

lld-link: error: undefined symbol: public: void __cdecl clang::consumed::ConsumedAnalyzer::run(class clang::AnalysisDeclContext &)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: virtual __cdecl clang::consumed::ConsumedWarningsHandlerBase::~ConsumedWarningsHandlerBase(void)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: virtual void * __cdecl clang::consumed::`anonymous namespace'::ConsumedWarningsHandler::`scalar deleting dtor'(unsigned int))

lld-link: error: undefined symbol: void __cdecl clang::runUninitializedVariablesAnalysis(class clang::DeclContext const &, class clang::CFG const &, class clang::AnalysisDeclContext &, class clang::UninitVariablesHandler &, struct clang::UninitVariablesAnalysisStats &)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: void __cdecl clang::checkCalledOnceParameters(class clang::AnalysisDeclContext &, class clang::CalledOnceCheckHandler &, bool)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: class clang::Stmt * __cdecl clang::AnalysisDeclContext::getBody(void) const
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: unsigned int __cdecl clang::reachable_code::ScanReachableFromBlock(class clang::CFGBlock const *, class llvm::BitVector &)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(void __cdecl checkThrowInNonThrowingFunc(class clang::Sema &, class clang::FunctionDecl const *, class clang::AnalysisDeclContext &))

lld-link: error: undefined symbol: public: static bool __cdecl clang::CFGBlock::FilterEdge(class clang::CFGBlock::FilterOptions const &, class clang::CFGBlock const *, class clang::CFGBlock const *)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: undefined symbol: public: class clang::ParentMap & __cdecl clang::AnalysisDeclContext::getParentMap(void)
>>> referenced by clangSema.lib(AnalysisBasedWarnings.cpp.obj):(public: void __cdecl clang::sema::AnalysisBasedWarnings::IssueWarnings(class clang::sema::AnalysisBasedWarnings::Policy, class clang::sema::FunctionScopeInfo *, class clang::Decl const *, class clang::QualType))

lld-link: error: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

Comment on lines +5570 to +5572
// -inf -> -0
if (KnownSrc.isKnownNeverNegInfinity())
Known.knownNot(fcNegZero);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// -inf -> -0
if (KnownSrc.isKnownNeverNegInfinity())
Known.knownNot(fcNegZero);

rsq(-inf) = nan
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:AMDGPU floating-point Floating-point math llvm:analysis Includes value tracking, cost tables and constant folding llvm:transforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants