aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2021-05-19 22:25:51 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2021-06-30 16:54:13 -0400
commitfae05692a36f9ebbd201d93c2a6b0f927564d7e6 (patch)
tree8ed727683b9110ddc286fcb0dc8483ef2aa71bf3 /llvm/lib/CodeGen/MachineOperand.cpp
parent578a4cfe19121df5e5e02bf03482233e3bc56a0d (diff)
downloadllvm-fae05692a36f9ebbd201d93c2a6b0f927564d7e6.zip
llvm-fae05692a36f9ebbd201d93c2a6b0f927564d7e6.tar.gz
llvm-fae05692a36f9ebbd201d93c2a6b0f927564d7e6.tar.bz2
CodeGen: Print/parse LLTs in MachineMemOperands
This will currently accept the old number of bytes syntax, and convert it to a scalar. This should be removed in the near future (I think I converted all of the tests already, but likely missed a few). Not sure what the exact syntax and policy should be. We can continue printing the number of bytes for non-generic instructions to avoid test churn and only allow non-scalar types for generic instructions. This will currently print the LLT in parentheses, but accept parsing the existing integers and implicitly converting to scalar. The parentheses are a bit ugly, but the parser logic seems unable to deal without either parentheses or some keyword to indicate the start of a type.
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index b020c42..db973bd 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -1121,10 +1121,10 @@ void MachineMemOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
if (getFailureOrdering() != AtomicOrdering::NotAtomic)
OS << toIRString(getFailureOrdering()) << ' ';
- if (getSize() == MemoryLocation::UnknownSize)
- OS << "unknown-size";
+ if (getMemoryType().isValid())
+ OS << '(' << getMemoryType() << ')';
else
- OS << getSize();
+ OS << "unknown-size";
if (const Value *Val = getValue()) {
OS << ((isLoad() && isStore()) ? " on " : isLoad() ? " from " : " into ");