Re-commit: [ARM] CMSE code generation
authorMomchil Velikov <momchil.velikov@arm.com>
Thu, 14 May 2020 15:43:20 +0000 (16:43 +0100)
committerMomchil Velikov <momchil.velikov@arm.com>
Thu, 14 May 2020 15:46:16 +0000 (16:46 +0100)
commitbc2e572f51dac4aed8ef86b2f09427109f0cabb8
treea880dfb968a1d9c335f1eda68f0f5a1aa7577426
parent17941437a2ed8abefef719345391da94e6df8ebb
Re-commit: [ARM] CMSE code generation

This patch implements the final bits of CMSE code generation:

* emit special linker symbols

* restrict parameter passing to no 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]