MIR Serialization: Serialize the stack pseudo source values.

llvm-svn: 244806
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
index c94c398..8a6a1ff 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
@@ -201,6 +201,7 @@
       .Case("non-temporal", MIToken::kw_non_temporal)
       .Case("invariant", MIToken::kw_invariant)
       .Case("align", MIToken::kw_align)
+      .Case("stack", MIToken::kw_stack)
       .Case("constant-pool", MIToken::kw_constant_pool)
       .Case("liveout", MIToken::kw_liveout)
       .Default(MIToken::Identifier);
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h
index 75cf3f3..2c7a32c 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.h
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.h
@@ -70,6 +70,7 @@
     kw_non_temporal,
     kw_invariant,
     kw_align,
+    kw_stack,
     kw_constant_pool,
     kw_liveout,
 
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index afa6ffc..47a9eaf 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -1121,6 +1121,9 @@
 
 bool MIParser::parseMemoryPseudoSourceValue(const PseudoSourceValue *&PSV) {
   switch (Token.kind()) {
+  case MIToken::kw_stack:
+    PSV = MF.getPSVManager().getStack();
+    break;
   case MIToken::kw_constant_pool:
     PSV = MF.getPSVManager().getConstantPool();
     break;
@@ -1133,7 +1136,7 @@
 }
 
 bool MIParser::parseMachinePointerInfo(MachinePointerInfo &Dest) {
-  if (Token.is(MIToken::kw_constant_pool)) {
+  if (Token.is(MIToken::kw_constant_pool) || Token.is(MIToken::kw_stack)) {
     const PseudoSourceValue *PSV = nullptr;
     if (parseMemoryPseudoSourceValue(PSV))
       return true;
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index d47ed97..019383c 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -710,6 +710,9 @@
     const PseudoSourceValue *PVal = Op.getPseudoValue();
     assert(PVal && "Expected a pseudo source value");
     switch (PVal->kind()) {
+    case PseudoSourceValue::Stack:
+      OS << "stack";
+      break;
     case PseudoSourceValue::ConstantPool:
       OS << "constant-pool";
       break;