[ARM] Implement harden-sls-retbr for Thumb mode
authorKristof Beyls <kristof.beyls@arm.com>
Thu, 19 Nov 2020 13:58:26 +0000 (13:58 +0000)
committerKristof Beyls <kristof.beyls@arm.com>
Sat, 19 Dec 2020 12:32:47 +0000 (12:32 +0000)
commit320fd3314e378ae6242a2dde97250a8a94d68e27
tree0962ce7aefaa51aef8472eb90d8ab6f1ed990b9c
parentc061cb521b93ab59ac8fb839a956c8e42204102f
[ARM] Implement harden-sls-retbr for Thumb mode

The only non-trivial consideration in this patch is that the formation
of TBB/TBH instructions, which is done in the constant island pass, does
not understand the speculation barriers inserted by the SLSHardening
pass. As such, when harden-sls-retbr is enabled for a function, the
formation of TBB/TBH instructions in the constant island pass is
disabled.

Differential Revision: https://reviews.llvm.org/D92396
llvm/lib/Target/ARM/ARMAsmPrinter.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
llvm/lib/Target/ARM/ARMInstrThumb2.td
llvm/lib/Target/ARM/ARMSLSHardening.cpp
llvm/test/CodeGen/ARM/speculation-hardening-sls.ll