[ARM] CMSE code generation
authorMomchil Velikov <momchil.velikov@arm.com>
Tue, 5 May 2020 16:04:29 +0000 (17:04 +0100)
committerMomchil Velikov <momchil.velikov@arm.com>
Tue, 5 May 2020 17:23:28 +0000 (18:23 +0100)
commit7cbbf89d230d46c3de9a7affc29b23f08c4377a1
tree5fa0a10ff4a83a54ea9c5f48cd45ab94a6216e31
parente4512b5346203560d8e3122af03c0608c583f4d8
[ARM] CMSE code generation

This patch implements the final bits of CMSE code generation:

* emit special linker symbols

* restrict parameter passing to not use memory

* emit BXNS and BLXNS instructions for returns from non-secure entry
  functions, and non-secure function calls, respectively

* emit code to save/restore secure floating-point state around calls
  to non-secure functions

* emit code to save/restore non-secure floating-pointy state upon
  entry to non-secure entry function, and return to non-secure state

* emit code to clobber registers not used for arguments and returns
  when switching to no-secure state

Patch by Momchil Velikov, Bradley Smith, Javed Absar, David Green,
possibly others.

Differential Revision: https://reviews.llvm.org/D76518
22 files changed:
llvm/lib/Target/ARM/ARMAsmPrinter.cpp
llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
llvm/lib/Target/ARM/ARMFastISel.cpp
llvm/lib/Target/ARM/ARMFrameLowering.cpp
llvm/lib/Target/ARM/ARMFrameLowering.h
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/lib/Target/ARM/ARMInstrInfo.td
llvm/lib/Target/ARM/ARMInstrThumb.td
llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp
llvm/lib/Target/ARM/ARMMachineFunctionInfo.h
llvm/lib/Target/ARM/ARMRegisterInfo.td
llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
llvm/test/CodeGen/ARM/cmse-clear-float-bigend.mir [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse-clear-float-hard.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse-clear-float-hard2.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse-clear-float-mve.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse-clear-float.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse-clear.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse-clrm-it-block.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse-expand-bxns-ret.mir [new file with mode: 0644]
llvm/test/CodeGen/ARM/cmse.ll [new file with mode: 0644]