[PATCH] D105141: [MTE] Remove redundant helper function.

Florian Mayer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 03:11:43 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa24f104645f3: [MTE] Remove redundant helper function. (authored by fmayer).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105141/new/

https://reviews.llvm.org/D105141

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
@@ -520,24 +520,6 @@
   Info.AI = NewAI;
 }
 
-// Helper function to check for post-dominance.
-static bool postDominates(const PostDominatorTree *PDT, const IntrinsicInst *A,
-                          const IntrinsicInst *B) {
-  const BasicBlock *ABB = A->getParent();
-  const BasicBlock *BBB = B->getParent();
-
-  if (ABB != BBB)
-    return PDT->dominates(ABB, BBB);
-
-  for (const Instruction &I : *ABB) {
-    if (&I == B)
-      return true;
-    if (&I == A)
-      return false;
-  }
-  llvm_unreachable("Corrupt instruction list");
-}
-
 // FIXME: check for MTE extension
 bool AArch64StackTagging::runOnFunction(Function &Fn) {
   if (!Fn.hasFnAttribute(Attribute::SanitizeMemTag))
@@ -666,7 +648,7 @@
       tagAlloca(AI, Start->getNextNode(), Start->getArgOperand(1), Size);
       // We need to ensure that if we tag some object, we certainly untag it
       // before the function exits.
-      if (PDT != nullptr && postDominates(PDT, End, Start)) {
+      if (PDT != nullptr && PDT->dominates(End, Start)) {
         untagAlloca(AI, End, Size);
       } else {
         SmallVector<Instruction *, 8> ReachableRetVec;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105141.355489.patch
Type: text/x-patch
Size: 1365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210630/47dbe6ae/attachment.bin>


More information about the llvm-commits mailing list