-
Notifications
You must be signed in to change notification settings - Fork 33
vendor optimize #703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vendor optimize #703
Conversation
| # From https://github.com/JuliaGPU/GPUCompiler.jl/blob/7b9322faa34685026c4601a5084eecf5a5d7f3fe/src/ptx.jl#L149 | ||
| function vendored_optimize_module!(@nospecialize(job), | ||
| mod::LLVM.Module, | ||
| instcombine::Bool=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| # From https://github.com/JuliaGPU/GPUCompiler.jl/blob/7b9322faa34685026c4601a5084eecf5a5d7f3fe/src/ptx.jl#L149 | |
| function vendored_optimize_module!(@nospecialize(job), | |
| mod::LLVM.Module, | |
| instcombine::Bool=false | |
| function vendored_optimize_module!( | |
| @nospecialize(job), mod::LLVM.Module, instcombine::Bool=false | |
| ) |
| instcombine::Bool=false | ||
| ) | ||
| tm = GPUCompiler.llvm_machine(job.config.target) | ||
| # TODO: Use the registered target passes (JuliaGPU/GPUCompiler.jl#450) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| # TODO: Use the registered target passes (JuliaGPU/GPUCompiler.jl#450) | |
| LLVM.@dispose pb = LLVM.NewPMPassBuilder() begin |
ext/ReactantCUDAExt.jl
Outdated
| LLVM.register!(pb, LLVM.NVVMReflectPass()) | ||
|
|
||
| LLVM.add!(pb, LLVM.NewPMFunctionPassManager()) do fpm | ||
| # TODO: need to run this earlier; optimize_module! is called after addOptimizationPasses! | ||
| LLVM.add!(fpm, LLVM.NVVMReflectPass()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| LLVM.register!(pb, LLVM.NVVMReflectPass()) | |
| LLVM.add!(pb, LLVM.NewPMFunctionPassManager()) do fpm | |
| # TODO: need to run this earlier; optimize_module! is called after addOptimizationPasses! | |
| LLVM.add!(fpm, LLVM.NVVMReflectPass()) | |
| LLVM.register!(pb, GPUCompiler.NVVMReflectPass()) | |
| LLVM.add!(pb, LLVM.NewPMFunctionPassManager()) do fpm | |
| # TODO: need to run this earlier; optimize_module! is called after addOptimizationPasses! | |
| LLVM.add!(fpm, GPUCompiler.NVVMReflectPass()) |
| LLVM.add!(fpm, LLVM.InstSimplifyPass()) # clean-up redundancy | ||
| end | ||
| LLVM.add!(fpm, LLVM.NewPMLoopPassManager(; use_memory_ssa=true)) do lpm | ||
| LLVM.add!(lpm, LLVM.LICMPass()) # the inner runtime check might be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| LLVM.add!(lpm, LLVM.LICMPass()) # the inner runtime check might be | |
| # outer loop invariant |
* vendor optimize * Update ReactantCUDAExt.jl * Update ext/ReactantCUDAExt.jl * Update ext/ReactantCUDAExt.jl * try forcing random seed for basic test --------- Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com>
@gbaraldi vendoring this in interim to unblock kernels