diff options
author | Konstantin Belochapka <Konstantin.belochapka@sony.com> | 2017-07-31 20:11:49 +0000 |
---|---|---|
committer | Konstantin Belochapka <Konstantin.belochapka@sony.com> | 2017-07-31 20:11:49 +0000 |
commit | b77d0a5cf1957439bd7f9536ed531c3e6fe7af37 (patch) | |
tree | b8c43bfaa2fdf5e99fb58a24dfa241d2db32a3f5 /llvm/lib | |
parent | 904801597e357838d46dc58bbad704460a071b1e (diff) | |
download | bcm5719-llvm-b77d0a5cf1957439bd7f9536ed531c3e6fe7af37.tar.gz bcm5719-llvm-b77d0a5cf1957439bd7f9536ed531c3e6fe7af37.zip |
[X86][MMX] Added custom lowering action for MMX SELECT (PR30418)
Fix for pr30418 - error in backend: Cannot select: t17: x86mmx = select_cc t2, Constant:i64<0>, t7, t8, seteq:ch
Differential Revision: https://reviews.llvm.org/D34661
llvm-svn: 309614
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 081b711a145..e1dd6d03550 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -419,6 +419,11 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM, setOperationAction(ISD::SELECT, 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); // NOTE: EH_SJLJ_SETJMP/_LONGJMP supported here is NOT intended to support // SjLj exception handling but a light-weight setjmp/longjmp replacement to @@ -30631,6 +30636,14 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG, 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(); } |