Skip to content

Default to the job's optimize parameter in code_llvm#773

Merged
christiangnrd merged 1 commit intomasterfrom
codellvm
Mar 22, 2026
Merged

Default to the job's optimize parameter in code_llvm#773
christiangnrd merged 1 commit intomasterfrom
codellvm

Conversation

@christiangnrd
Copy link
Member

@christiangnrd christiangnrd commented Mar 19, 2026

The backends don't propagate their optimize kwarg because it gets slurped up by split_kwargs. This defaults to using that parameter, but it can still be overwritten if needed.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/src/reflection.jl b/src/reflection.jl
index a180f2f..1b29bf6 100644
--- a/src/reflection.jl
+++ b/src/reflection.jl
@@ -183,7 +183,8 @@ The following keyword arguments are supported:
 
 See also: [`@device_code_llvm`](@ref), `InteractiveUtils.code_llvm`
 """
-function code_llvm(io::IO, @nospecialize(job::CompilerJob); optimize::Bool=job.config.optimize, raw::Bool=false,
+function code_llvm(
+        io::IO, @nospecialize(job::CompilerJob); optimize::Bool = job.config.optimize, raw::Bool = false,
                    debuginfo::Symbol=:default, dump_module::Bool=false, kwargs...)
     # NOTE: jl_dump_function_ir supports stripping metadata, so don't do it in the driver
     config = CompilerConfig(job.config; validate=false, strip=false, optimize)
@@ -383,7 +384,7 @@ macro device_code(ex...)
         end
 
         open(joinpath(dir, "$fn.opt.ll"), "w") do io
-            code_llvm(io, job; dump_module=true, raw=true, optimize=true)
+            code_llvm(io, job; dump_module = true, raw = true, optimize = true)
         end
 
         open(joinpath(dir, "$fn.asm"), "w") do io

@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.79%. Comparing base (12cbca4) to head (7c9c039).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/reflection.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #773   +/-   ##
=======================================
  Coverage   74.79%   74.79%           
=======================================
  Files          24       24           
  Lines        3781     3781           
=======================================
  Hits         2828     2828           
  Misses        953      953           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christiangnrd christiangnrd force-pushed the codellvm branch 2 times, most recently from dc3395a to 0e32b9a Compare March 21, 2026 22:27
@christiangnrd christiangnrd merged commit 21b7115 into master Mar 22, 2026
32 of 38 checks passed
@christiangnrd christiangnrd deleted the codellvm branch March 22, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants