llvm.org GIT mirror llvm / 9272c2b
[NVPTX] Simplify some argument lowering logic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211945 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Holewinski 6 years ago
1 changed file(s) with 8 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
16911691 assert(vtparts.size() > 0 && "empty aggregate type not expected");
16921692 for (unsigned parti = 0, parte = vtparts.size(); parti != parte;
16931693 ++parti) {
1694 EVT partVT = vtparts[parti];
1695 InVals.push_back(DAG.getNode(ISD::UNDEF, dl, partVT));
1694 InVals.push_back(DAG.getNode(ISD::UNDEF, dl, Ins[InsIdx].VT));
16961695 ++InsIdx;
16971696 }
16981697 if (vtparts.size() > 0)
20082007 unsigned Offset = 0;
20092008
20102009 EVT VecVT =
2011 EVT::getVectorVT(F->getContext(), OutVals[0].getValueType(), VecSize);
2010 EVT::getVectorVT(F->getContext(), EltVT, VecSize);
20122011 unsigned PerStoreOffset =
20132012 TD->getTypeAllocSize(VecVT.getTypeForEVT(F->getContext()));
20142013
20672066 }
20682067 } else {
20692068 SmallVector ValVTs;
2070 // const_cast is necessary since we are still using an LLVM version from
2071 // before the type system re-write.
2072 ComputePTXValueVTs(*this, RetTy, ValVTs);
2069 SmallVector Offsets;
2070 ComputePTXValueVTs(*this, RetTy, ValVTs, &Offsets, 0);
20732071 assert(ValVTs.size() == OutVals.size() && "Bad return value decomposition");
20742072
2075 unsigned SizeSoFar = 0;
20762073 for (unsigned i = 0, e = Outs.size(); i != e; ++i) {
20772074 SDValue theVal = OutVals[i];
20782075 EVT TheValType = theVal.getValueType();
20962093 else if (TmpVal.getValueType().getSizeInBits() < 16)
20972094 TmpVal = DAG.getNode(ISD::ANY_EXTEND, dl, MVT::i16, TmpVal);
20982095
2099 SDValue Ops[] = { Chain, DAG.getConstant(SizeSoFar, MVT::i32), TmpVal };
2096 SDValue Ops[] = {
2097 Chain,
2098 DAG.getConstant(Offsets[i], MVT::i32),
2099 TmpVal };
21002100 Chain = DAG.getMemIntrinsicNode(NVPTXISD::StoreRetval, dl,
21012101 DAG.getVTList(MVT::Other), Ops,
21022102 TheStoreType,
21032103 MachinePointerInfo());
2104 if(TheValType.isVector())
2105 SizeSoFar +=
2106 TheStoreType.getVectorElementType().getStoreSizeInBits() / 8;
2107 else
2108 SizeSoFar += TheStoreType.getStoreSizeInBits()/8;
21092104 }
21102105 }
21112106 }