Skip to content

Commit 5d2c198

Browse files
author
Martien de Jong
committed
[AIE] Use ConflictBits in bundle conflict test
1 parent 95badb3 commit 5d2c198

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

llvm/lib/Target/AIE/AIEBundle.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,15 @@ template <class I> class Bundle {
9191
// Verify there is a format that can accommodate the new slots
9292
MCSlotKind Slot = FormatInterface->getSlotKind(InstOpCode);
9393
assert(Slot != MCSlotKind());
94-
SlotBits NewSlots = FormatInterface->getSlotInfo(Slot)->getSlotSet();
95-
return (OccupiedSlots & NewSlots) == 0 &&
96-
FormatInterface->getPacketFormats().getFormat(OccupiedSlots |
97-
NewSlots);
94+
95+
auto *SlotInfo = FormatInterface->getSlotInfo(Slot);
96+
// ConflictBits is a fast predictor of missing formats
97+
SlotBits ConflictBits = SlotInfo->getConflictSet();
98+
if (OccupiedSlots & ConflictBits) {
99+
return false;
100+
}
101+
SlotBits NewSlots = OccupiedSlots | SlotInfo->getSlotSet();
102+
return FormatInterface->getPacketFormats().getFormat(NewSlots);
98103
}
99104

100105
/// Add an instruction to the bundle

0 commit comments

Comments
 (0)