[PATCH] D119801: [NFC] [MTE] only do one pass over allocas for stack tagging.
Florian Mayer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 14 18:12:54 PST 2022
fmayer created this revision.
Herald added a subscriber: hiraditya.
fmayer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119801
Files:
llvm/lib/Target/AArch64/AArch64StackTagging.cpp
Index: llvm/lib/Target/AArch64/AArch64StackTagging.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64StackTagging.cpp
+++ llvm/lib/Target/AArch64/AArch64StackTagging.cpp
@@ -502,14 +502,6 @@
if (SInfo.AllocasToInstrument.empty())
return false;
- for (auto &I : SInfo.AllocasToInstrument) {
- memtag::AllocaInfo &Info = I.second;
- assert(Info.AI && isInterestingAlloca(*Info.AI));
- auto *PrevAI = Info.AI;
- if (memtag::alignAndPadAlloca(Info, kTagGranuleSize))
- PrevAI->eraseFromParent();
- }
-
std::unique_ptr<DominatorTree> DeleteDT;
DominatorTree *DT = nullptr;
if (auto *P = getAnalysisIfAvailable<DominatorTreeWrapperPass>())
@@ -538,7 +530,11 @@
int NextTag = 0;
for (auto &I : SInfo.AllocasToInstrument) {
- const memtag::AllocaInfo &Info = I.second;
+ memtag::AllocaInfo &Info = I.second;
+ assert(Info.AI && isInterestingAlloca(*Info.AI));
+ auto *PrevAI = Info.AI;
+ if (memtag::alignAndPadAlloca(Info, kTagGranuleSize))
+ PrevAI->eraseFromParent();
AllocaInst *AI = Info.AI;
int Tag = NextTag;
NextTag = (NextTag + 1) % 16;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119801.408680.patch
Type: text/x-patch
Size: 1176 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220215/cf785fe8/attachment.bin>
More information about the llvm-commits
mailing list