Skip to content
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

Remove invariant loads on primal computation #1325

Merged
merged 1 commit into from
Mar 22, 2024
Merged
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
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)
Comment on lines 4366 to 4367
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
mod, meta = GPUCompiler.codegen(:llvm, primal_job; optimize=false, toplevel=toplevel, cleanup=false, validate=false, parent_job=parent_job)
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
API.AddPreserveNVVMPass!(pm, #=Begin=#true)
API.AddPreserveNVVMPass!(pm, true) #=Begin=#

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vchuravy @simsurace so I actually disagree with this part of the autoformatter, since I would very much like to know what that arg corresponds to (as presently specified with a comment).

What's the right way to do so in-format?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good question. It seems to be a known issue domluna/JuliaFormatter.jl#562

Expand Down
Loading