================
@@ -2720,6 +2721,30 @@ static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG) 
{
       Align(std::min(PtrVT.getFixedSizeInBits(), VT.getFixedSizeInBits()) / 
8));
 }
 
+static SDValue LowerSTACKADDRESS(SDValue Op, SelectionDAG &DAG,
+                                 const SparcSubtarget *Subtarget) {
+  SDValue Chain = Op.getOperand(0);
+  EVT VT = Op->getValueType(0);
+  SDLoc DL(Op);
+  unsigned OffsetToStackStart = 0;
+
+  unsigned SPReg = SP::O6;
+  SDValue SP = DAG.getCopyFromReg(Chain, DL, SPReg, VT);
+
+  // Unbias the stack pointer register.
+  OffsetToStackStart += Subtarget->getStackPointerBias();
----------------
nikic wrote:

```suggestion
  unsigned OffsetToStackStart = Subtarget->getStackPointerBias();
```
No need to initialize to 0 and then use += here...

https://github.com/llvm/llvm-project/pull/148281
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to