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

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 21:10:56 PDT 2024


https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/93765

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


>From 49a12b8e6c169fb603ebdcc9b40d5cc87e20a15e Mon Sep 17 00:00:00 2001
From: Wang Pengcheng <wangpengcheng.pp at bytedance.com>
Date: Thu, 30 May 2024 12:09:30 +0800
Subject: [PATCH] [RISCV] Remove getOffsetOfLocalArea()

For RISC-V, it's always 0 and I don't see any reason we will
change it in the future.
---
 llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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));
   }



More information about the llvm-commits mailing list