From 86e26f09a4039837bc9954d963fdc5745ff413be Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Wed, 16 Feb 2022 16:32:09 -0800 Subject: [PATCH] [MTE] Instrument use-after-scope for optnone functions. We always need the Dominator and PostDominatorTree for use-after-scope. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D119993 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 589074e..4cb1db3 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -508,8 +508,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) { if (auto *P = getAnalysisIfAvailable()) DT = &P->getDomTree(); - if (DT == nullptr && (SInfo.AllocasToInstrument.size() > 1 || - !F->hasFnAttribute(Attribute::OptimizeNone))) { + if (DT == nullptr) { DeleteDT = std::make_unique(*F); DT = DeleteDT.get(); } @@ -519,7 +518,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) { if (auto *P = getAnalysisIfAvailable()) PDT = &P->getPostDomTree(); - if (PDT == nullptr && !F->hasFnAttribute(Attribute::OptimizeNone)) { + if (PDT == nullptr) { DeletePDT = std::make_unique(*F); PDT = DeletePDT.get(); } -- 2.7.4