Skip to content

Commit 172d10b

Browse files
committed
Minor fix-up for nightly
GPUCompiler is broken on nightly for the `@check_allocs` pipeline, but this at least gets the basic functionality working.
1 parent 80254ea commit 172d10b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/classify.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ function resolve_allocations(call::LLVM.Value)
194194
# Check that this points into the type tag (at a -1 offset)
195195
offset = operands(gep)[2]
196196
!isa(offset, LLVM.ConstantInt) && continue
197-
(convert(Int, offset) != -1) && continue
197+
offset = convert(Int, offset)
198+
199+
# TODO: this should check gep->getSourceElementType() when that is available in LLVM C API
200+
(offset != -1 && offset != -8) && continue
198201

199202
# Now, look for the store into the type tag and count that as our allocation(s)
200203
for gepuse in uses(gep)
@@ -215,6 +218,7 @@ function resolve_allocations(call::LLVM.Value)
215218
push!(allocs, (store, type))
216219
end
217220
end
221+
isempty(allocs) && return [(call, Any)] # could not identify any type-tag (probably a bug!)
218222
return allocs
219223
end
220224
return nothing

0 commit comments

Comments
 (0)