[AArch64][MachineOutliner] Return address signing for outlined functions
authorDavid Tellenbach <david.tellenbach@arm.com>
Wed, 30 Oct 2019 14:11:51 +0000 (14:11 +0000)
committerDavid Tellenbach <david.tellenbach@arm.com>
Wed, 30 Oct 2019 15:20:16 +0000 (15:20 +0000)
commit70caa1fc30c392974df3bccd9959765dae1779f6
tree9703ef51ced915ab2a300ca4120bc3a9ca5aa4df
parent86549c7528db91a6d2b856f626de299313743709
[AArch64][MachineOutliner] Return address signing for outlined functions

Summary:
During AArch64 frame lowering instructions to enable return address
signing are inserted into function if needed. Functions generated during
machine outlining don't run through target frame lowering and hence are
missing such instructions.

This patch introduces the following changes:

  1. If not all functions that potentially participate in function outlining
     agree on their return address signing scope and their return address
     signing key, outlining is disabled for these functions.
  2. If not all functions that potentially participate in function outlining
     agree on their support for v8.3A features, outlining is disabled for
     these functions.
  2. If all candidate functions agree on the signing scope, signing key and
     and their support for v8.3 features, the outlined function behaves as
     if it had the same scope and key attributes and as if it would provide
     the same v8.3A support as the original functions.

Reviewers: olista01, paquette, t.p.northover, ostannard

Reviewed By: ostannard

Subscribers: ostannard, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69097
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-diff-scope-same-key.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-non-leaf.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-regsave.mir [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-diff-key.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-a.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-b.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-subtarget.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-thunk.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-v8-3.ll [new file with mode: 0644]