summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorToma Tabacu <toma.tabacu@imgtec.com>2015-04-23 14:48:38 +0000
committerToma Tabacu <toma.tabacu@imgtec.com>2015-04-23 14:48:38 +0000
commit7fc89d2141c527840ff629a58fabfc4bb635c253 (patch)
tree5813d59de0ce56113e30db0644c4424587dd5cb3 /llvm/lib
parent0faa9136faaec5455f7d0039d4deb42debd0756a (diff)
downloadbcm5719-llvm-7fc89d2141c527840ff629a58fabfc4bb635c253.tar.gz
bcm5719-llvm-7fc89d2141c527840ff629a58fabfc4bb635c253.zip
[mips] [IAS] Move NOP emission after pseudo-instruction expansion. NFC.
As suggested in the review for http://reviews.llvm.org/D8537. llvm-svn: 235601
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 7615f87f721..88b131104ba 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -1383,14 +1383,6 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
}
}
- // If this instruction has a delay slot and .set reorder is active,
- // emit a NOP after it.
- if (MCID.hasDelaySlot() && AssemblerOptions.back()->isReorder()) {
- Instructions.push_back(Inst);
- createNop(hasShortDelaySlot(Inst.getOpcode()), IDLoc, Instructions);
- return false;
- }
-
if (MCID.mayLoad() || MCID.mayStore()) {
// Check the offset of memory operand, if it is a symbol
// reference or immediate we may have to expand instructions.
@@ -1580,11 +1572,17 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
}
}
- if (needsExpansion(Inst))
- return expandInstruction(Inst, IDLoc, Instructions);
- else
+ if (needsExpansion(Inst)) {
+ if (expandInstruction(Inst, IDLoc, Instructions))
+ return true;
+ } else
Instructions.push_back(Inst);
+ // If this instruction has a delay slot and .set reorder is active,
+ // emit a NOP after it.
+ if (MCID.hasDelaySlot() && AssemblerOptions.back()->isReorder())
+ createNop(hasShortDelaySlot(Inst.getOpcode()), IDLoc, Instructions);
+
return false;
}
OpenPOWER on IntegriCloud