From 8f31fba29b06b91d573771db16882bc5cc1b0a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20S=C3=A1nchez=20Ram=C3=ADrez?= Date: Sat, 27 Jan 2024 13:14:11 +0100 Subject: [PATCH] Remove deprecated `isOpaqueOrPointeeTypeMatches` calls --- src/ccall.cpp | 1 - src/codegen.cpp | 5 ----- src/llvm-late-gc-lowering.cpp | 2 -- 3 files changed, 8 deletions(-) diff --git a/src/ccall.cpp b/src/ccall.cpp index 92ede74402791d..ad9f073df13490 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -260,7 +260,6 @@ static GlobalVariable *emit_plt_thunk( SmallVector args; for (auto &arg : plt->args()) args.push_back(&arg); - assert(cast(ptr->getType())->isOpaqueOrPointeeTypeMatches(functype)); CallInst *ret = irbuilder.CreateCall( functype, ptr, ArrayRef(args)); diff --git a/src/codegen.cpp b/src/codegen.cpp index 6abf6d0bdf76aa..811f92de9b75c0 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6323,7 +6323,6 @@ static void emit_cfunc_invalidate( case jl_returninfo_t::SRet: { if (return_roots) { Value *root1 = gf_thunk->arg_begin() + 1; // root1 has type [n x {}*]* - assert(cast(root1->getType())->isOpaqueOrPointeeTypeMatches(get_returnroots_type(ctx, return_roots))); root1 = ctx.builder.CreateConstInBoundsGEP2_32(get_returnroots_type(ctx, return_roots), root1, 0, 0); ctx.builder.CreateStore(gf_ret, root1); } @@ -6809,7 +6808,6 @@ static Function* gen_cfun_wrapper( theFptr = ctx.builder.CreateSelect(age_ok, theFptr, gf_thunk); } - assert(cast(theFptr->getType())->isOpaqueOrPointeeTypeMatches(returninfo.decl.getFunctionType())); CallInst *call = ctx.builder.CreateCall( returninfo.decl.getFunctionType(), theFptr, ArrayRef(args)); @@ -7182,7 +7180,6 @@ static Function *gen_invoke_wrapper(jl_method_instance_t *lam, jl_value_t *jlret case jl_returninfo_t::Ghosts: break; case jl_returninfo_t::SRet: - assert(cast(ftype->getParamType(0))->isOpaqueOrPointeeTypeMatches(getAttributeAtIndex(f.attrs, 1, Attribute::StructRet).getValueAsType())); result = ctx.builder.CreateAlloca(getAttributeAtIndex(f.attrs, 1, Attribute::StructRet).getValueAsType()); setName(ctx.emission_context, result, "sret"); args[idx] = result; @@ -7477,8 +7474,6 @@ static jl_returninfo_t get_specsig_function(jl_codectx_t &ctx, Module *M, Value static void emit_sret_roots(jl_codectx_t &ctx, bool isptr, Value *Src, Type *T, Value *Shadow, Type *ShadowT, unsigned count) { - if (isptr && !cast(Src->getType())->isOpaqueOrPointeeTypeMatches(T)) - Src = ctx.builder.CreateBitCast(Src, T->getPointerTo(Src->getType()->getPointerAddressSpace())); unsigned emitted = TrackWithShadow(Src, T, isptr, Shadow, ShadowT, ctx.builder); //This comes from Late-GC-Lowering?? assert(emitted == count); (void)emitted; (void)count; } diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp index edb3aad8f23282..5abb0adda0c565 100644 --- a/src/llvm-late-gc-lowering.cpp +++ b/src/llvm-late-gc-lowering.cpp @@ -1538,7 +1538,6 @@ State LateLowerGCFrame::LocalScan(Function &F) { } if (CI->hasStructRetAttr()) { Type *ElT = getAttributeAtIndex(CI->getAttributes(), 1, Attribute::StructRet).getValueAsType(); - assert(cast(CI->getArgOperand(0)->getType())->isOpaqueOrPointeeTypeMatches(getAttributeAtIndex(CI->getAttributes(), 1, Attribute::StructRet).getValueAsType())); auto tracked = CountTrackedPointers(ElT, true); if (tracked.count) { AllocaInst *SRet = dyn_cast((CI->arg_begin()[0])->stripInBoundsOffsets()); @@ -1876,7 +1875,6 @@ unsigned TrackWithShadow(Value *Src, Type *STy, bool isptr, Value *Dst, Type *DT for (unsigned i = 0; i < Ptrs.size(); ++i) { Value *Elem = Ptrs[i];// Dst has type `[n x {}*]*` Value *Slot = irbuilder.CreateConstInBoundsGEP2_32(DTy, Dst, 0, i); - assert(cast(Dst->getType())->isOpaqueOrPointeeTypeMatches(DTy)); StoreInst *shadowStore = irbuilder.CreateAlignedStore(Elem, Slot, Align(sizeof(void*))); shadowStore->setOrdering(AtomicOrdering::NotAtomic); // TODO: shadowStore->setMetadata(LLVMContext::MD_tbaa, tbaa_gcframe);