[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
This commit is contained in:
Wang, Pengfei 2021-04-22 17:26:36 +08:00
parent 46991ad266
commit aafb6d81cf
1 changed files with 2 additions and 7 deletions

View File

@ -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 @@ 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);
}
};