mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Add new shorter predicates for testing machine operands for various types:
e.g. MO.isMBB() instead of MO.isMachineBasicBlock(). I don't plan on switching everything over, so new clients should just start using the shorter names. Remove old long accessors, switching everything over to use the short accessor: getMachineBasicBlock() -> getMBB(), getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -74,7 +74,7 @@ isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const
|
||||
(MI->getOperand(1).isImmediate()) && // the imm is zero
|
||||
(isZeroImm(MI->getOperand(1))))
|
||||
{
|
||||
FrameIndex = MI->getOperand(2).getFrameIndex();
|
||||
FrameIndex = MI->getOperand(2).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const
|
||||
(MI->getOperand(1).isImmediate()) && // the imm is zero
|
||||
(isZeroImm(MI->getOperand(1))))
|
||||
{
|
||||
FrameIndex = MI->getOperand(0).getFrameIndex();
|
||||
FrameIndex = MI->getOperand(0).getIndex();
|
||||
return MI->getOperand(2).getReg();
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ bool MipsInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
|
||||
|
||||
// Unconditional branch
|
||||
if (LastOpc == Mips::J) {
|
||||
TBB = LastInst->getOperand(0).getMachineBasicBlock();
|
||||
TBB = LastInst->getOperand(0).getMBB();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ bool MipsInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
|
||||
if (LastOpc != Mips::COND_INVALID) {
|
||||
int LastNumOp = LastInst->getNumOperands();
|
||||
|
||||
TBB = LastInst->getOperand(LastNumOp-1).getMachineBasicBlock();
|
||||
TBB = LastInst->getOperand(LastNumOp-1).getMBB();
|
||||
Cond.push_back(MachineOperand::CreateImm(BranchCode));
|
||||
|
||||
for (int i=0; i<LastNumOp-1; i++) {
|
||||
@@ -218,21 +218,21 @@ bool MipsInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
|
||||
if (SecondLastOpc != Mips::COND_INVALID && LastOpc == Mips::J) {
|
||||
int SecondNumOp = SecondLastInst->getNumOperands();
|
||||
|
||||
TBB = SecondLastInst->getOperand(SecondNumOp-1).getMachineBasicBlock();
|
||||
TBB = SecondLastInst->getOperand(SecondNumOp-1).getMBB();
|
||||
Cond.push_back(MachineOperand::CreateImm(BranchCode));
|
||||
|
||||
for (int i=0; i<SecondNumOp-1; i++) {
|
||||
Cond.push_back(SecondLastInst->getOperand(i));
|
||||
}
|
||||
|
||||
FBB = LastInst->getOperand(0).getMachineBasicBlock();
|
||||
FBB = LastInst->getOperand(0).getMBB();
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the block ends with two unconditional branches, handle it. The last
|
||||
// one is not executed, so remove it.
|
||||
if ((SecondLastOpc == Mips::J) && (LastOpc == Mips::J)) {
|
||||
TBB = SecondLastInst->getOperand(0).getMachineBasicBlock();
|
||||
TBB = SecondLastInst->getOperand(0).getMBB();
|
||||
I = LastInst;
|
||||
I->eraseFromParent();
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user