forked from OSchip/llvm-project
[NVPTX] Just use getTypeAllocSize() when computing return value size for structures and vectors
llvm-svn: 211925
This commit is contained in:
parent
dcb863263b
commit
0da758571c
|
@ -734,23 +734,7 @@ void NVPTXAsmPrinter::printReturnValStr(const Function *F, raw_ostream &O) {
|
||||||
<< " func_retval0";
|
<< " func_retval0";
|
||||||
} else {
|
} else {
|
||||||
if ((Ty->getTypeID() == Type::StructTyID) || isa<VectorType>(Ty)) {
|
if ((Ty->getTypeID() == Type::StructTyID) || isa<VectorType>(Ty)) {
|
||||||
SmallVector<EVT, 16> vtparts;
|
unsigned totalsz = TD->getTypeAllocSize(Ty);
|
||||||
ComputeValueVTs(*TLI, Ty, vtparts);
|
|
||||||
unsigned totalsz = 0;
|
|
||||||
for (unsigned i = 0, e = vtparts.size(); i != e; ++i) {
|
|
||||||
unsigned elems = 1;
|
|
||||||
EVT elemtype = vtparts[i];
|
|
||||||
if (vtparts[i].isVector()) {
|
|
||||||
elems = vtparts[i].getVectorNumElements();
|
|
||||||
elemtype = vtparts[i].getVectorElementType();
|
|
||||||
}
|
|
||||||
for (unsigned j = 0, je = elems; j != je; ++j) {
|
|
||||||
unsigned sz = elemtype.getSizeInBits();
|
|
||||||
if (elemtype.isInteger() && (sz < 8))
|
|
||||||
sz = 8;
|
|
||||||
totalsz += sz / 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unsigned retAlignment = 0;
|
unsigned retAlignment = 0;
|
||||||
if (!llvm::getAlign(*F, 0, retAlignment))
|
if (!llvm::getAlign(*F, 0, retAlignment))
|
||||||
retAlignment = TD->getABITypeAlignment(Ty);
|
retAlignment = TD->getABITypeAlignment(Ty);
|
||||||
|
|
Loading…
Reference in New Issue