OSDN Git Service

Print absolute memory references like this:
authorChris Lattner <sabre@nondot.org>
Tue, 21 Mar 2006 17:21:13 +0000 (17:21 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Mar 2006 17:21:13 +0000 (17:21 +0000)
       lwz r2, 8(0)
instead of this:
       lwz r2, 8(r0)

This fixes the llc/llc-beta failures on PPC last night.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26922 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCAsmPrinter.cpp

index 2b5ff59..9b33dd4 100644 (file)
@@ -194,7 +194,11 @@ namespace {
     void printMemRegImm(const MachineInstr *MI, unsigned OpNo) {
       printSymbolLo(MI, OpNo);
       O << '(';
-      printOperand(MI, OpNo+1);
+      if (MI->getOperand(OpNo+1).isRegister() && 
+          MI->getOperand(OpNo+1).getReg() == PPC::R0)
+        O << "0";
+      else
+        printOperand(MI, OpNo+1);
       O << ')';
     }
     void printMemRegReg(const MachineInstr *MI, unsigned OpNo) {