diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-09-07 03:09:36 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-09-07 03:09:36 +0000 |
commit | 9c27b59cec76abea4f3f9261f3ffa73450f239c6 (patch) | |
tree | cbd262430eaef3d65d5ab2ae6f948c7befa9698f /llvm/lib/Analysis/AliasAnalysis.cpp | |
parent | dd507867efdc04a9d117cfe10bd291aa4b44ebbb (diff) | |
download | bcm5719-llvm-9c27b59cec76abea4f3f9261f3ffa73450f239c6.tar.gz bcm5719-llvm-9c27b59cec76abea4f3f9261f3ffa73450f239c6.zip |
Change TargetLibraryInfo analysis passes to always require Function
Summary:
This is the first change to enable the TLI to be built per-function so
that -fno-builtin* handling can be migrated to use function attributes.
See discussion on D61634 for background. This is an enabler for fixing
handling of these options for LTO, for example.
This change should not affect behavior, as the provided function is not
yet used to build a specifically per-function TLI, but rather enables
that migration.
Most of the changes were very mechanical, e.g. passing a Function to the
legacy analysis pass's getTLI interface, or in Module level cases,
adding a callback. This is similar to the way the per-function TTI
analysis works.
There was one place where we were looking for builtins but not in the
context of a specific function. See FindCXAAtExit in
lib/Transforms/IPO/GlobalOpt.cpp. I'm somewhat concerned my workaround
could provide the wrong behavior in some corner cases. Suggestions
welcome.
Reviewers: chandlerc, hfinkel
Subscribers: arsenm, dschuff, jvesely, nhaehnle, mehdi_amini, javed.absar, sbc100, jgravelle-google, eraman, aheejin, steven_wu, george.burgess.iv, dexonsmith, jfb, asbirlea, gchatelet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66428
llvm-svn: 371284
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index 32241e355eb..55dd9a4cda0 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -784,7 +784,7 @@ bool AAResultsWrapperPass::runOnFunction(Function &F) { // previous object first, in this case replacing it with an empty one, before // registering new results. AAR.reset( - new AAResults(getAnalysis<TargetLibraryInfoWrapperPass>().getTLI())); + new AAResults(getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F))); // BasicAA is always available for function analyses. Also, we add it first // so that it can trump TBAA results when it proves MustAlias. @@ -840,7 +840,7 @@ void AAResultsWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AAResults llvm::createLegacyPMAAResults(Pass &P, Function &F, BasicAAResult &BAR) { - AAResults AAR(P.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI()); + AAResults AAR(P.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F)); // Add in our explicitly constructed BasicAA results. if (!DisableBasicAA) |