[llvm] r344424 - [X86] Simplify the end of custom type legalization for (v2i32/v4i16/v8i8 (bitcast (f64))) by just emitting an EXTRACT_SUBVECTOR instead of a BUILD_VECTOR.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 12 15:00:00 PDT 2018
Author: ctopper
Date: Fri Oct 12 15:00:00 2018
New Revision: 344424
URL: http://llvm.org/viewvc/llvm-project?rev=344424&view=rev
Log:
[X86] Simplify the end of custom type legalization for (v2i32/v4i16/v8i8 (bitcast (f64))) by just emitting an EXTRACT_SUBVECTOR instead of a BUILD_VECTOR.
Generic legalization should be able to finish legalizing the EXTRACT_SUBVECTOR probably by turning it into a BUILD_VECTOR. But we should emit the simplest sequence.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=344424&r1=344423&r2=344424&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Oct 12 15:00:00 2018
@@ -26307,13 +26307,9 @@ void X86TargetLowering::ReplaceNodeResul
SDValue Expanded = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl,
MVT::v2f64, N->getOperand(0));
SDValue ToVecInt = DAG.getBitcast(WiderVT, Expanded);
-
- SmallVector<SDValue, 8> Elts;
- for (unsigned i = 0, e = NumElts; i != e; ++i)
- Elts.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, SVT,
- ToVecInt, DAG.getIntPtrConstant(i, dl)));
-
- Results.push_back(DAG.getBuildVector(DstVT, dl, Elts));
+ SDValue Extract = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, DstVT,
+ ToVecInt, DAG.getIntPtrConstant(0, dl));
+ Results.push_back(Extract);
return;
}
case ISD::MGATHER: {
More information about the llvm-commits
mailing list