From: Arthur Eubanks Date: Fri, 9 Jul 2021 16:32:40 +0000 (-0700) Subject: [OpaquePointers][CallPromotion] Don't look at pointee type for byval X-Git-Tag: llvmorg-14-init~1939 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4f66a10556c82e2ebf2469fafc1c26639f15be8;p=platform%2Fupstream%2Fllvm.git [OpaquePointers][CallPromotion] Don't look at pointee type for byval byval's type parameter is now always required. --- diff --git a/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp b/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp index bf08bf2..8786825 100644 --- a/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp +++ b/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp @@ -490,11 +490,8 @@ CallBase &llvm::promoteCall(CallBase &CB, Function *Callee, // If byval is used, this must be a pointer type, and the byval type must // match the element type. Update it if present. - if (ArgAttrs.getByValType()) { - Type *NewTy = Callee->getParamByValType(ArgNo); - ArgAttrs.addByValAttr( - NewTy ? NewTy : cast(FormalTy)->getElementType()); - } + if (ArgAttrs.getByValType()) + ArgAttrs.addByValAttr(Callee->getParamByValType(ArgNo)); NewArgAttrs.push_back(AttributeSet::get(Ctx, ArgAttrs)); AttributeChanged = true;