diff options
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 7c8d962fa5a9..f139c30f3dfd 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()); @@ -4379,7 +4363,7 @@ static void emitWritebackArg(CodeGenFunction &CGF, CallArgList &args, llvm::PHINode *phiToUse = CGF.Builder.CreatePHI(valueToUse->getType(), 2, "icr.to-use"); phiToUse->addIncoming(valueToUse, copyBB); - phiToUse->addIncoming(llvm::UndefValue::get(valueToUse->getType()), + phiToUse->addIncoming(llvm::PoisonValue::get(valueToUse->getType()), originBB); valueToUse = phiToUse; } @@ -4529,7 +4513,7 @@ void CodeGenFunction::EmitCallArgs( ArgTypes.assign(MD->param_type_begin() + ParamsToSkip, MD->param_type_end()); } else { - const auto *FPT = Prototype.P.get<const FunctionProtoType *>(); + const auto *FPT = cast<const FunctionProtoType *>(Prototype.P); IsVariadic = FPT->isVariadic(); ExplicitCC = FPT->getExtInfo().getCC(); ArgTypes.assign(FPT->param_type_begin() + ParamsToSkip, @@ -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(); |
