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 26
26
#include " llvm/CodeGen/TargetSubtargetInfo.h"
27
27
#include " llvm/IR/DebugInfoMetadata.h"
28
28
#include " llvm/IR/DebugLoc.h"
29
+ #include " llvm/MC/MCInstBuilder.h"
29
30
#include " llvm/MC/MCInstrDesc.h"
30
31
#include " llvm/Target/TargetMachine.h"
31
32
#include < cassert>
@@ -53,6 +54,13 @@ bool MipsInstrInfo::isZeroImm(const MachineOperand &op) const {
53
54
return op.isImm () && op.getImm () == 0 ;
54
55
}
55
56
57
+ MCInst MipsInstrInfo::getNop () const {
58
+ return MCInstBuilder (Mips::SLL)
59
+ .addReg (Mips::ZERO)
60
+ .addReg (Mips::ZERO)
61
+ .addImm (0 );
62
+ }
63
+
56
64
// / insertNoop - If data hazard condition is found insert the target nop
57
65
// / instruction.
58
66
void MipsInstrInfo::
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ class MipsInstrInfo : public MipsGenInstrInfo {
57
57
58
58
explicit MipsInstrInfo (const MipsSubtarget &STI, unsigned UncondBrOpc);
59
59
60
+ MCInst getNop () const override ;
61
+
60
62
static const MipsInstrInfo *create (MipsSubtarget &STI);
61
63
62
64
// / 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