Skip to content

Commit 5cd4aa8

Browse files
committed
fix
1 parent 8d95716 commit 5cd4aa8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/compiler.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3547,7 +3547,7 @@ function GPUCompiler.codegen(
35473547

35483548
# Unsupported calling conv
35493549
# also wouldn't have any type info for this [would for earlier args though]
3550-
if mi.specTypes.parameters[end] === Vararg{Any}
3550+
if Base.isvarargtype(mi.specTypes.parameters[end])
35513551
continue
35523552
end
35533553

src/llvm/transforms.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,19 +859,26 @@ function nodecayed_phis!(mod::LLVM.Module)
859859

860860
B = LLVM.IRBuilder()
861861
position!(B, v)
862-
vphi = phi!(B, value_type(v), "nondecay.vphi."*LLVM.name(v))
862+
863+
sPT = LLVM.PointerType(eltype(value_type(v)), 10)
864+
vphi = phi!(B, sPT, "nondecay.vphi."*LLVM.name(v))
863865
ophi = phi!(B, value_type(offset), "nondecay.ophi"*LLVM.name(v))
864866
phicache[v] = (vphi, ophi)
865867

866868
for (vt, bb) in LLVM.incoming(v)
867869
b2 = IRBuilder()
868870
position!(b2, terminator(bb))
869871
v2, o2, hl2 = getparent(b2, vt, offset, hasload, phicache)
872+
if value_type(v2) != sPT
873+
v2 = bitcast!(b2, v2, sPT)
874+
end
875+
@assert sPT == value_type(v2)
870876
push!(vs, v2)
877+
@assert value_type(offset) == value_type(o2)
871878
push!(offs, o2)
872879
push!(blks, bb)
873880
end
874-
881+
875882
append!(incoming(ophi), collect(zip(offs, blks)))
876883

877884
append!(incoming(vphi), collect(zip(vs, blks)))

0 commit comments

Comments
 (0)