[llvm] 8a5450d - Fix regression after D150436

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 05:05:22 PDT 2023


Author: Wang, Xin10
Date: 2023-05-16T13:04:44+01:00
New Revision: 8a5450d322c0748d3ee35d66d0d85046b5172538

URL: https://github.com/llvm/llvm-project/commit/8a5450d322c0748d3ee35d66d0d85046b5172538
DIFF: https://github.com/llvm/llvm-project/commit/8a5450d322c0748d3ee35d66d0d85046b5172538.diff

LOG: 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

Added: 
    

Modified: 
    llvm/utils/TableGen/AsmMatcherEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index e9e2571693f70..f6ef5ee1f9602 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -636,7 +636,9 @@ struct MatchableInfo {
     // We use the ID to sort AVX instruction before AVX512 instruction in
     // matching table.
     if (TheDef->isSubClassOf("Instruction") &&
-        TheDef->getValueAsBit("HasPositionOrder"))
+        TheDef->getValueAsBit("HasPositionOrder") &&
+        RHS.TheDef->isSubClassOf("Instruction") &&
+        RHS.TheDef->getValueAsBit("HasPositionOrder"))
       return TheDef->getID() < RHS.TheDef->getID();
 
     // Give matches that require more features higher precedence. This is useful


        


More information about the llvm-commits mailing list