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

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 02:37:54 PDT 2021


pengfei created this revision.
pengfei added reviewers: LuoYuanke, yubing, xiangzhangllvm, wxiao3.
Herald added a subscriber: hiraditya.
pengfei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101039

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


Index: llvm/lib/Target/X86/X86PreTileConfig.cpp
===================================================================
--- llvm/lib/Target/X86/X86PreTileConfig.cpp
+++ 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 different BBs");
 #define REPORT_CONFIG_FAIL                                                     \
   report_fatal_error(                                                          \
       MF.getName() +                                                           \
@@ -70,12 +67,10 @@
     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);
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101039.339537.patch
Type: text/x-patch
Size: 1165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210422/74856d24/attachment.bin>


More information about the llvm-commits mailing list