[PATCH] D83430: [AliasSetTracker] More precise AAInfo intersection check

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 14:56:30 PDT 2020


nikic created this revision.
nikic added a reviewer: asbirlea.
Herald added subscribers: llvm-commits, kosarev.
Herald added a project: LLVM.

The code currently checks whether the intersection has one of TBAA, Scope or NoAlias unset -- however, those might have already been unset in the first place, in which case we will unnecessarily report a change. Instead, compare the intersection result to the original AAInfo.

This makes for a 0.5% geomean compile-time saving: https://llvm-compile-time-tracker.com/compare.php?from=0b39d2d75275b80994dac06b7ad05031cbd09393&to=7e6dc7d267393489b12e4884641f411d375d000e&stat=instructions

The current form of the check was introduced in https://github.com/llvm/llvm-project/commit/35548e80d67dd0d6e61c489432cfb1dafe0ddb65, which is how I ran into this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83430

Files:
  llvm/include/llvm/Analysis/AliasSetTracker.h


Index: llvm/include/llvm/Analysis/AliasSetTracker.h
===================================================================
--- llvm/include/llvm/Analysis/AliasSetTracker.h
+++ llvm/include/llvm/Analysis/AliasSetTracker.h
@@ -87,12 +87,7 @@
         AAInfo = NewAAInfo;
       else {
         AAMDNodes Intersection(AAInfo.intersect(NewAAInfo));
-        if (!Intersection.TBAA || !Intersection.Scope ||
-            !Intersection.NoAlias) {
-          // NewAAInfo conflicts with AAInfo.
-          AAInfo = DenseMapInfo<AAMDNodes>::getTombstoneKey();
-          SizeChanged = true;
-        }
+        SizeChanged |= Intersection != AAInfo;
         AAInfo = Intersection;
       }
       return SizeChanged;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83430.276562.patch
Type: text/x-patch
Size: 707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200708/5b7e8a7a/attachment.bin>


More information about the llvm-commits mailing list