Fix CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33732 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-02-01 00:39:08 +00:00
parent 36a724341c
commit 9aa2895360
2 changed files with 7 additions and 1 deletions

View File

@ -436,7 +436,10 @@ bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
const char *ExtraCode) {
if (ExtraCode && ExtraCode[0])
return true; // Unknown modifier.
printMemRegReg(MI, OpNo);
if (MI->getOperand(OpNo).isRegister())
printMemRegReg(MI, OpNo);
else
printMemRegImm(MI, OpNo);
return false;
}

View File

@ -522,6 +522,9 @@ PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const {
}
// Take into account whether it's an add or mem instruction
unsigned OffIdx = (i == 2) ? 1 : 2;
if (MI.getOpcode() == TargetInstrInfo::INLINEASM)
OffIdx = i-1;
// Get the frame index.
int FrameIndex = MI.getOperand(i).getFrameIndex();