Skip to content

1.12 fix jl_lazy_load#2797

Merged
wsmoses merged 2 commits intomainfrom
jl_lazy_load
Nov 21, 2025
Merged

1.12 fix jl_lazy_load#2797
wsmoses merged 2 commits intomainfrom
jl_lazy_load

Conversation

@wsmoses
Copy link
Member

@wsmoses wsmoses commented Nov 21, 2025

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

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

Click here to view the suggested changes.
diff --git a/src/compiler/validation.jl b/src/compiler/validation.jl
index 70b7d5bb..85803ffe 100644
--- a/src/compiler/validation.jl
+++ b/src/compiler/validation.jl
@@ -786,8 +786,8 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
             fname = ops[2]
 
             if isa(flib, LLVM.LoadInst)
-                op, off = get_base_and_offset(operands(flib)[1]; inttoptr=true)
-            
+                op, off = get_base_and_offset(operands(flib)[1]; inttoptr = true)
+
                 if isa(op, LLVM.LoadInst)
                     pop, _ = get_base_and_offset(operands(op)[1]; offsetAllowed=false, inttoptr=true)
 
@@ -796,7 +796,7 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
                 
                         rep = zop
                         PT = value_type(rep)
-                        if isa(PT, LLVM.PointerType) 
+                        if isa(PT, LLVM.PointerType)
                             rep = LLVM.const_inttoptr(rep, LLVM.PointerType(eltype(PT)))
                             rep = LLVM.const_addrspacecast(rep, PT)
                             replace_uses!(pop, rep)
@@ -808,9 +808,9 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
                 end
                         
                 if isa(op, ConstantInt)
-	    	    @static if VERSION < v"1.12"
-			off += 8
-		    end
+                    @static if VERSION < v"1.12"
+                        off += 8
+                    end
                     rep = reinterpret(Ptr{Cvoid}, convert(Csize_t, op) + off)
                     ld = unsafe_load(convert(Ptr{Ptr{Cvoid}}, rep))
                     flib = Base.unsafe_pointer_to_objref(ld)
@@ -833,8 +833,8 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
                fname = String(map(Base.Fix1(convert, UInt8), collect(fname)[1:(end-1)]))
             end
 
-	    if !isa(fname, String) || !isa(flib, String)
-		return
+            if !isa(fname, String) || !isa(flib, String)
+                return
             end
 
             found, replaceWith = try_import_llvmbc(mod, flib, fname, imported)

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

Benchmark Results

main 1964148... main / 1964148...
basics/make_zero/namedtuple 0.0521 ± 0.0024 μs 0.0524 ± 0.0024 μs 0.994 ± 0.064
basics/make_zero/struct 0.252 ± 0.0053 μs 0.272 ± 0.0051 μs 0.927 ± 0.026
basics/overhead 5.25 ± 0.92 ns 4.65 ± 0.01 ns 1.13 ± 0.2
basics/remake_zero!/namedtuple 0.233 ± 0.0082 μs 0.239 ± 0.0084 μs 0.974 ± 0.048
basics/remake_zero!/struct 0.232 ± 0.0078 μs 0.241 ± 0.011 μs 0.963 ± 0.054
fold_broadcast/multidim_sum_bcast/1D 10.3 ± 0.38 μs 10.3 ± 0.21 μs 1 ± 0.042
fold_broadcast/multidim_sum_bcast/2D 12.1 ± 0.25 μs 12.2 ± 0.32 μs 0.994 ± 0.033
time_to_load 1.27 ± 0.012 s 1.25 ± 0.016 s 1.02 ± 0.016

Benchmark Plots

A plot of the benchmark results has been uploaded as an artifact at https://github.com/EnzymeAD/Enzyme.jl/actions/runs/19574786096/artifacts/4641666652.

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.05%. Comparing base (70eef9d) to head (1964148).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/compiler.jl 50.00% 1 Missing ⚠️
src/compiler/validation.jl 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2797      +/-   ##
==========================================
- Coverage   68.06%   68.05%   -0.01%     
==========================================
  Files          58       58              
  Lines       20495    20499       +4     
==========================================
+ Hits        13950    13951       +1     
- Misses       6545     6548       +3     

☔ 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.

@wsmoses wsmoses merged commit 56fa81f into main Nov 21, 2025
48 of 54 checks passed
@wsmoses wsmoses deleted the jl_lazy_load branch November 21, 2025 15:32
@giordano giordano added the Julia v1.12 Related to compatibility with Julia v1.12 label Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Julia v1.12 Related to compatibility with Julia v1.12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants