[PATCH] D133537: [pipelines] RecomputeGlobalsAAPass after OptimizerEarlyEPCallbacks

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 15:43:00 PDT 2022


vitalybuka added a comment.

In D133537#3781499 <https://reviews.llvm.org/D133537#3781499>, @aeubanks wrote:

> I think the question is whether or not people will use OptimizerEarlyEPCallbacks to add optimization passes (e.g. some sort of loop vectorization) which may want an up-to-date GlobalsAA,

Yes, we need to choose either:

1. Callback which needs GlobalsAA will also insert RecomputeGlobalsAAPass (but how many times if we have multiple callbacks?)
2. Callback which corrupt GlobalAA will insert RecomputeGlobalsAAPass. (but how many times if we have multiple callbacks?)
3. Run RecomputeGlobalsAAPass before and after callbacks, but then it's unnecessary if we have no callbacks relevant to analysis.

This patch is to go no. 1.

> Is this in preparation for actually using OptimizerEarlyEPCallbacks?

Yes.

In D133537#3781499 <https://reviews.llvm.org/D133537#3781499>, @aeubanks wrote:

> Note that this won't help with having GlobalsAA updated if you add sanitizer passes here that invalidate GlobalsAA since RecomputeGlobalsAAPass only has an effect if GlobalsAA hasn't been explicitly invalidated (`RecomputeGlobalsAAPass::run`).

I assumed that D133394 <https://reviews.llvm.org/D133394> invalidates (it's even in description). Then RecomputeGlobalsAAPass will recalculated it, but if RecomputeGlobalsAAPass is missing we will proceed without GlobalsAA. 
But now I see that abandon<> removes it forever.

What would be the right solution for that?
I see the following:

1. Just for clang, I revert D133394 <https://reviews.llvm.org/D133394> and just make sanitizer callbacks to insert RecomputeGlobalsAAPass after sanitizers.
2. Extract RecomputeGlobalsAAPass::run into utility function and call it from sanitizers instead of abandon<>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133537



More information about the llvm-commits mailing list