diff options
| author | Craig Topper <craig.topper@intel.com> | 2019-02-23 19:51:32 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2019-02-23 19:51:32 +0000 |
| commit | ccc860cb810a62072e32662b1de430ff8f121611 (patch) | |
| tree | 85af8df31b15841cf9747136ed0e282223b8185f /llvm/lib/Target/X86 | |
| parent | e661f946a7dba50cd8b77263f21707ecbc8f6794 (diff) | |
| download | bcm5719-llvm-ccc860cb810a62072e32662b1de430ff8f121611.tar.gz bcm5719-llvm-ccc860cb810a62072e32662b1de430ff8f121611.zip | |
Recommit r354647 and r354648 "[LegalizeTypes] When promoting the result of EXTRACT_SUBVECTOR, also check if the input needs to be promoted. Use that to determine the element type to extract"
r354648 was a follow up to fix a regression "[X86] Add a DAG combine for (aext_vector_inreg (aext_vector_inreg X)) -> (aext_vector_inreg X) to fix a regression from my previous commit."
These were reverted in r354713 as their context depended on other patches that were reverted for a bug.
llvm-svn: 354734
Diffstat (limited to 'llvm/lib/Target/X86')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index c5824b366cd..aa9fd6bc03a 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1871,6 +1871,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM, setTargetDAGCombine(ISD::ANY_EXTEND); setTargetDAGCombine(ISD::SIGN_EXTEND); setTargetDAGCombine(ISD::SIGN_EXTEND_INREG); + setTargetDAGCombine(ISD::ANY_EXTEND_VECTOR_INREG); setTargetDAGCombine(ISD::SINT_TO_FP); setTargetDAGCombine(ISD::UINT_TO_FP); setTargetDAGCombine(ISD::SETCC); @@ -42160,6 +42161,25 @@ static SDValue combinePMULDQ(SDNode *N, SelectionDAG &DAG, return SDValue(); } +static SDValue combineExtInVec(SDNode *N, SelectionDAG &DAG) { + // Disabling for widening legalization for now. We can enable if we find a + // case that needs it. Otherwise it can be deleted when we switch to + // widening legalization. + if (ExperimentalVectorWideningLegalization) + return SDValue(); + + EVT VT = N->getValueType(0); + SDValue In = N->getOperand(0); + + // Combine (ext_invec (ext_invec X)) -> (ext_invec X) + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); + if (In.getOpcode() == N->getOpcode() && + TLI.isTypeLegal(VT) && TLI.isTypeLegal(In.getOperand(0).getValueType())) + return DAG.getNode(N->getOpcode(), SDLoc(N), VT, In.getOperand(0)); + + return SDValue(); +} + SDValue X86TargetLowering::PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const { SelectionDAG &DAG = DCI.DAG; @@ -42221,6 +42241,7 @@ SDValue X86TargetLowering::PerformDAGCombine(SDNode *N, case ISD::ZERO_EXTEND: return combineZext(N, DAG, DCI, Subtarget); case ISD::SIGN_EXTEND: return combineSext(N, DAG, DCI, Subtarget); case ISD::SIGN_EXTEND_INREG: return combineSignExtendInReg(N, DAG, Subtarget); + case ISD::ANY_EXTEND_VECTOR_INREG: return combineExtInVec(N, DAG); case ISD::SETCC: return combineSetCC(N, DAG, Subtarget); case X86ISD::SETCC: return combineX86SetCC(N, DAG, Subtarget); case X86ISD::BRCOND: return combineBrCond(N, DAG, Subtarget); |

