File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 2626#include " llvm/CodeGen/TargetSubtargetInfo.h"
2727#include " llvm/IR/DebugInfoMetadata.h"
2828#include " llvm/IR/DebugLoc.h"
29+ #include " llvm/MC/MCInstBuilder.h"
2930#include " llvm/MC/MCInstrDesc.h"
3031#include " llvm/Target/TargetMachine.h"
3132#include < cassert>
@@ -53,6 +54,13 @@ bool MipsInstrInfo::isZeroImm(const MachineOperand &op) const {
5354 return op.isImm () && op.getImm () == 0 ;
5455}
5556
57+ MCInst MipsInstrInfo::getNop () const {
58+ return MCInstBuilder (Mips::SLL)
59+ .addReg (Mips::ZERO)
60+ .addReg (Mips::ZERO)
61+ .addImm (0 );
62+ }
63+
5664// / insertNoop - If data hazard condition is found insert the target nop
5765// / instruction.
5866void MipsInstrInfo::
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ class MipsInstrInfo : public MipsGenInstrInfo {
5757
5858 explicit MipsInstrInfo (const MipsSubtarget &STI, unsigned UncondBrOpc);
5959
60+ MCInst getNop () const override ;
61+
6062 static const MipsInstrInfo *create (MipsSubtarget &STI);
6163
6264 // / Branch Analysis
Original file line number Diff line number Diff line change 1+ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+ ; RUN: llc -mtriple=mipsel-windows-gnu < %s | FileCheck %s -check-prefix=MIPSEL
3+
4+ define void @unreachable () {
5+ ; MIPSEL-LABEL: unreachable:
6+ ; MIPSEL: # %bb.0: # %entry
7+ ; MIPSEL-NEXT: .insn
8+ ; MIPSEL-NEXT: nop
9+
10+ entry:
11+ unreachable
12+ }
13+
You can’t perform that action at this time.
0 commit comments