diff options
author | Craig Topper <craig.topper@intel.com> | 2018-06-29 17:24:07 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-06-29 17:24:07 +0000 |
commit | 87b107dd698fcf0678e65208d670c04cfa570355 (patch) | |
tree | c58ce60c02531a38f45a5fa8e896aa052021d128 /llvm/lib/Target | |
parent | d77e7ba74e77fe8fc61f84e79ba6678d614c40af (diff) | |
download | bcm5719-llvm-87b107dd698fcf0678e65208d670c04cfa570355.tar.gz bcm5719-llvm-87b107dd698fcf0678e65208d670c04cfa570355.zip |
[X86] Limit the number of target specific nodes emitted in LowerShiftParts
The important part is the creation of the SHLD/SHRD nodes. The compare and the conditional move can use target independent nodes that can be legalized on their own. This gives some opportunities to trigger the optimizations present in the lowering for those things. And its just better to limit the number of places we emit target specific nodes.
The changed test cases still aren't optimal.
Differential Revision: https://reviews.llvm.org/D48619
llvm-svn: 335998
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index dcc9e2368c0..1e386eb8c30 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -16130,24 +16130,19 @@ static SDValue LowerShiftParts(SDValue Op, SelectionDAG &DAG) { // values for large shift amounts. SDValue AndNode = DAG.getNode(ISD::AND, dl, MVT::i8, ShAmt, DAG.getConstant(VTBits, dl, MVT::i8)); - SDValue Cond = DAG.getNode(X86ISD::CMP, dl, MVT::i32, - AndNode, DAG.getConstant(0, dl, MVT::i8)); + SDValue Cond = DAG.getSetCC(dl, MVT::i8, AndNode, + DAG.getConstant(0, dl, MVT::i8), ISD::SETNE); SDValue Hi, Lo; - SDValue CC = DAG.getConstant(X86::COND_NE, dl, MVT::i8); - SDValue Ops0[4] = { Tmp2, Tmp3, CC, Cond }; - SDValue Ops1[4] = { Tmp3, Tmp1, CC, Cond }; - if (Op.getOpcode() == ISD::SHL_PARTS) { - Hi = DAG.getNode(X86ISD::CMOV, dl, VT, Ops0); - Lo = DAG.getNode(X86ISD::CMOV, dl, VT, Ops1); + Hi = DAG.getNode(ISD::SELECT, dl, VT, Cond, Tmp3, Tmp2); + Lo = DAG.getNode(ISD::SELECT, dl, VT, Cond, Tmp1, Tmp3); } else { - Lo = DAG.getNode(X86ISD::CMOV, dl, VT, Ops0); - Hi = DAG.getNode(X86ISD::CMOV, dl, VT, Ops1); + Lo = DAG.getNode(ISD::SELECT, dl, VT, Cond, Tmp3, Tmp2); + Hi = DAG.getNode(ISD::SELECT, dl, VT, Cond, Tmp1, Tmp3); } - SDValue Ops[2] = { Lo, Hi }; - return DAG.getMergeValues(Ops, dl); + return DAG.getMergeValues({ Lo, Hi }, dl); } // Try to use a packed vector operation to handle i64 on 32-bit targets when |