[llvm] r339365 - [Hexagon] Map ISD::TRAP to J2_trap0(#0)
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 9 11:03:45 PDT 2018
Author: kparzysz
Date: Thu Aug 9 11:03:45 2018
New Revision: 339365
URL: http://llvm.org/viewvc/llvm-project?rev=339365&view=rev
Log:
[Hexagon] Map ISD::TRAP to J2_trap0(#0)
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonDepInstrInfo.td
llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp
llvm/trunk/lib/Target/Hexagon/HexagonPatterns.td
llvm/trunk/test/CodeGen/Hexagon/trap-unreachable.ll
Modified: llvm/trunk/lib/Target/Hexagon/HexagonDepInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonDepInstrInfo.td?rev=339365&r1=339364&r2=339365&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonDepInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonDepInstrInfo.td Thu Aug 9 11:03:45 2018
@@ -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),
Modified: llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp?rev=339365&r1=339364&r2=339365&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp Thu Aug 9 11:03:45 2018
@@ -1274,21 +1274,21 @@ HexagonTargetLowering::HexagonTargetLowe
// 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);
Modified: llvm/trunk/lib/Target/Hexagon/HexagonPatterns.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonPatterns.td?rev=339365&r1=339364&r2=339365&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonPatterns.td (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonPatterns.td Thu Aug 9 11:03:45 2018
@@ -2987,6 +2987,8 @@ def: Pat<(HexagonALLOCA I32:$Rs, (i32 im
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,
Modified: llvm/trunk/test/CodeGen/Hexagon/trap-unreachable.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Hexagon/trap-unreachable.ll?rev=339365&r1=339364&r2=339365&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Hexagon/trap-unreachable.ll (original)
+++ llvm/trunk/test/CodeGen/Hexagon/trap-unreachable.ll Thu Aug 9 11:03:45 2018
@@ -1,5 +1,5 @@
; RUN: llc -march=hexagon -trap-unreachable < %s | FileCheck %s
-; CHECK: call abort
+; CHECK: trap
define void @fred() #0 {
unreachable
More information about the llvm-commits
mailing list