[patch] fix comment on findGCD

David Tweed david.tweed at arm.com
Tue Dec 31 02:59:17 PST 2013


Hi,

2013/12/30 Mingjie Xing <mingjie.xing at gmail.com>:
Index: lib/Analysis/DependenceAnalysis.cpp
===================================================================
--- lib/Analysis/DependenceAnalysis.cpp (revision 198188)
+++ lib/Analysis/DependenceAnalysis.cpp (working copy)
@@ -1275,8 +1275,8 @@
 //
 // Program 2.1, page 29.
 // Computes the GCD of AM and BM.
-// Also finds a solution to the equation ax - by = gdc(a, b).
-// Returns true iff the gcd divides Delta.
+// Also finds a solution to the equation ax + by = gcd(a, b).
+// Return true if dependence disproved.
 static
 bool findGCD(unsigned Bits, APInt AM, APInt BM, APInt Delta,
              APInt &G, APInt &X, APInt &Y) {

Clearly fixing a typo is good: just to be sure, you've verified that the
definition of the equation whose solution is found is the one with a plus
rather than
a minus?

I'm ambivalent about the second line "Return true if dependence disproved."
Changed, since it doesn't really follow the principle that function
prototype
Comments should be understandable without having to look at either the
Caller context or the function body, and what "dependence" means here
isn't obvious from the signature.

Cheers,
Dave







More information about the llvm-commits mailing list