summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-12-14 00:24:02 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-12-14 00:24:02 +0000
commit9bd42e3fab0e67a475bf3d78bcaa65a531e9c729 (patch)
tree11ed96ee559cf1fb738ebab1178ac6760a8e4f45
parenta73959a988b118832b6c22e8c8dd312ac22a7c77 (diff)
downloadllvm-9bd42e3fab0e67a475bf3d78bcaa65a531e9c729.tar.gz
llvm-9bd42e3fab0e67a475bf3d78bcaa65a531e9c729.tar.bz2
llvm-9bd42e3fab0e67a475bf3d78bcaa65a531e9c729.tar.xz
Print the address space of a MachineMemOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197288 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MachineMemOperand.h2
-rw-r--r--lib/CodeGen/MachineInstr.cpp4
2 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineMemOperand.h b/include/llvm/CodeGen/MachineMemOperand.h
index 00a55b57f3..f01b8ebca1 100644
--- a/include/llvm/CodeGen/MachineMemOperand.h
+++ b/include/llvm/CodeGen/MachineMemOperand.h
@@ -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; }
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 295b450a0f..8d89276e73 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -481,6 +481,10 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineMemOperand &MMO) {
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.