[llvm] [RISCV] Remove getOffsetOfLocalArea() (PR #93765)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 21:11:27 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Pengcheng Wang (wangpc-pp)

<details>
<summary>Changes</summary>

For RISC-V, it's always 0 and I don't see any reason we will
change it in the future.


---
Full diff: https://github.com/llvm/llvm-project/pull/93765.diff


1 Files Affected:

- (modified) llvm/lib/Target/RISCV/RISCVFrameLowering.cpp (+2-3) 


``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
index 436bd4a38a319..4931e3a994e38 100644
--- a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
@@ -878,9 +878,8 @@ RISCVFrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI,
           StackID == TargetStackID::ScalableVector) &&
          "Unexpected stack ID for the frame object.");
   if (StackID == TargetStackID::Default) {
-    Offset =
-        StackOffset::getFixed(MFI.getObjectOffset(FI) - getOffsetOfLocalArea() +
-                              MFI.getOffsetAdjustment());
+    Offset = StackOffset::getFixed(MFI.getObjectOffset(FI) +
+                                   MFI.getOffsetAdjustment());
   } else if (StackID == TargetStackID::ScalableVector) {
     Offset = StackOffset::getScalable(MFI.getObjectOffset(FI));
   }

``````````

</details>


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


More information about the llvm-commits mailing list