Skip to content

Commit 151e244

Browse files
committed
[X86][AMX][NFC] Make comparison operators to be complete
The previous D101039 didn't fix the SmallSet insertion issue, due to we always return false for the comparison between 2 different nonnull BBs. This patch makes the the comparison to be complete by comparing `MBB` first, so that we can always get the invariant order by a single operator.
1 parent 6914a0e commit 151e244

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/X86/X86PreTileConfig.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ struct MIRef {
7171
}
7272
bool operator!=(const MIRef &RHS) const { return !(*this == RHS); }
7373
bool operator<(const MIRef &RHS) const {
74-
return (!MBB && RHS.MBB) || (MBB == RHS.MBB && Pos < RHS.Pos);
74+
return MBB < RHS.MBB || (MBB == RHS.MBB && Pos < RHS.Pos);
7575
}
7676
bool operator>(const MIRef &RHS) const {
77-
return (!RHS.MBB && MBB) || (MBB == RHS.MBB && Pos > RHS.Pos);
77+
return MBB > RHS.MBB || (MBB == RHS.MBB && Pos > RHS.Pos);
7878
}
7979
};
8080

0 commit comments

Comments
 (0)