Skip to content

Commit 6c7134b

Browse files
authored
[RISCV] Don't create MachineMemOperand in foldMemoryOperandImpl. (#109840)
The caller already does this after we return. I think it will overwrite any MMO we add. I'm the original author of this code and I'm not sure why I did it.
1 parent 98260a1 commit 6c7134b

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,6 @@ MachineInstr *RISCVInstrInfo::foldMemoryOperandImpl(
736736
MachineFunction &MF, MachineInstr &MI, ArrayRef<unsigned> Ops,
737737
MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS,
738738
VirtRegMap *VRM) const {
739-
const MachineFrameInfo &MFI = MF.getFrameInfo();
740-
741739
// The below optimizations narrow the load so they are only valid for little
742740
// endian.
743741
// TODO: Support big endian by adding an offset into the frame object?
@@ -776,17 +774,11 @@ MachineInstr *RISCVInstrInfo::foldMemoryOperandImpl(
776774
break;
777775
}
778776

779-
MachineMemOperand *MMO = MF.getMachineMemOperand(
780-
MachinePointerInfo::getFixedStack(MF, FrameIndex),
781-
MachineMemOperand::MOLoad, MFI.getObjectSize(FrameIndex),
782-
MFI.getObjectAlign(FrameIndex));
783-
784777
Register DstReg = MI.getOperand(0).getReg();
785778
return BuildMI(*MI.getParent(), InsertPt, MI.getDebugLoc(), get(LoadOpc),
786779
DstReg)
787780
.addFrameIndex(FrameIndex)
788-
.addImm(0)
789-
.addMemOperand(MMO);
781+
.addImm(0);
790782
}
791783

792784
void RISCVInstrInfo::movImm(MachineBasicBlock &MBB,

0 commit comments

Comments
 (0)