[llvm] aafb6d8 - [X86][AMX][NFC] Remove assert for comparison between different BBs.

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 05:42:09 PDT 2021


Author: Wang, Pengfei
Date: 2021-04-22T20:41:59+08:00
New Revision: aafb6d81cf255f709359759dbe2a78352fa0e159

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

LOG: [X86][AMX][NFC] Remove assert for comparison between different BBs.

SmallSet may use operator `<` when we insert MIRef elements, so we
cannot limit the comparison between different BBs.

We allow MIRef() to be less that any initialized MIRef object, otherwise,
we always reture false when compare between different BBs.

Differential Revision: https://reviews.llvm.org/D101039

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86PreTileConfig.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86PreTileConfig.cpp b/llvm/lib/Target/X86/X86PreTileConfig.cpp
index cff0eb0347f21..0ffd43fbe80ae 100644
--- a/llvm/lib/Target/X86/X86PreTileConfig.cpp
+++ b/llvm/lib/Target/X86/X86PreTileConfig.cpp
@@ -39,9 +39,6 @@
 using namespace llvm;
 
 #define DEBUG_TYPE "tile-pre-config"
-#define ASSERT_VALID_COMPARE                                                   \
-  assert((!MBB || !RHS.MBB || MBB == RHS.MBB) &&                               \
-         "Cannot compare between 
diff erent BBs");
 #define REPORT_CONFIG_FAIL                                                     \
   report_fatal_error(                                                          \
       MF.getName() +                                                           \
@@ -70,12 +67,10 @@ struct MIRef {
     return MI == RHS.MI && MBB == RHS.MBB;
   }
   bool operator<(const MIRef &RHS) const {
-    ASSERT_VALID_COMPARE;
-    return Pos < RHS.Pos;
+    return (!MBB && RHS.MBB) || (MBB == RHS.MBB && Pos < RHS.Pos);
   }
   bool operator>(const MIRef &RHS) const {
-    ASSERT_VALID_COMPARE;
-    return Pos > RHS.Pos;
+    return (!RHS.MBB && MBB) || (MBB == RHS.MBB && Pos > RHS.Pos);
   }
 };
 


        


More information about the llvm-commits mailing list