MemTag: stack initializer merging.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 19 Aug 2019 20:47:09 +0000 (20:47 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 19 Aug 2019 20:47:09 +0000 (20:47 +0000)
commit50affbe47fc97f9514ef32d657b36b54285da214
treee6de18b138f26b0aac18adc8990e6117a5f6f337
parent3b4ce731fbcc6490da95d8091b384c3ddb3c70d9
MemTag: stack initializer merging.

Summary:
MTE provides instructions to update memory tags and data at the same
time. This change makes use of those to generate more compact code for
stack variable tagging + initialization.

We collect memory store and memset instructions following an alloca or a
lifetime.start call, and replace them with the corresponding MTE
intrinsics. Since the intrinsics work on 16-byte aligned chunks, the
stored values are combined as necessary.

Reviewers: pcc, vitalybuka, ostannard

Subscribers: srhines, javed.absar, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 369297
llvm/lib/Target/AArch64/AArch64.h
llvm/lib/Target/AArch64/AArch64StackTagging.cpp
llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
llvm/test/CodeGen/AArch64/O3-pipeline.ll
llvm/test/CodeGen/AArch64/stack-tagging-initializer-merge.ll [new file with mode: 0644]