[clang] [llvm] [AMDGPU] Use 1-iteration Newton-Raphson refinement for FP32 reciprocal. (PR #194716)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 8 13:53:37 PDT 2026


================
@@ -94,6 +94,12 @@ static cl::opt<bool> DisableFDivExpand(
   cl::ReallyHidden,
   cl::init(false));
 
+static cl::opt<bool> EnableFP32ReciprocalNewtonRaphson(
+    "enable-fp32-recip-newton-raphson", cl::Hidden, cl::init(false),
+    cl::desc("Use Newton-Raphson refinement for 1.0f/x when the denominator "
+             "is a normal float, falling back to the full division sequence "
+             "for denormals/inf/nan/zero."));
----------------
carlobertolli wrote:

I added one that just gets forwarded to the optimizer one. Please help me understand if this is not the right way of doing this - it's been a few years since I last added a clang flag.

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


More information about the cfe-commits mailing list