Skip to content

Commit 8a5450d

Browse files
XinWang10RKSimon
authored andcommitted
Fix regression after D150436
llvm-clang-x86_64-expensive-checks-debian will fail after D150436 merged. The fail occurred in X86, I changed the sort rule in AsmMatcher in Patch D150436, so x86 code will arrive line 633 first(will not affect other targets). The logic here want to use the order record written in source file to make AsmMatcher to first use AVX instructions, it used field HasPositionOrder. But the condition here just makes sure one of the compared record is subclass of Instruction and has field HasPositionOrder true, and didn't check another. (Committing on behalf of @XinWang10 to unblock broken expensive-cjhecks builds) Differential Revision: https://reviews.llvm.org/D150651
1 parent d4a6e4c commit 8a5450d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/utils/TableGen/AsmMatcherEmitter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ struct MatchableInfo {
636636
// We use the ID to sort AVX instruction before AVX512 instruction in
637637
// matching table.
638638
if (TheDef->isSubClassOf("Instruction") &&
639-
TheDef->getValueAsBit("HasPositionOrder"))
639+
TheDef->getValueAsBit("HasPositionOrder") &&
640+
RHS.TheDef->isSubClassOf("Instruction") &&
641+
RHS.TheDef->getValueAsBit("HasPositionOrder"))
640642
return TheDef->getID() < RHS.TheDef->getID();
641643

642644
// Give matches that require more features higher precedence. This is useful

0 commit comments

Comments
 (0)