[Hexagon] Some compound opportunities missed in presence of branches

The lld testcase change from ddf1fb1f should take care of the build
breakage from before.
This commit is contained in:
Colin LeMahieu 2022-01-06 09:24:31 -08:00 committed by Krzysztof Parzyszek
parent ddf1fb1f13
commit e37b6a67f8
2 changed files with 14 additions and 1 deletions

View File

@ -365,8 +365,10 @@ static bool lookForCompound(MCInstrInfo const &MCII, MCContext &Context,
MCI.begin() + HexagonMCInstrInfo::bundleInstructionsOffset;
B != MCI.end(); ++B) {
MCInst const *Inst = B->getInst();
if (JumpInst == Inst)
if (JumpInst == Inst) {
BExtended = false;
continue;
}
if (HexagonMCInstrInfo::isImmext(*Inst)) {
BExtended = true;
continue;

View File

@ -0,0 +1,11 @@
# RUN: llvm-mc -arch=hexagon -filetype=obj -o - %s | llvm-objdump -d -
# r0 = r6 and jump ##undefined should compound to J4_jumpsetr
# CHECK: { immext(#0)
# CHECK: r0 = r6 ; jump 0x0
# CHECK: r1 = memub(r6+#21)
# CHECK: memw(r9+#0) = r0 }
{ memw(r9) = r0
r0 = r6
r1 = memub(r6+#21)
jump ##undefined }