aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2021-03-02 14:59:06 -0800
committerDaniel Sanders <daniel_l_sanders@apple.com>2021-03-04 10:34:30 -0800
commit9fc2be6f289e25a94f4b938f8199f5d470f8a43e (patch)
treea8158bd755fc671c8ea2fe9eee999a3b73a00ee5 /llvm/lib/CodeGen/MachineOperand.cpp
parent36192790d84ba1c9a814df4024967685b0dc27c5 (diff)
downloadllvm-9fc2be6f289e25a94f4b938f8199f5d470f8a43e.zip
llvm-9fc2be6f289e25a94f4b938f8199f5d470f8a43e.tar.gz
llvm-9fc2be6f289e25a94f4b938f8199f5d470f8a43e.tar.bz2
[mir] Fix confusing MIR when MMO's value is nullptr but offset is non-zero
:: (store 1 + 4, addrspace 1) -> :: (store 1 into undef + 4, addrspace 1) An offset without a base isn't terribly useful but it's convenient to update the offset without checking the value. For example, when breaking apart stores into smaller units Differential Revision: https://reviews.llvm.org/D97812
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index 9b09f52..be27b6f 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -1160,6 +1160,11 @@ void MachineMemOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
break;
}
}
+ } else if (getOpaqueValue() == nullptr && getOffset() != 0) {
+ OS << ((isLoad() && isStore()) ? " on "
+ : isLoad() ? " from "
+ : " into ")
+ << "undef";
}
MachineOperand::printOperandOffset(OS, getOffset());
if (getAlign() != getSize())