[llvm] [SPARC] Set how many bytes load from or store to stack slot (PR #182674)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 22 03:11:16 PST 2026
================
@@ -47,15 +47,31 @@ SparcInstrInfo::SparcInstrInfo(const SparcSubtarget &ST)
/// not, return 0. This predicate must return 0 if the instruction has
/// any side effects other than loading from the stack slot.
Register SparcInstrInfo::isLoadFromStackSlot(const MachineInstr &MI,
- int &FrameIndex) const {
- if (MI.getOpcode() == SP::LDri || MI.getOpcode() == SP::LDXri ||
- MI.getOpcode() == SP::LDFri || MI.getOpcode() == SP::LDDFri ||
- MI.getOpcode() == SP::LDQFri) {
- if (MI.getOperand(1).isFI() && MI.getOperand(2).isImm() &&
- MI.getOperand(2).getImm() == 0) {
- FrameIndex = MI.getOperand(1).getIndex();
- return MI.getOperand(0).getReg();
- }
+ int &FrameIndex,
+ TypeSize &MemBytes) const {
+ switch (MI.getOpcode()) {
+ default:
+ return 0;
----------------
koachan wrote:
Just a question here, so no need to set MemBytes in this case?
https://github.com/llvm/llvm-project/pull/182674
More information about the llvm-commits
mailing list