]> granicus.if.org Git - llvm/commit
[AArch64] Ensure no tagged memory is left in the unallocated portion of the
authorMomchil Velikov <momchil.velikov@arm.com>
Wed, 9 Oct 2019 16:31:50 +0000 (16:31 +0000)
committerMomchil Velikov <momchil.velikov@arm.com>
Wed, 9 Oct 2019 16:31:50 +0000 (16:31 +0000)
commitf4f16f170b82f537e98ec5c0d55455c089550346
tree5be3c646cbb7ce8374f6c04234b84ab374d70690
parent51a2302242c444e60d17291fb1476e888ab0f209
[AArch64] Ensure no tagged memory is left in the unallocated portion of the
stack

This patch makes sure that if we tag some memory, we untag that memory before
the function returns/throws via any exit, reachable from the tag operation. For
that we place the untag operation either at:

  a) the lifetime end call for the alloca, if that call post-dominates the
     lifetime start call (where the tag operation is placed), or it (the
     lifetime end call) dominates all reachable exits, otherwise
  b) at the reachable exits

Differential Revision: https://reviews.llvm.org/D68469

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374182 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64StackTagging.cpp
test/CodeGen/AArch64/stack-tagging-ex-1.ll [new file with mode: 0644]
test/CodeGen/AArch64/stack-tagging-ex-2.ll [new file with mode: 0644]
test/CodeGen/AArch64/stack-tagging-untag-placement.ll [new file with mode: 0644]