diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-08-09 18:03:45 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-08-09 18:03:45 +0000 |
commit | 75c2ca36387c662215d0545101d25e82cd0927dd (patch) | |
tree | dc6768755d49f2f81a583773b67933edac09c63a | |
parent | 5cd9c6bcd8a4307af588fd613c037281ee80761b (diff) | |
download | bcm5719-llvm-75c2ca36387c662215d0545101d25e82cd0927dd.tar.gz bcm5719-llvm-75c2ca36387c662215d0545101d25e82cd0927dd.zip |
[Hexagon] Map ISD::TRAP to J2_trap0(#0)
llvm-svn: 339365
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td | 3 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | 30 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonPatterns.td | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/Hexagon/trap-unreachable.ll | 2 |
4 files changed, 21 insertions, 16 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td b/llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td index b6824fa3310..5c9ed271cea 100644 --- a/llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td +++ b/llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td @@ -5667,6 +5667,7 @@ let Inst{1-0} = 0b00; let Inst{7-5} = 0b000; let Inst{13-13} = 0b0; let Inst{31-16} = 0b0101010000000000; +let hasSideEffects = 1; let isSolo = 1; } def J2_trap1 : HInst< @@ -5679,6 +5680,7 @@ let Inst{7-5} = 0b000; let Inst{13-13} = 0b0; let Inst{31-21} = 0b01010100100; let hasNewValue = 1; +let hasSideEffects = 1; let opNewValue = 0; let isSolo = 1; let Uses = [GOSP]; @@ -5692,6 +5694,7 @@ def J2_trap1_noregmap : HInst< tc_59a01ead, TypeMAPPING> { let isPseudo = 1; let isCodeGenOnly = 1; +let hasSideEffects = 1; } def J4_cmpeq_f_jumpnv_nt : HInst< (outs), diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 4c28b6dc4a8..7cab0c5fdeb 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -1274,21 +1274,21 @@ HexagonTargetLowering::HexagonTargetLowering(const TargetMachine &TM, // which default to "expand" for at least one type. // Misc operations. - setOperationAction(ISD::ConstantFP, MVT::f32, Legal); // Default: expand - setOperationAction(ISD::ConstantFP, MVT::f64, Legal); // Default: expand - - setOperationAction(ISD::ConstantPool, MVT::i32, Custom); - setOperationAction(ISD::JumpTable, MVT::i32, Custom); - setOperationAction(ISD::BUILD_PAIR, MVT::i64, Expand); - setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); - setOperationAction(ISD::INLINEASM, MVT::Other, Custom); - setOperationAction(ISD::PREFETCH, MVT::Other, Custom); - setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, Custom); - setOperationAction(ISD::INTRINSIC_VOID, MVT::Other, Custom); - setOperationAction(ISD::EH_RETURN, MVT::Other, Custom); - setOperationAction(ISD::GLOBAL_OFFSET_TABLE, MVT::i32, Custom); - setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom); - setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Custom); + setOperationAction(ISD::ConstantFP, MVT::f32, Legal); + setOperationAction(ISD::ConstantFP, MVT::f64, Legal); + setOperationAction(ISD::TRAP, MVT::Other, Legal); + setOperationAction(ISD::ConstantPool, MVT::i32, Custom); + setOperationAction(ISD::JumpTable, MVT::i32, Custom); + setOperationAction(ISD::BUILD_PAIR, MVT::i64, Expand); + setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); + setOperationAction(ISD::INLINEASM, MVT::Other, Custom); + setOperationAction(ISD::PREFETCH, MVT::Other, Custom); + setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, Custom); + setOperationAction(ISD::INTRINSIC_VOID, MVT::Other, Custom); + setOperationAction(ISD::EH_RETURN, MVT::Other, Custom); + setOperationAction(ISD::GLOBAL_OFFSET_TABLE, MVT::i32, Custom); + setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom); + setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Custom); // Custom legalize GlobalAddress nodes into CONST32. setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); diff --git a/llvm/lib/Target/Hexagon/HexagonPatterns.td b/llvm/lib/Target/Hexagon/HexagonPatterns.td index 198405d37b8..ef78ba11865 100644 --- a/llvm/lib/Target/Hexagon/HexagonPatterns.td +++ b/llvm/lib/Target/Hexagon/HexagonPatterns.td @@ -2987,6 +2987,8 @@ def: Pat<(HexagonALLOCA I32:$Rs, (i32 imm:$A)), def HexagonBARRIER: SDNode<"HexagonISD::BARRIER", SDTNone, [SDNPHasChain]>; def: Pat<(HexagonBARRIER), (Y2_barrier)>; +def: Pat<(trap), (J2_trap0 (i32 0))>; + // Read cycle counter. def SDTInt64Leaf: SDTypeProfile<1, 0, [SDTCisVT<0, i64>]>; def HexagonREADCYCLE: SDNode<"HexagonISD::READCYCLE", SDTInt64Leaf, diff --git a/llvm/test/CodeGen/Hexagon/trap-unreachable.ll b/llvm/test/CodeGen/Hexagon/trap-unreachable.ll index 9c47fb372c0..124b37a5c6c 100644 --- a/llvm/test/CodeGen/Hexagon/trap-unreachable.ll +++ b/llvm/test/CodeGen/Hexagon/trap-unreachable.ll @@ -1,5 +1,5 @@ ; RUN: llc -march=hexagon -trap-unreachable < %s | FileCheck %s -; CHECK: call abort +; CHECK: trap define void @fred() #0 { unreachable |