Skip to content

Commit

Permalink
[MTE] Instrument use-after-scope for optnone functions.
Browse files Browse the repository at this point in the history
We always need the Dominator and PostDominatorTree for use-after-scope.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D119993
  • Loading branch information
fmayer committed Feb 17, 2022
1 parent 383ed82 commit 86e26f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/Target/AArch64/AArch64StackTagging.cpp
Expand Up @@ -508,8 +508,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
if (auto *P = getAnalysisIfAvailable<DominatorTreeWrapperPass>())
DT = &P->getDomTree();

if (DT == nullptr && (SInfo.AllocasToInstrument.size() > 1 ||
!F->hasFnAttribute(Attribute::OptimizeNone))) {
if (DT == nullptr) {
DeleteDT = std::make_unique<DominatorTree>(*F);
DT = DeleteDT.get();
}
Expand All @@ -519,7 +518,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
if (auto *P = getAnalysisIfAvailable<PostDominatorTreeWrapperPass>())
PDT = &P->getPostDomTree();

if (PDT == nullptr && !F->hasFnAttribute(Attribute::OptimizeNone)) {
if (PDT == nullptr) {
DeletePDT = std::make_unique<PostDominatorTree>(*F);
PDT = DeletePDT.get();
}
Expand Down

0 comments on commit 86e26f0

Please sign in to comment.