[llvm] [ARM] CMSE security mitigation on function arguments and returned values (PR #89944)
Victor Campos via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 02:37:58 PDT 2024
================
@@ -156,6 +156,17 @@ static const MCPhysReg GPRArgRegs[] = {
ARM::R0, ARM::R1, ARM::R2, ARM::R3
};
+static SDValue handleCMSEValue(const SDValue &Value, const ISD::InputArg &Arg,
+ SelectionDAG &DAG, const SDLoc &DL, EVT RegVT) {
+ assert(Arg.ArgVT.isScalarInteger() && RegVT.isScalarInteger());
+ assert(Arg.ArgVT.bitsLT(RegVT));
+ SDValue Trunc = DAG.getNode(ISD::TRUNCATE, DL, Arg.ArgVT, Value);
----------------
vhscampos wrote:
`Value` is of 32-bit type since it originates from a general-purpose register. So in order to clear its higher bits, it needs to be first truncated and then extended back again.
https://github.com/llvm/llvm-project/pull/89944
More information about the llvm-commits
mailing list