diff options
author | Nikita Popov <npopov@redhat.com> | 2022-10-21 12:16:57 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-10-21 12:18:57 +0200 |
commit | eb470e67c148089d8d5c0c379a569ac55591546c (patch) | |
tree | 29b6dd8a22c3cba0e8d9f117cd9c8052f79f6d86 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | fd236772f5665ce9e55f85ac992be6c22a918d3e (diff) | |
download | llvm-eb470e67c148089d8d5c0c379a569ac55591546c.zip llvm-eb470e67c148089d8d5c0c379a569ac55591546c.tar.gz llvm-eb470e67c148089d8d5c0c379a569ac55591546c.tar.bz2 |
[ModuleSummaryAnalysis] Use helper methods to check readnone/readonly (NFC)
This makes sure that this code continue working when switching to
the memory attribute.
A caveat here is that onlyReadsMemory() will also true for readnone.
To be conservative, I'm explicitly excluding that case here.
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index efe6058..52827c2 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -492,8 +492,7 @@ static void computeFunctionSummary( F.getLinkage(), F.getVisibility(), NotEligibleForImport, /* Live = */ false, F.isDSOLocal(), F.canBeOmittedFromSymbolTable()); FunctionSummary::FFlags FunFlags{ - F.hasFnAttribute(Attribute::ReadNone), - F.hasFnAttribute(Attribute::ReadOnly), + F.doesNotAccessMemory(), F.onlyReadsMemory() && !F.doesNotAccessMemory(), F.hasFnAttribute(Attribute::NoRecurse), F.returnDoesNotAlias(), // FIXME: refactor this to use the same code that inliner is using. // Don't try to import functions with noinline attribute. |