[PATCH] D57215: [CodeExtractor] Clear function's assumption cache after extracting blocks from it

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 6 17:34:47 PST 2019


hfinkel added inline comments.


================
Comment at: lib/Transforms/IPO/HotColdSplitting.cpp:202
     AU.addRequired<TargetTransformInfoWrapperPass>();
+    AU.addUsedIfAvailable<AssumptionCacheTracker>();
   }
----------------
vsk wrote:
> sdmitriev wrote:
> > vsk wrote:
> > > The splitting pass does not explicitly preserve AssumptionCacheTracker. Why does this not invalidate AssumptionCacheTracker correctly? As the splitting pass does not "really" need AssumptionCacheTracker, it seems preferable to just not require it here.
> > AssumptionCacheTracker is implemented as immutable pass, so, as I understand, it cannot be invalidated.
> I see, thanks for explaining. It looks like it's well-understood that AssumptionCache may need to be invalidated (there's already a clear() method). As most passes do not invalidate it, making AssumptionCacheTracker an ImmutablePass might be the right tradeoff. @hfinkel does that sound right?
The original idea was that the only passes that added new assumptions needed to explicitly update the cache, and for everything else it should be self-updating (and this made sense under the assumption that adding assumptions is rare).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57215/new/

https://reviews.llvm.org/D57215





More information about the llvm-commits mailing list