@@ -1531,8 +1531,7 @@ void ClangToLLVMArgMapping::construct(const ASTContext &Context,
1531
1531
case ABIArgInfo::Direct: {
1532
1532
// FIXME: handle sseregparm someday...
1533
1533
llvm::StructType *STy = dyn_cast<llvm::StructType>(AI.getCoerceToType ());
1534
- if (AI.isDirect () && AI.getCanBeFlattened () && STy &&
1535
- !STy->containsHomogeneousScalableVectorTypes ()) {
1534
+ if (AI.isDirect () && AI.getCanBeFlattened () && STy) {
1536
1535
IRArgs.NumberOfArgs = STy->getNumElements ();
1537
1536
} else {
1538
1537
IRArgs.NumberOfArgs = 1 ;
@@ -1714,8 +1713,7 @@ CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI) {
1714
1713
// FCAs, so we flatten them if this is safe to do for this argument.
1715
1714
llvm::Type *argType = ArgInfo.getCoerceToType ();
1716
1715
llvm::StructType *st = dyn_cast<llvm::StructType>(argType);
1717
- if (st && ArgInfo.isDirect () && ArgInfo.getCanBeFlattened () &&
1718
- !st->containsHomogeneousScalableVectorTypes ()) {
1716
+ if (st && ArgInfo.isDirect () && ArgInfo.getCanBeFlattened ()) {
1719
1717
assert (NumIRArgs == st->getNumElements ());
1720
1718
for (unsigned i = 0 , e = st->getNumElements (); i != e; ++i)
1721
1719
ArgTypes[FirstIRArg + i] = st->getElementType (i);
@@ -3212,7 +3210,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
3212
3210
dyn_cast<llvm::StructType>(ArgI.getCoerceToType ());
3213
3211
llvm::TypeSize StructSize;
3214
3212
llvm::TypeSize PtrElementSize;
3215
- if (ArgI.isDirect () && ArgI.getCanBeFlattened () && STy &&
3213
+ if (ArgI.isDirect () && ! ArgI.getCanBeFlattened () && STy &&
3216
3214
STy->getNumElements () > 1 ) {
3217
3215
StructSize = CGM.getDataLayout ().getTypeAllocSize (STy);
3218
3216
PtrElementSize =
@@ -5279,7 +5277,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
5279
5277
llvm::Type *SrcTy = ConvertTypeForMem (I->Ty );
5280
5278
llvm::TypeSize SrcTypeSize;
5281
5279
llvm::TypeSize DstTypeSize;
5282
- if (STy && ArgInfo.isDirect () && ArgInfo.getCanBeFlattened ()) {
5280
+ if (STy && ArgInfo.isDirect () && ! ArgInfo.getCanBeFlattened ()) {
5283
5281
SrcTypeSize = CGM.getDataLayout ().getTypeAllocSize (SrcTy);
5284
5282
DstTypeSize = CGM.getDataLayout ().getTypeAllocSize (STy);
5285
5283
if (STy->containsHomogeneousScalableVectorTypes ()) {
0 commit comments