Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ BFloat16s = "0.2, 0.3, 0.4, 0.5, 0.6"
CEnum = "0.4, 0.5"
ChainRulesCore = "1"
EnzymeCore = "0.8.16"
Enzyme_jll = "0.0.214, 0.0.215"
Enzyme_jll = "0.0.216"
GPUArraysCore = "0.1.6, 0.2"
GPUCompiler = "1.6.2"
LLVM = "9.1"
Expand Down
10 changes: 8 additions & 2 deletions src/absint.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Abstractly interpret julia from LLVM

# Return (bool if could interpret, julia object interpreted to)
function absint(@nospecialize(arg::LLVM.Value), partial::Bool = false)::Tuple{Bool, Any}
if (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Tracked)) || (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Derived))
function absint(@nospecialize(arg::LLVM.Value), partial::Bool = false, istracked::Bool=false)::Tuple{Bool, Any}
if (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Tracked)) || (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Derived)) || istracked
ce, _ = get_base_and_offset(arg; offsetAllowed = false, inttoptr = true)
if isa(ce, GlobalVariable)
gname = LLVM.name(ce)
Expand Down Expand Up @@ -441,6 +441,12 @@ function abs_typeof(
vals = absint(operands(arg)[3], partial)
return (vals[1], vals[2], vals[1] ? GPUCompiler.BITS_REF : nothing)
end
# Type tag is arg 3
if nm == "jl_alloc_genericmemory_unchecked" ||
nm == "ijl_alloc_genericmemory_unchecked"
vals = absint(operands(arg)[3], partial, true)
return (vals[1], vals[2], vals[1] ? GPUCompiler.MUT_REF : nothing)
end
# Type tag is arg 1
if nm == "jl_alloc_array_1d" ||
nm == "ijl_alloc_array_1d" ||
Expand Down
Loading
Loading