Skip to content

Commit

Permalink
Remove deprecated isOpaqueOrPointeeTypeMatches calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jan 27, 2024
1 parent 795e810 commit 8f31fba
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ static GlobalVariable *emit_plt_thunk(
SmallVector<Value*, 16> args;
for (auto &arg : plt->args())
args.push_back(&arg);
assert(cast<PointerType>(ptr->getType())->isOpaqueOrPointeeTypeMatches(functype));
CallInst *ret = irbuilder.CreateCall(
functype,
ptr, ArrayRef<Value*>(args));
Expand Down
5 changes: 0 additions & 5 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PointerType>(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);
}
Expand Down Expand Up @@ -6809,7 +6808,6 @@ static Function* gen_cfun_wrapper(
theFptr = ctx.builder.CreateSelect(age_ok, theFptr, gf_thunk);
}

assert(cast<PointerType>(theFptr->getType())->isOpaqueOrPointeeTypeMatches(returninfo.decl.getFunctionType()));
CallInst *call = ctx.builder.CreateCall(
returninfo.decl.getFunctionType(),
theFptr, ArrayRef<Value*>(args));
Expand Down Expand Up @@ -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<PointerType>(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;
Expand Down Expand Up @@ -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<PointerType>(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;
}
Expand Down
2 changes: 0 additions & 2 deletions src/llvm-late-gc-lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,6 @@ State LateLowerGCFrame::LocalScan(Function &F) {
}
if (CI->hasStructRetAttr()) {
Type *ElT = getAttributeAtIndex(CI->getAttributes(), 1, Attribute::StructRet).getValueAsType();
assert(cast<PointerType>(CI->getArgOperand(0)->getType())->isOpaqueOrPointeeTypeMatches(getAttributeAtIndex(CI->getAttributes(), 1, Attribute::StructRet).getValueAsType()));
auto tracked = CountTrackedPointers(ElT, true);
if (tracked.count) {
AllocaInst *SRet = dyn_cast<AllocaInst>((CI->arg_begin()[0])->stripInBoundsOffsets());
Expand Down Expand Up @@ -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<PointerType>(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);
Expand Down

0 comments on commit 8f31fba

Please sign in to comment.