Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 413 Lines • ▼ Show 20 Lines | for (auto VT : { MVT::f32, MVT::f64, MVT::f80, MVT::f128 }) { | ||||
setOperationAction(ISD::SETCC, VT, Custom); | setOperationAction(ISD::SETCC, VT, Custom); | ||||
} | } | ||||
for (auto VT : { MVT::i8, MVT::i16, MVT::i32, MVT::i64 }) { | for (auto VT : { MVT::i8, MVT::i16, MVT::i32, MVT::i64 }) { | ||||
if (VT == MVT::i64 && !Subtarget.is64Bit()) | if (VT == MVT::i64 && !Subtarget.is64Bit()) | ||||
continue; | continue; | ||||
setOperationAction(ISD::SELECT, VT, Custom); | setOperationAction(ISD::SELECT, VT, Custom); | ||||
setOperationAction(ISD::SETCC, VT, Custom); | setOperationAction(ISD::SETCC, VT, Custom); | ||||
} | } | ||||
// Custom action for SELECT MMX and expand action for SELECT_CC MMX | |||||
setOperationAction(ISD::SELECT, MVT::x86mmx, Custom); | |||||
setOperationAction(ISD::SELECT_CC, MVT::x86mmx, Expand); | |||||
setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); | setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); | ||||
// NOTE: EH_SJLJ_SETJMP/_LONGJMP supported here is NOT intended to support | // NOTE: EH_SJLJ_SETJMP/_LONGJMP supported here is NOT intended to support | ||||
// SjLj exception handling but a light-weight setjmp/longjmp replacement to | // SjLj exception handling but a light-weight setjmp/longjmp replacement to | ||||
// support continuation, user-level threading, and etc.. As a result, no | // support continuation, user-level threading, and etc.. As a result, no | ||||
// other SjLj exception interfaces are implemented and please don't build | // other SjLj exception interfaces are implemented and please don't build | ||||
// your own exception handling based on them. | // your own exception handling based on them. | ||||
// LLVM/Clang supports zero-cost DWARF exception handling. | // LLVM/Clang supports zero-cost DWARF exception handling. | ||||
setOperationAction(ISD::EH_SJLJ_SETJMP, MVT::i32, Custom); | setOperationAction(ISD::EH_SJLJ_SETJMP, MVT::i32, Custom); | ||||
▲ Show 20 Lines • Show All 30,196 Lines • ▼ Show 20 Lines | static SDValue combineSelect(SDNode *N, SelectionDAG &DAG, | ||||
if (N->getOpcode() == ISD::VSELECT && DCI.isAfterLegalizeVectorOps() && | if (N->getOpcode() == ISD::VSELECT && DCI.isAfterLegalizeVectorOps() && | ||||
CondVT.getVectorElementType() == MVT::i1) { | CondVT.getVectorElementType() == MVT::i1) { | ||||
if (combineBitcastForMaskedOp(LHS, DAG, DCI)) | if (combineBitcastForMaskedOp(LHS, DAG, DCI)) | ||||
return SDValue(N, 0); | return SDValue(N, 0); | ||||
if (combineBitcastForMaskedOp(RHS, DAG, DCI)) | if (combineBitcastForMaskedOp(RHS, DAG, DCI)) | ||||
return SDValue(N, 0); | return SDValue(N, 0); | ||||
} | } | ||||
// Custom action for SELECT MMX | |||||
if (VT == MVT::x86mmx) { | |||||
LHS = DAG.getBitcast(MVT::i64, LHS); | |||||
RHS = DAG.getBitcast(MVT::i64, RHS); | |||||
SDValue newSelect = DAG.getNode(ISD::SELECT, DL, MVT::i64, Cond, LHS, RHS); | |||||
return DAG.getBitcast(VT, newSelect); | |||||
} | |||||
return SDValue(); | return SDValue(); | ||||
} | } | ||||
/// Combine: | /// Combine: | ||||
/// (brcond/cmov/setcc .., (cmp (atomic_load_add x, 1), 0), COND_S) | /// (brcond/cmov/setcc .., (cmp (atomic_load_add x, 1), 0), COND_S) | ||||
/// to: | /// to: | ||||
/// (brcond/cmov/setcc .., (LADD x, 1), COND_LE) | /// (brcond/cmov/setcc .., (LADD x, 1), COND_LE) | ||||
/// i.e., reusing the EFLAGS produced by the LOCKed instruction. | /// i.e., reusing the EFLAGS produced by the LOCKed instruction. | ||||
▲ Show 20 Lines • Show All 6,063 Lines • Show Last 20 Lines |