Skip to content

Commit 2599a4b

Browse files
authored
Calling conv part 1 (#2782)
* Calling conv part 1 * fix * more * fix * fix * gopt * more things * gen mem unchecked * fix * recombine sret * more fixes * fix * more improvements * continuing * fix * fix * 1.10 compile * fix * fix * fix * fix * Shorten errors * fix * fix * fix * fix * fix
1 parent b910049 commit 2599a4b

File tree

14 files changed

+810
-199
lines changed

14 files changed

+810
-199
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ BFloat16s = "0.2, 0.3, 0.4, 0.5, 0.6"
4242
CEnum = "0.4, 0.5"
4343
ChainRulesCore = "1"
4444
EnzymeCore = "0.8.16"
45-
Enzyme_jll = "0.0.214, 0.0.215"
45+
Enzyme_jll = "0.0.216"
4646
GPUArraysCore = "0.1.6, 0.2"
4747
GPUCompiler = "1.6.2"
4848
LLVM = "9.1"

src/absint.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Abstractly interpret julia from LLVM
22

33
# Return (bool if could interpret, julia object interpreted to)
4-
function absint(@nospecialize(arg::LLVM.Value), partial::Bool = false)::Tuple{Bool, Any}
5-
if (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Tracked)) || (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Derived))
4+
function absint(@nospecialize(arg::LLVM.Value), partial::Bool = false, istracked::Bool=false)::Tuple{Bool, Any}
5+
if (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Tracked)) || (value_type(arg) == LLVM.PointerType(LLVM.StructType(LLVMType[]), Derived)) || istracked
66
ce, _ = get_base_and_offset(arg; offsetAllowed = false, inttoptr = true)
77
if isa(ce, GlobalVariable)
88
gname = LLVM.name(ce)
@@ -441,6 +441,12 @@ function abs_typeof(
441441
vals = absint(operands(arg)[3], partial)
442442
return (vals[1], vals[2], vals[1] ? GPUCompiler.BITS_REF : nothing)
443443
end
444+
# Type tag is arg 3
445+
if nm == "jl_alloc_genericmemory_unchecked" ||
446+
nm == "ijl_alloc_genericmemory_unchecked"
447+
vals = absint(operands(arg)[3], partial, true)
448+
return (vals[1], vals[2], vals[1] ? GPUCompiler.MUT_REF : nothing)
449+
end
444450
# Type tag is arg 1
445451
if nm == "jl_alloc_array_1d" ||
446452
nm == "ijl_alloc_array_1d" ||

0 commit comments

Comments
 (0)