[NewPassManager] Add assertions when getting statefull cached analysis.
authorAlina Sbirlea <asbirlea@google.com>
Tue, 14 Jan 2020 18:27:20 +0000 (10:27 -0800)
committerAlina Sbirlea <asbirlea@google.com>
Wed, 13 May 2020 19:38:38 +0000 (12:38 -0700)
commitbd541b217f4d750391677144ccaa586874236f38
treecd64c1197394b2ef61dddafc41a4bde27037ce34
parentdb04ff4b6bc3fbf5618556c52f8dd57a00790648
[NewPassManager] Add assertions when getting statefull cached analysis.

Summary:
Analyses that are statefull should not be retrieved through a proxy from
an outer IR unit, as these analyses are only invalidated at the end of
the inner IR unit manager.
This patch disallows getting the outer manager and provides an API to
get a cached analysis through the proxy. If the analysis is not
stateless, the call to getCachedResult will assert.

Reviewers: chandlerc

Subscribers: mehdi_amini, eraman, hiraditya, zzheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72893
19 files changed:
clang/test/CodeGen/thinlto-distributed-newpm.ll
llvm/include/llvm/Analysis/AliasAnalysis.h
llvm/include/llvm/Analysis/CGSCCPassManager.h
llvm/include/llvm/IR/PassManager.h
llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
llvm/lib/Analysis/CGSCCPassManager.cpp
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/lib/Transforms/Utils/CallGraphUpdater.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
llvm/unittests/IR/PassManagerTest.cpp
llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp