llvm.org GIT mirror llvm / 25ac7e8
Fix EXTRACT_ELEMENT, EXTRACT_SUBVECTOR, and EXTRACT_VECTOR_ELT to use an intptr ValueType instead of i32 for the index operand in getCopyToParts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40987 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
2 changed file(s) with 16 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
717717 SDOperand *Parts,
718718 unsigned NumParts,
719719 MVT::ValueType PartVT) {
720 TargetLowering &TLI = DAG.getTargetLoweringInfo();
721 MVT::ValueType PtrVT = TLI.getPointerTy();
720722 MVT::ValueType ValueVT = Val.getValueType();
721723
722724 if (!MVT::isVector(ValueVT) || NumParts == 1) {
724726 if (NumParts > 1) {
725727 for (unsigned i = 0; i != NumParts; ++i)
726728 Parts[i] = DAG.getNode(ISD::EXTRACT_ELEMENT, PartVT, Val,
727 DAG.getConstant(i, MVT::i32));
729 DAG.getConstant(i, PtrVT));
728730 if (!DAG.getTargetLoweringInfo().isLittleEndian())
729731 std::reverse(Parts, Parts + NumParts);
730732 return;
775777 Ops[i] = DAG.getNode(ISD::EXTRACT_SUBVECTOR,
776778 IntermediateVT, Val,
777779 DAG.getConstant(i * (NumElements / NumIntermediates),
778 MVT::i32));
780 PtrVT));
779781 else
780782 Ops[i] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT,
781783 IntermediateVT, Val,
782 DAG.getConstant(i, MVT::i32));
784 DAG.getConstant(i, PtrVT));
783785
784786 // Split the intermediate operands into legal parts.
785787 if (NumParts == NumIntermediates) {
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep -v IMPLICIT_DEF
1
2 define void @foo(<2 x float>* %p) {
3 %t = insertelement <2 x float> undef, float 0.0, i32 0
4 %v = insertelement <2 x float> %t, float 0.0, i32 1
5 br label %bb8
6
7 bb8:
8 store <2 x float> %v, <2 x float>* %p
9 ret void
10 }