[PATCH] D21035: [PM] Preserve the correct set of passes for GVN
Chandler Carruth via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 17:26:36 PDT 2016
Just FYI for context:
On Mon, Jun 6, 2016 at 12:27 PM Davide Italiano via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> davide created this revision.
> davide added reviewers: chandlerc, bogner, sanjoy.
> davide added a subscriber: llvm-commits.
>
> Not sure if this is just an oversight, or there's a real reason why we
> don't want to cache DominatorTree and GlobalsAA when the IR is mutated as
> the old PM does. Thanks!
>
Just oversight. Thanks!
>
> http://reviews.llvm.org/D21035
>
> Files:
> lib/Transforms/Scalar/GVN.cpp
>
> Index: lib/Transforms/Scalar/GVN.cpp
> ===================================================================
> --- lib/Transforms/Scalar/GVN.cpp
> +++ lib/Transforms/Scalar/GVN.cpp
> @@ -594,7 +594,12 @@
> auto &AA = AM.getResult<AAManager>(F);
> auto &MemDep = AM.getResult<MemoryDependenceAnalysis>(F);
> bool Changed = runImpl(F, AC, DT, TLI, AA, &MemDep);
> - return Changed ? PreservedAnalyses::none() : PreservedAnalyses::all();
> + if (!Changed)
> + return PreservedAnalyses::all();
> + PreservedAnalyses PA;
> + PA.preserve<DominatorTreeAnalysis>();
> + PA.preserve<GlobalsAA>();
> + return PA;
> }
>
> #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160607/79ad00ee/attachment.html>
More information about the llvm-commits
mailing list