[PATCH] D22305: [BasicAA] Avoid calling GetUnderlyingObject, when the result of a previous call can be reused.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 15:11:01 PDT 2016


hfinkel accepted this revision.
hfinkel added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D22305#491329, @amehsan wrote:

> Ping :)
>  This patch currently only includes the compile time improvement. @hfinkel Did I answer your question?


Yes, thanks, LGTM.


================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:1413
@@ -1406,3 +1412,3 @@
   // Figure out what objects these things are pointing to if we can.
-  const Value *O1 = GetUnderlyingObject(V1, DL, MaxLookupSearchDepth);
-  const Value *O2 = GetUnderlyingObject(V2, DL, MaxLookupSearchDepth);
+  if (O1 == nullptr)
+    O1 = GetUnderlyingObject(V1, DL, MaxLookupSearchDepth);
----------------
You can just say if (!O1) here, and similar below.


https://reviews.llvm.org/D22305





More information about the llvm-commits mailing list