Skip to content

Commit ffd0b31

Browse files
committed
Revert "[ARM] Register pressure with -mthumb forces register reload before each call"
Expensive checks are failing, complaining about additional MMO operands added to the branch.
1 parent f819dbf commit ffd0b31

File tree

4 files changed

+0
-77
lines changed

4 files changed

+0
-77
lines changed

llvm/lib/Target/ARM/Thumb1InstrInfo.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -152,37 +152,3 @@ bool Thumb1InstrInfo::canCopyGluedNodeDuringSchedule(SDNode *N) const {
152152

153153
return false;
154154
}
155-
156-
MachineInstr *Thumb1InstrInfo::foldMemoryOperandImpl(
157-
MachineFunction &MF, MachineInstr &MI, ArrayRef<unsigned> Ops,
158-
MachineBasicBlock::iterator InsertPt, MachineInstr &LoadMI,
159-
LiveIntervals *LIS) const {
160-
// Replace:
161-
// ldr Rd, func address
162-
// blx Rd
163-
// with:
164-
// bl func
165-
166-
if (MI.getOpcode() == ARM::tBLXr && LoadMI.getOpcode() == ARM::tLDRpci &&
167-
MI.getParent() == LoadMI.getParent()) {
168-
unsigned CPI = LoadMI.getOperand(1).getIndex();
169-
const MachineConstantPool *MCP = MF.getConstantPool();
170-
if (CPI >= MCP->getConstants().size())
171-
return nullptr;
172-
const MachineConstantPoolEntry &CPE = MCP->getConstants()[CPI];
173-
assert(!CPE.isMachineConstantPoolEntry() && "Invalid constpool entry");
174-
const Function *Callee = dyn_cast<Function>(CPE.Val.ConstVal);
175-
if (!Callee)
176-
return nullptr;
177-
const char *FuncName = MF.createExternalSymbolName(Callee->getName());
178-
MachineInstrBuilder MIB =
179-
BuildMI(*MI.getParent(), InsertPt, MI.getDebugLoc(), get(ARM::tBL))
180-
.add(predOps(ARMCC::AL))
181-
.addExternalSymbol(FuncName);
182-
for (auto &MO : MI.implicit_operands())
183-
MIB.add(MO);
184-
return MIB.getInstr();
185-
}
186-
187-
return nullptr;
188-
}

llvm/lib/Target/ARM/Thumb1InstrInfo.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ class Thumb1InstrInfo : public ARMBaseInstrInfo {
5353
const TargetRegisterInfo *TRI) const override;
5454

5555
bool canCopyGluedNodeDuringSchedule(SDNode *N) const override;
56-
57-
protected:
58-
virtual MachineInstr *foldMemoryOperandImpl(
59-
MachineFunction &MF, MachineInstr &MI, ArrayRef<unsigned> Ops,
60-
MachineBasicBlock::iterator InsertPt, MachineInstr &LoadMI,
61-
LiveIntervals *LIS = nullptr) const override;
62-
6356
private:
6457
void expandLoadStackGuard(MachineBasicBlock::iterator MI) const override;
6558
};

llvm/test/CodeGen/ARM/minsize-call-cse-2.ll

Lines changed: 0 additions & 20 deletions
This file was deleted.

llvm/test/CodeGen/ARM/minsize-call-cse-3.ll

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)