From: Chris Lattner Date: Thu, 1 Feb 2007 00:39:08 +0000 (+0000) Subject: Fix CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9aa2895360bd3951fc4f204d8699b84fd9ea6ba5;p=oota-llvm.git 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 --- diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index efd6d10c336..c3ae5c8bbf0 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -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; } diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp index 4324b9d598e..fb80350c557 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -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();