[PATCH] D68468: [AArch64] Do not untag before returning via a `resume` instruction

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 08:46:38 PDT 2019


chill created this revision.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a project: LLVM.

Such untag operations are redundant, as the stack unwind runtime has to clear
the deallocated portion of the stack anyway.


https://reviews.llvm.org/D68468

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
@@ -537,7 +537,9 @@
           Allocas[AI].LifetimeEnd.push_back(II);
       }
 
-      if (isa<ReturnInst>(I) || isa<ResumeInst>(I) || isa<CleanupReturnInst>(I))
+      // No need to consider `resume` instructions, as the tags must be cleared
+      // by the stack unwind runtime.
+      if (isa<ReturnInst>(I) || isa<CleanupReturnInst>(I))
         RetVec.push_back(I);
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68468.223227.patch
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191004/100da834/attachment.bin>


More information about the llvm-commits mailing list