[llvm] r197288 - Print the address space of a MachineMemOperand

Matt Arsenault Matthew.Arsenault at amd.com
Fri Dec 13 16:24:02 PST 2013


Author: arsenm
Date: Fri Dec 13 18:24:02 2013
New Revision: 197288

URL: http://llvm.org/viewvc/llvm-project?rev=197288&view=rev
Log:
Print the address space of a MachineMemOperand

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h?rev=197288&r1=197287&r2=197288&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h Fri Dec 13 18:24:02 2013
@@ -134,6 +134,8 @@ public:
   /// number.
   int64_t getOffset() const { return PtrInfo.Offset; }
 
+  unsigned getAddrSpace() const { return PtrInfo.getAddrSpace(); }
+
   /// getSize - Return the size in bytes of the memory reference.
   uint64_t getSize() const { return Size; }
 

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=197288&r1=197287&r2=197288&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Fri Dec 13 18:24:02 2013
@@ -481,6 +481,10 @@ raw_ostream &llvm::operator<<(raw_ostrea
   else
     WriteAsOperand(OS, MMO.getValue(), /*PrintType=*/false);
 
+  unsigned AS = MMO.getAddrSpace();
+  if (AS != 0)
+    OS << "(addrspace=" << AS << ')';
+
   // If the alignment of the memory reference itself differs from the alignment
   // of the base pointer, print the base alignment explicitly, next to the base
   // pointer.





More information about the llvm-commits mailing list