Skip to content

Commit 7fc89d2

Browse files
author
Toma Tabacu
committed
[mips] [IAS] Move NOP emission after pseudo-instruction expansion. NFC.
As suggested in the review for http://reviews.llvm.org/D8537. llvm-svn: 235601
1 parent 0faa913 commit 7fc89d2

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,14 +1383,6 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
13831383
}
13841384
}
13851385

1386-
// If this instruction has a delay slot and .set reorder is active,
1387-
// emit a NOP after it.
1388-
if (MCID.hasDelaySlot() && AssemblerOptions.back()->isReorder()) {
1389-
Instructions.push_back(Inst);
1390-
createNop(hasShortDelaySlot(Inst.getOpcode()), IDLoc, Instructions);
1391-
return false;
1392-
}
1393-
13941386
if (MCID.mayLoad() || MCID.mayStore()) {
13951387
// Check the offset of memory operand, if it is a symbol
13961388
// reference or immediate we may have to expand instructions.
@@ -1580,11 +1572,17 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
15801572
}
15811573
}
15821574

1583-
if (needsExpansion(Inst))
1584-
return expandInstruction(Inst, IDLoc, Instructions);
1585-
else
1575+
if (needsExpansion(Inst)) {
1576+
if (expandInstruction(Inst, IDLoc, Instructions))
1577+
return true;
1578+
} else
15861579
Instructions.push_back(Inst);
15871580

1581+
// If this instruction has a delay slot and .set reorder is active,
1582+
// emit a NOP after it.
1583+
if (MCID.hasDelaySlot() && AssemblerOptions.back()->isReorder())
1584+
createNop(hasShortDelaySlot(Inst.getOpcode()), IDLoc, Instructions);
1585+
15881586
return false;
15891587
}
15901588

0 commit comments

Comments
 (0)