forked from OSchip/llvm-project
[Hexagon] Apply tiny core packet size slots limit
This commit is contained in:
parent
a247360173
commit
1f71e46f2a
|
@ -378,18 +378,8 @@ bool HexagonMCChecker::checkCOFMax1() {
|
|||
}
|
||||
|
||||
bool HexagonMCChecker::checkSlots() {
|
||||
unsigned slotsUsed = 0;
|
||||
for (auto HMI : HexagonMCInstrInfo::bundleInstructions(MCB)) {
|
||||
MCInst const &MCI = *HMI.getInst();
|
||||
if (HexagonMCInstrInfo::isImmext(MCI))
|
||||
continue;
|
||||
if (HexagonMCInstrInfo::isDuplex(MCII, MCI))
|
||||
slotsUsed += 2;
|
||||
else
|
||||
++slotsUsed;
|
||||
}
|
||||
|
||||
if (slotsUsed > HEXAGON_PACKET_SIZE) {
|
||||
if (HexagonMCInstrInfo::slotsConsumed(MCII, STI, MCB) >
|
||||
HexagonMCInstrInfo::packetSizeSlots(STI)) {
|
||||
reportError("invalid instruction packet: out of slots");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -326,8 +326,7 @@ unsigned packetSizeSlots(MCSubtargetInfo const &STI);
|
|||
unsigned slotsConsumed(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
|
||||
MCInst const &MCI);
|
||||
|
||||
|
||||
// Pad the bundle with nops to satisfy endloop requirements
|
||||
// Pad the bundle with nops to satisfy endloop requirements.
|
||||
void padEndloop(MCInst &MCI, MCContext &Context);
|
||||
class PredicateInfo {
|
||||
public:
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# RUN: not llvm-mc -arch=hexagon -filetype=asm %s 2>%t; FileCheck %s < %t
|
||||
|
||||
.L_:
|
||||
{
|
||||
loop0(.L_,r2);
|
||||
r7=r1;
|
||||
r5=mpyi(r1,#64);
|
||||
r6=#0;
|
||||
nop;
|
||||
}
|
||||
# CHECK: rror: invalid instruction packet: out of slots
|
Loading…
Reference in New Issue