[PATCH] D115052: [Passes] Only run extra vector passes if loops have been vectorized.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 9 06:18:29 PST 2021
fhahn added inline comments.
================
Comment at: llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h:98
+/// extra simplifications could be beneficial).
+class ExtraVectorPassManager : public FunctionPassManager {
+ /// Set of passes to run conditionally.
----------------
aeubanks wrote:
> fhahn wrote:
> > aeubanks wrote:
> > > can `ExtraVectorPassManager` only contain `ConditionalPasses` and we have a separate FPM for the normal passes? separation of concerns, seems like this is doing two things that could be separated
> > The reason why `ExtraVectorPassManager` contains both the conditional and unconditional passes is that this way we can check whether `ShouldRunExtraVectorPasses` is available *before* the unconditional passes run.
> >
> > If we would run the unconditional passes outside of `ExtraVectorPassManager`, then any change they make would invalidate `ShouldRunExtraVectorPasses` IIUC. Unless we teach all those passes to preserve it. Or perhaps there's a different alternative?
> you could override the `invalidate()` method of `Result` to be stateless, e.g. following
> ```
> bool GlobalsAAResult::invalidate(Module &, const PreservedAnalyses &PA,
> ModuleAnalysisManager::Invalidator &) {
> // Check whether the analysis has been explicitly invalidated. Otherwise, it's
> // stateless and remains preserved.
> auto PAC = PA.getChecker<GlobalsAA>();
> return !PAC.preservedWhenStateless();
> }
> ```
>
> this makes it so it's only invalidated if it's specifically abandoned
>
> this should make it so this only needs to wrap the `ConditionaPasses` and not be its own `FunctionPassManager`
Done, thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115052/new/
https://reviews.llvm.org/D115052
More information about the llvm-commits
mailing list