diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 7 |
2 files changed, 13 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index 8c7345111c5..41454dd9d66 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1778,14 +1778,16 @@ bool MIParser::parseMachineMemoryOperand(MachineMemOperand *&Dest) { return true; lex(); - const char *Word = Flags & MachineMemOperand::MOLoad ? "from" : "into"; - if (Token.isNot(MIToken::Identifier) || Token.stringValue() != Word) - return error(Twine("expected '") + Word + "'"); - lex(); - MachinePointerInfo Ptr = MachinePointerInfo(); - if (parseMachinePointerInfo(Ptr)) - return true; + if (Token.is(MIToken::Identifier)) { + const char *Word = Flags & MachineMemOperand::MOLoad ? "from" : "into"; + if (Token.stringValue() != Word) + return error(Twine("expected '") + Word + "'"); + lex(); + + if (parseMachinePointerInfo(Ptr)) + return true; + } unsigned BaseAlignment = Size; AAMDNodes AAInfo; MDNode *Range = nullptr; diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 95b58b7c0fe..703c99d9edd 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -883,11 +883,12 @@ void MIPrinter::print(const MachineMemOperand &Op) { assert(Op.isStore() && "Non load machine operand must be a store"); OS << "store "; } - OS << Op.getSize() << (Op.isLoad() ? " from " : " into "); + OS << Op.getSize(); if (const Value *Val = Op.getValue()) { + OS << (Op.isLoad() ? " from " : " into "); printIRValueReference(*Val); - } else { - const PseudoSourceValue *PVal = Op.getPseudoValue(); + } else if (const PseudoSourceValue *PVal = Op.getPseudoValue()) { + OS << (Op.isLoad() ? " from " : " into "); assert(PVal && "Expected a pseudo source value"); switch (PVal->kind()) { case PseudoSourceValue::Stack: |