Skip to content
Open
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: 2 additions & 0 deletions src/gcn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,5 @@ function emit_trap!(job::CompilerJob{GCNCompilerTarget}, builder, mod, inst)
end
call!(builder, trap_ft, trap)
end

can_vectorize(job::CompilerJob{GCNCompilerTarget}) = true
3 changes: 3 additions & 0 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ end
# Has the runtime available and does not require special handling
uses_julia_runtime(@nospecialize(job::CompilerJob)) = false

# Is it legal to run vectorization passes on this target
can_vectorize(@nospecialize(job::CompilerJob)) = false

# Should emit PTLS lookup that can be relocated
dump_native(@nospecialize(job::CompilerJob)) = false

Expand Down
1 change: 1 addition & 0 deletions src/native.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ end

runtime_slug(job::CompilerJob{NativeCompilerTarget}) = "native_$(job.config.target.cpu)-$(hash(job.config.target.features))$(job.config.target.jlruntime ? "-jlrt" : "")"
uses_julia_runtime(job::CompilerJob{NativeCompilerTarget}) = job.config.target.jlruntime
can_vectorize(job::CompilerJob{NativeCompilerTarget}) = true
5 changes: 1 addition & 4 deletions src/optim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ function buildNewPMPipeline!(mpm, @nospecialize(job::CompilerJob), opt_level)
add!(mpm, NewPMFunctionPassManager()) do fpm
buildLoopOptimizerPipeline(fpm, job, opt_level)
buildScalarOptimizerPipeline(fpm, job, opt_level)
if uses_julia_runtime(job) && opt_level >= 2
# XXX: we disable vectorization, as this generally isn't useful for GPU targets
# and actually causes issues with some back-end compilers (like Metal).
# TODO: Make this not dependent on `uses_julia_runtime` (likely CPU), but it's own control
if (can_vectorize(job)) && opt_level >= 2
buildVectorPipeline(fpm, job, opt_level)
end
if isdebug(:optim)
Expand Down
Loading