[llvm] [SVE] Fix incorrect offset calculation when rewriting an instruction's frame index. (PR #70315)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 03:51:58 PDT 2023


https://github.com/paulwalker-arm created https://github.com/llvm/llvm-project/pull/70315

None

>From a32aba99630bea06f2f513e0383a8805a6af74f9 Mon Sep 17 00:00:00 2001
From: Paul Walker <paul.walker at arm.com>
Date: Thu, 26 Oct 2023 10:50:47 +0000
Subject: [PATCH] [SVE] Fix incorrect offset calculation when rewriting an
 instruction's frame index.

---
 llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index 7f1421549b1492e..e9b9f8013abeaf6 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -5657,7 +5657,7 @@ int llvm::isAArch64FrameOffsetLegal(const MachineInstr &MI,
     Offset = Remainder;
   else {
     NewOffset = NewOffset < 0 ? MinOff : MaxOff;
-    Offset = Offset - NewOffset * Scale + Remainder;
+    Offset = Offset - NewOffset * Scale;
   }
 
   if (EmittableOffset)



More information about the llvm-commits mailing list