From e4f66a10556c82e2ebf2469fafc1c26639f15be8 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Fri, 9 Jul 2021 09:32:40 -0700 Subject: [PATCH] [OpaquePointers][CallPromotion] Don't look at pointee type for byval byval's type parameter is now always required. --- llvm/lib/Transforms/Utils/CallPromotionUtils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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; -- 2.7.4