Currently we use rsqrt to build estimation of sqrt. But this would produce wrong result (NaN) when x is +infinity.
Details
Details
- Reviewers
hfinkel jsji nemanjai spatel evandro jlebar craig.scott - Group Reviewers
Restricted Project - Commits
- rG95bcab8272ce: [DAGCombiner] Require ninf for sqrt recip estimation
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
13096–13098 | Can we add the 'ninf' check here instead? | |
21193 | We can make this comment more exact; something like: // Require 'ninf' because sqrt(Inf) == Inf, but an estimate computes: // sqrt(Inf) == rqsrt(Inf) * Inf == 0 * Inf == NaN. |
Can we add the 'ninf' check here instead?