diff options
author | Tim Renouf <tpr.llvm@botech.co.uk> | 2018-03-27 21:14:04 +0000 |
---|---|---|
committer | Tim Renouf <tpr.llvm@botech.co.uk> | 2018-03-27 21:14:04 +0000 |
commit | 4db0960420b748870117969041d50a7465d785c7 (patch) | |
tree | a1f9c7072a4633f909f30b4b0072c855ab0804f3 /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | 33dc01861aad4fb293d3290e4edd22ba829e51de (diff) | |
download | bcm5719-llvm-4db0960420b748870117969041d50a7465d785c7.tar.gz bcm5719-llvm-4db0960420b748870117969041d50a7465d785c7.zip |
[CodeGen] Fixed unreachable with -print-machineinstrs and custom pseudo source value
Summary:
Rev 327580 "[CodeGen] Use MIR syntax for MachineMemOperand printing"
broke -print-machineinstrs for us on AMDGPU, because we have custom
pseudo source values, and MIR serialization does not implement that.
This commit at least restores the functionality of -print-machineinstrs,
even if it does not properly implement the missing MIR serialization
functionality.
Differential Revision: https://reviews.llvm.org/D44871
Change-Id: I44961c0b90bf6d48c01484ed7a4e466fd300db66
llvm-svn: 328668
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineOperand.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp index 13bcc7a4fe4..654a831506d 100644 --- a/llvm/lib/CodeGen/MachineOperand.cpp +++ b/llvm/lib/CodeGen/MachineOperand.cpp @@ -1100,7 +1100,12 @@ void MachineMemOperand::print(raw_ostream &OS, ModuleSlotTracker &MST, OS, cast<ExternalSymbolPseudoSourceValue>(PVal)->getSymbol()); break; case PseudoSourceValue::TargetCustom: - llvm_unreachable("TargetCustom pseudo source values are not supported"); + // FIXME: This is not necessarily the correct MIR serialization format for + // a custom pseudo source value, but at least it allows + // -print-machineinstrs to work on a target with custom pseudo source + // values. + OS << "custom "; + PVal->printCustom(OS); break; } } |