Index: utils/TableGen/AsmMatcherEmitter.cpp =================================================================== --- utils/TableGen/AsmMatcherEmitter.cpp +++ utils/TableGen/AsmMatcherEmitter.cpp @@ -574,7 +574,7 @@ /// validate - Return true if this matchable is a valid thing to match against /// and perform a bunch of validity checking. - bool validate(StringRef CommentDelimiter, bool Hack) const; + bool validate(StringRef CommentDelimiter) const; /// findAsmOperand - Find the AsmOperand with the specified name and /// suboperand index. @@ -1080,7 +1080,7 @@ addAsmOperand(String.substr(Prev), IsIsolatedToken); } -bool MatchableInfo::validate(StringRef CommentDelimiter, bool Hack) const { +bool MatchableInfo::validate(StringRef CommentDelimiter) const { // Reject matchables with no .s string. if (AsmString.empty()) PrintFatalError(TheDef->getLoc(), "instruction with empty asm string"); @@ -1114,15 +1114,8 @@ "matchable with operand modifier '" + Tok + "' not supported by asm matcher. Mark isCodeGenOnly!"); - // Verify that any operand is only mentioned once. - // We reject aliases and ignore instructions for now. + // If an operand is mentioned more than once, issue a warning. if (Tok[0] == '$' && !OperandNames.insert(Tok).second) { - if (!Hack) - PrintFatalError(TheDef->getLoc(), - "ERROR: matchable with tied operand '" + Tok + - "' can never be matched!"); - // FIXME: Should reject these. The ARM backend hits this with $lane in a - // bunch of instructions. It is unclear what the right answer is. DEBUG({ errs() << "warning: '" << TheDef->getName() << "': " << "ignoring instruction with tied operand '" @@ -1556,7 +1549,7 @@ // Ignore instructions which shouldn't be matched and diagnose invalid // instruction definitions with an error. - if (!II->validate(CommentDelimiter, true)) + if (!II->validate(CommentDelimiter)) continue; Matchables.push_back(std::move(II)); @@ -1587,7 +1580,7 @@ II->initialize(*this, SingletonRegisters, Variant, HasMnemonicFirst); // Validate the alias definitions. - II->validate(CommentDelimiter, false); + II->validate(CommentDelimiter); Matchables.push_back(std::move(II)); }