From 6746e5a0040427dcecf470eadf704bff025f903f Mon Sep 17 00:00:00 2001 From: William Moses Date: Thu, 28 Nov 2024 16:06:58 -0500 Subject: [PATCH] Further absint improvements (#2140) * Further absint improvements * Update Project.toml --------- Co-authored-by: William Moses --- src/absint.jl | 20 ++++++++++++++------ src/compiler.jl | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/absint.jl b/src/absint.jl index 4bc607ed7f..5a72fa0873 100644 --- a/src/absint.jl +++ b/src/absint.jl @@ -576,12 +576,20 @@ function abs_typeof( end end if !seen && typed_fieldcount(typ) > 0 - offset = offset - typed_fieldoffset(typ, lasti) - typ = typed_fieldtype(typ, lasti) - @assert Base.isconcretetype(typ) - if !Base.allocatedinline(typ) - legal = false - end + offset = offset - typed_fieldoffset(typ, lasti) + typ = typed_fieldtype(typ, lasti) + if offset == 0 + if !Base.allocatedinline(typ) + if byref != GPUCompiler.BITS_VALUE + legal = false + end + byref = GPUCompiler.MUT_REF + end + else + if !Base.isconcretetype(typ) || !Base.allocatedinline(typ) + legal = false + end + end seen = true end if !seen diff --git a/src/compiler.jl b/src/compiler.jl index 83a4efde4f..c94a6c84b4 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -6177,7 +6177,7 @@ function GPUCompiler.codegen( ) params = job.config.params if params.run_enzyme - @assert eltype(params.rt) != Union{} + # @assert eltype(params.rt) != Union{} end expectedTapeType = params.expectedTapeType mode = params.mode