diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-12 15:41:22 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-12 21:42:36 +0100 |
commit | 191e469edee619f578076d775ce1ca19c9ecc103 (patch) | |
tree | ffd2ab8020ab2c56b0b397527dfd489adbdfc5aa /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | c96e214b9ca7739737cf257baf32ff819854027d (diff) | |
download | llvm-191e469edee619f578076d775ce1ca19c9ecc103.zip llvm-191e469edee619f578076d775ce1ca19c9ecc103.tar.gz llvm-191e469edee619f578076d775ce1ca19c9ecc103.tar.bz2 |
[AA] Move Depth member from AAResults to AAQI (NFC)
Rather than storing the query depth in AAResults, store it in AAQI.
This makes more sense, as it is a property of the query. This
sidesteps the issue of D94363, fixing slightly inaccurate AA
statistics. Additionally, I plan to use the Depth from BasicAA in
the future, where fetching it from AAResults would be unreliable.
This change is not quite as straightforward as it seems, because
we need to preserve the depth when creating a new AAQI for recursive
queries across phis. I'm adding a new method for this, as we may
need to preserve additional information here in the future.
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 97d0cb6..a3add55 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -1456,7 +1456,7 @@ AliasResult BasicAAResult::aliasPHI(const PHINode *PN, LocationSize PNSize, // If we inserted a block into VisitedPhiBBs, alias analysis results that // have been cached earlier may no longer be valid. Perform recursive queries // with a new AAQueryInfo. - AAQueryInfo NewAAQI; + AAQueryInfo NewAAQI = AAQI.withEmptyCache(); AAQueryInfo *UseAAQI = BlockInserted ? &NewAAQI : &AAQI; AliasResult Alias = getBestAAResults().alias( |