Skip to content

Commit bb4823a

Browse files
authored
use CC.MAX_INLINE_COST instead of typemax(Int) (#741)
1 parent a412d9c commit bb4823a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/interface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ function optimization_params(@nospecialize(job::CompilerJob))
324324
kwargs = NamedTuple()
325325

326326
if job.config.always_inline
327-
kwargs = (kwargs..., inline_cost_threshold=typemax(Int))
327+
kwargs = (kwargs..., inline_cost_threshold=Int(CC.MAX_INLINE_COST))
328328
end
329329

330330
return CC.OptimizationParams(;kwargs...)

test/gcn.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ end
3737
end
3838
end
3939

40+
@testset "https://github.com/JuliaGPU/AMDGPU.jl/issues/846" begin
41+
ir, rt = GCN.code_typed((Tuple{Tuple{Val{4}}, Tuple{Float32}},); always_inline=true) do t
42+
t[1]
43+
end |> only
44+
@test rt == Tuple{Val{4}}
45+
end
46+
4047
end
4148

4249
############################################################################################

0 commit comments

Comments
 (0)