diff options
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 50b9dfb..7b0ef4b 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -3235,22 +3235,6 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI, llvm::StructType *STy = dyn_cast<llvm::StructType>(ArgI.getCoerceToType()); - if (ArgI.isDirect() && !ArgI.getCanBeFlattened() && STy && - STy->getNumElements() > 1) { - [[maybe_unused]] llvm::TypeSize StructSize = - CGM.getDataLayout().getTypeAllocSize(STy); - [[maybe_unused]] llvm::TypeSize PtrElementSize = - CGM.getDataLayout().getTypeAllocSize(ConvertTypeForMem(Ty)); - if (STy->containsHomogeneousScalableVectorTypes()) { - assert(StructSize == PtrElementSize && - "Only allow non-fractional movement of structure with" - "homogeneous scalable vector type"); - - ArgVals.push_back(ParamValue::forDirect(AI)); - break; - } - } - Address Alloca = CreateMemTemp(Ty, getContext().getDeclAlign(Arg), Arg->getName()); @@ -4887,7 +4871,7 @@ llvm::CallInst *CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee callee, call->setCallingConv(getRuntimeCC()); if (CGM.shouldEmitConvergenceTokens() && call->isConvergent()) - return addControlledConvergenceToken(call); + return cast<llvm::CallInst>(addConvergenceControlToken(call)); return call; } @@ -5414,21 +5398,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, llvm::StructType *STy = dyn_cast<llvm::StructType>(ArgInfo.getCoerceToType()); - if (STy && ArgInfo.isDirect() && !ArgInfo.getCanBeFlattened()) { - llvm::Type *SrcTy = ConvertTypeForMem(I->Ty); - [[maybe_unused]] llvm::TypeSize SrcTypeSize = - CGM.getDataLayout().getTypeAllocSize(SrcTy); - [[maybe_unused]] llvm::TypeSize DstTypeSize = - CGM.getDataLayout().getTypeAllocSize(STy); - if (STy->containsHomogeneousScalableVectorTypes()) { - assert(SrcTypeSize == DstTypeSize && - "Only allow non-fractional movement of structure with " - "homogeneous scalable vector type"); - - IRCallArgs[FirstIRArg] = I->getKnownRValue().getScalarVal(); - break; - } - } // FIXME: Avoid the conversion through memory if possible. Address Src = Address::invalid(); @@ -5818,7 +5787,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, CI->setName("call"); if (CGM.shouldEmitConvergenceTokens() && CI->isConvergent()) - CI = addControlledConvergenceToken(CI); + CI = addConvergenceControlToken(CI); // Update largest vector width from the return type. LargestVectorWidth = @@ -6121,6 +6090,8 @@ RValue CodeGenFunction::EmitVAArg(VAArgExpr *VE, Address &VAListAddr, VAListAddr = VE->isMicrosoftABI() ? EmitMSVAListRef(VE->getSubExpr()) : EmitVAListRef(VE->getSubExpr()); QualType Ty = VE->getType(); + if (Ty->isVariablyModifiedType()) + EmitVariablyModifiedType(Ty); if (VE->isMicrosoftABI()) return CGM.getABIInfo().EmitMSVAArg(*this, VAListAddr, Ty, Slot); return CGM.getABIInfo().EmitVAArg(*this, VAListAddr, Ty, Slot); |