Skip to content

Commit

Permalink
Remove invariant loads on primal computation
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Mar 5, 2024
1 parent b71fc1c commit 11608c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4366,6 +4366,9 @@ function GPUCompiler.codegen(output::Symbol, job::CompilerJob{<:EnzymeTarget};

mod, meta = GPUCompiler.codegen(:llvm, primal_job; optimize=false, toplevel=toplevel, cleanup=false, validate=false, parent_job=parent_job)
prepare_llvm(mod, primal_job, meta)
for f in functions(mod)
permit_inlining!(f)
end

LLVM.ModulePassManager() do pm
API.AddPreserveNVVMPass!(pm, #=Begin=#true)
Expand Down
1 change: 1 addition & 0 deletions src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,7 @@ function post_optimze!(mod, tm, machine=true)
addOptimizationPasses!(pm)
run!(pm, mod)
end
println(string(mod))
if machine
# TODO enable validate_return_roots
# validate_return_roots!(mod)
Expand Down

0 comments on commit 11608c9

Please sign in to comment.