[llvm] [WIP][SPARC] Allow overaligned `alloca`s (PR #107223)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 18:00:25 PDT 2024


================
@@ -2811,12 +2818,17 @@ static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG,
     regSpillArea = 96;
   }
 
-  unsigned SPReg = SP::O6;
-  SDValue SP = DAG.getCopyFromReg(Chain, dl, SPReg, VT);
-  SDValue NewSP = DAG.getNode(ISD::SUB, dl, VT, SP, Size); // Value
-  Chain = DAG.getCopyToReg(SP.getValue(1), dl, SPReg, NewSP);    // Output chain
+  AlignedPtr = DAG.getNode(ISD::SUB, dl, VT, AlignedPtr, Size);
----------------
s-barannikov wrote:

It should be `(ptr - size) & -align`.


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


More information about the llvm-commits mailing list