[llvm] 86e26f0 - [MTE] Instrument use-after-scope for optnone functions.

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 13:53:59 PST 2022


Author: Florian Mayer
Date: 2022-02-17T13:53:47-08:00
New Revision: 86e26f09a4039837bc9954d963fdc5745ff413be

URL: https://github.com/llvm/llvm-project/commit/86e26f09a4039837bc9954d963fdc5745ff413be
DIFF: https://github.com/llvm/llvm-project/commit/86e26f09a4039837bc9954d963fdc5745ff413be.diff

LOG: [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

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64StackTagging.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
index 589074e16d9b0..4cb1db3ad75a7 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<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();
   }
@@ -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();
   }


        


More information about the llvm-commits mailing list