mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-25 16:31:33 +00:00
[mips] Implement llvm.trap intrinsic.
Patch by Sasa Stankovic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187244 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
407883b69b
commit
9758562aa7
@ -385,6 +385,8 @@ MipsTargetLowering(MipsTargetMachine &TM)
|
||||
setTruncStoreAction(MVT::i64, MVT::i32, Custom);
|
||||
}
|
||||
|
||||
setOperationAction(ISD::TRAP, MVT::Other, Legal);
|
||||
|
||||
setTargetDAGCombine(ISD::SDIVREM);
|
||||
setTargetDAGCombine(ISD::UDIVREM);
|
||||
setTargetDAGCombine(ISD::SELECT);
|
||||
|
@ -826,6 +826,11 @@ class SCBase<string opstr, RegisterOperand RO, Operand Mem> :
|
||||
class MFC3OP<dag outs, dag ins, string asmstr> :
|
||||
InstSE<outs, ins, asmstr, [], NoItinerary, FrmFR>;
|
||||
|
||||
let isBarrier = 1, isTerminator = 1, isCodeGenOnly = 1 in
|
||||
def TRAP : InstSE<(outs), (ins), "break", [(trap)], NoItinerary, FrmOther> {
|
||||
let Inst = 0x0000000d;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Pseudo instructions
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
11
test/CodeGen/Mips/trap.ll
Normal file
11
test/CodeGen/Mips/trap.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llc -march=mipsel -mcpu=mips32 < %s | FileCheck %s
|
||||
|
||||
declare void @llvm.trap()
|
||||
|
||||
define void @f1() {
|
||||
entry:
|
||||
call void @llvm.trap()
|
||||
unreachable
|
||||
|
||||
; CHECK: break
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user