[llvm] 53642d5 - [NFC] Fix the formula for reciprocal calculation.

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 9 01:05:12 PDT 2021


Author: Luo, Yuanke
Date: 2021-08-09T16:03:56+08:00
New Revision: 53642d5b800c1d22ba11bb38b7c2ff3d7d52548e

URL: https://github.com/llvm/llvm-project/commit/53642d5b800c1d22ba11bb38b7c2ff3d7d52548e
DIFF: https://github.com/llvm/llvm-project/commit/53642d5b800c1d22ba11bb38b7c2ff3d7d52548e.diff

LOG: [NFC] Fix the formula for reciprocal calculation.

Differential Revision: https://reviews.llvm.org/D107713

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index c07a75ca45480..3e008ae76ca1a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -22877,7 +22877,7 @@ SDValue DAGCombiner::BuildLogBase2(SDValue V, const SDLoc &DL) {
 
 /// Newton iteration for a function: F(X) is X_{i+1} = X_i - F(X_i)/F'(X_i)
 /// For the reciprocal, we need to find the zero of the function:
-///   F(X) = A X - 1 [which has a zero at X = 1/A]
+///   F(X) = 1/X - A [which has a zero at X = 1/A]
 ///     =>
 ///   X_{i+1} = X_i (2 - A X_i) = X_i + X_i (1 - A X_i) [this second form
 ///     does not require additional intermediate precision]


        


More information about the llvm-commits mailing list