[llvm] [DAG] computeKnownFPClass - add ISD::SQRT handling + test coverage (PR #195405)

Tharun V K via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 20:05:40 PDT 2026


tharunvk wrote:

@RKSimon just a quick overview on why I wrote tests for RISCV instead of X86.

RISC-V has native hardware support for floating-point class checks (via the fclass instruction). Because of this, the SelectionDAGBuilder maps the IR intrinsic directly to an ISD::IS_FPCLASS node and preserves it.

But X86 does not have a native fclass equivalent. During SelectionDAG construction, X86 target-lowering immediately expands the intrinsic into a setuo node, or an infinity check into an X86ISD::FCMP.
Because the ISD::IS_FPCLASS node is essentially destroyed during the initial translation, the DAGCombiner never actually encounters the node on X86, meaning this specific fold cannot trigger there.

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


More information about the llvm-commits mailing list