[llvm] [aarch64] XOR the frame pointer with the stack cookie when protecting the stack (PR #161114)

Pan Tao via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 26 21:58:40 PST 2025


================
@@ -959,6 +961,18 @@ bool AArch64DAGToDAGISel::SelectRDSVLShiftImm(SDValue N, SDValue &Imm) {
   return false;
 }
 
+/// SelectAddUXTXRegister - Select a "UXTX register" operand. This
+/// operand is referred by the instructions have SP operand
+bool AArch64DAGToDAGISel::SelectAddUXTXRegister(SDValue N, SDValue &Reg,
+                                                SDValue &Shift) {
+  if (N.getOpcode() != ISD::LOAD)
+    return false;
----------------
PanTao2 wrote:

If the LOAD is not checked, there will be many unexpected changes. E.g., the following code
````
stur x10, [x29, #-200]               // 8-byte Folded Spill
mov x15, sp
subs x10, x15, #16
````
will be changed to
````
stur x10, [x29, #-200]
mov x15, sp
add x10, x15, x8, uxtx
````

https://github.com/llvm/llvm-project/pull/161114


More information about the llvm-commits mailing list