[PATCH] PR15967 basicaa claims no alias when there is

Hal Finkel hfinkel at anl.gov
Tue Mar 18 09:42:31 PDT 2014


Karl-Johan,

+// The max limit of the search depth in DecomposeGEPExpression() and 

+// GetUnderlyingObject(), both functions need to use the same search

+// depth otherwise the algorithm assert false.

+static const unsigned MaxLookupSearchDepth = 6;

Okay, this is good, but:

 - "otherwise the algorithm assert false." -- This does not parse for me. Do you mean that it will assert, or do you mean that it may return an invalid answer. Given the PR, it seems like the latter.

 - Please add a *strong* warning, both in the function body of DecomposeGEPExpression and also in the body of llvm::GetUnderlyingObject warning that these two functions are semantically linked, and that llvm::GetUnderlyingObject must never gain the ability for recurse farther than DecomposeGEPExpression for any given depth limit.


+        // If the max search depth is reached the result is undefined

+        if (GEP2MaxLookupReached || GEP1MaxLookupReached) {

+          return MayAlias;

+        }

don't add { } around single-line ifs like this. (see the code examples in http://llvm.org/docs/CodingStandards.html)

+    // If the max search depth is reached the result is undefined

+    if (GEP2MaxLookupReached || GEP1MaxLookupReached) {

+      return MayAlias;

+    }

same here

+    // If the max search depth is reached the result is undefined

+    if (GEP1MaxLookupReached) {

+      return MayAlias;

+    }

same here

Thanks for working on this!

 -Hal

----- Original Message -----
> From: "Karl-Johan Karlsson" <karl-johan.karlsson at ericsson.com>
> To: llvm-commits at cs.uiuc.edu
> Sent: Tuesday, March 18, 2014 9:14:14 AM
> Subject: [PATCH] PR15967 basicaa claims no alias when there is
> 
> Hi,
> 
> Fix in basicaa for problem when the MaxLookup limit was reached.
> 
> / Karl-Johan Karlsson
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list