1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[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 78b7018813
commit 429405cf52

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