[PATCH] D150599: [ARC] Use backwards scavenging in frame index elimination
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 08:57:34 PDT 2023
foad updated this revision to Diff 522647.
foad added a comment.
Switch to scavengeRegisterBackwards.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150599/new/
https://reviews.llvm.org/D150599
Files:
llvm/lib/Target/ARC/ARCRegisterInfo.cpp
llvm/lib/Target/ARC/ARCRegisterInfo.h
Index: llvm/lib/Target/ARC/ARCRegisterInfo.h
===================================================================
--- llvm/lib/Target/ARC/ARCRegisterInfo.h
+++ llvm/lib/Target/ARC/ARCRegisterInfo.h
@@ -39,6 +39,8 @@
bool useFPForScavengingIndex(const MachineFunction &MF) const override;
+ bool supportsBackwardScavenger() const override { return true; }
+
bool eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
unsigned FIOperandNum,
RegScavenger *RS = nullptr) const override;
Index: llvm/lib/Target/ARC/ARCRegisterInfo.cpp
===================================================================
--- llvm/lib/Target/ARC/ARCRegisterInfo.cpp
+++ llvm/lib/Target/ARC/ARCRegisterInfo.cpp
@@ -63,7 +63,8 @@
// of the load offset.
const TargetRegisterInfo *TRI =
MBB.getParent()->getSubtarget().getRegisterInfo();
- BaseReg = RS->scavengeRegister(&ARC::GPR32RegClass, II, SPAdj);
+ BaseReg =
+ RS->scavengeRegisterBackwards(ARC::GPR32RegClass, II, false, SPAdj);
assert(BaseReg && "Register scavenging failed.");
LLVM_DEBUG(dbgs() << "Scavenged register " << printReg(BaseReg, TRI)
<< " for FrameReg=" << printReg(FrameReg, TRI)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150599.522647.patch
Type: text/x-patch
Size: 1283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230516/effe63e5/attachment.bin>
More information about the llvm-commits
mailing list