Skip to content

Commit 1dc572f

Browse files
committed
Address code review comments
1 parent 2aa893d commit 1dc572f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/gcn.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,5 @@ function emit_trap!(job::CompilerJob{GCNCompilerTarget}, builder, mod, inst)
124124
end
125125
call!(builder, trap_ft, trap)
126126
end
127+
128+
can_vectorize(job::CompilerJob{GCNCompilerTarget}) = true

src/native.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ end
3535

3636
runtime_slug(job::CompilerJob{NativeCompilerTarget}) = "native_$(job.config.target.cpu)-$(hash(job.config.target.features))$(job.config.target.jlruntime ? "-jlrt" : "")"
3737
uses_julia_runtime(job::CompilerJob{NativeCompilerTarget}) = job.config.target.jlruntime
38+
can_vectorize(job::CompilerJob{NativeCompilerTarget}) = true

src/optim.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ function buildNewPMPipeline!(mpm, @nospecialize(job::CompilerJob), opt_level)
3131
add!(mpm, NewPMFunctionPassManager()) do fpm
3232
buildLoopOptimizerPipeline(fpm, job, opt_level)
3333
buildScalarOptimizerPipeline(fpm, job, opt_level)
34-
if (uses_julia_runtime(job) || can_vectorize(job)) && opt_level >= 2
35-
# XXX: we disable vectorization, as this generally isn't useful for GPU targets
36-
# and actually causes issues with some back-end compilers (like Metal).
37-
# TODO: Make this not dependent on `uses_julia_runtime` (likely CPU), but it's own control
34+
if (can_vectorize(job)) && opt_level >= 2
3835
buildVectorPipeline(fpm, job, opt_level)
3936
end
4037
if isdebug(:optim)

0 commit comments

Comments
 (0)