Index: lib/CodeGen/MIRParser/MIParser.cpp =================================================================== --- lib/CodeGen/MIRParser/MIParser.cpp +++ lib/CodeGen/MIRParser/MIParser.cpp @@ -1373,8 +1373,12 @@ auto Loc = Token.location(); lex(); - if (Token.isNot(MIToken::IntegerLiteral)) - return error("expected an integer literal"); + if (Token.isNot(MIToken::IntegerLiteral)) { + if (Token.isNot(MIToken::Identifier) || + !(Token.range().startswith("true") || + Token.range().startswith("false"))) + return error("expected an integer literal"); + } const Constant *C = nullptr; if (parseIRConstant(Loc, C)) return true; Index: test/CodeGen/MIR/Generic/parse-integer-true-false.mir =================================================================== --- /dev/null +++ test/CodeGen/MIR/Generic/parse-integer-true-false.mir @@ -0,0 +1,11 @@ +# RUN: llc -run-pass none -o - %s | FileCheck %s +# Parse an i1 being a 'true' or 'false' +--- +name: i1_true_false +body: | + bb.0: + ; CHECK: %0:_(s1) = G_CONSTANT i1 true + ; CHECK: %1:_(s1) = G_CONSTANT i1 false + %0:_(s1) = G_CONSTANT i1 true + %1:_(s1) = G_CONSTANT i1 false +...