[PATCH] D44871: [CodeGen] Fixed unreachable with -print-machineinstrs and custom pseudo source value

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 24 10:41:30 PDT 2018


tpr created this revision.
Herald added a subscriber: llvm-commits.

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.

Change-Id: I44961c0b90bf6d48c01484ed7a4e466fd300db66


Repository:
  rL LLVM

https://reviews.llvm.org/D44871

Files:
  lib/CodeGen/MachineOperand.cpp


Index: lib/CodeGen/MachineOperand.cpp
===================================================================
--- lib/CodeGen/MachineOperand.cpp
+++ lib/CodeGen/MachineOperand.cpp
@@ -1100,7 +1100,12 @@
           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;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44871.139721.patch
Type: text/x-patch
Size: 730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180324/ea4fcf31/attachment.bin>


More information about the llvm-commits mailing list