Skip to content

Fix ffi abs_cstring#2718

Merged
wsmoses merged 1 commit intomainfrom
fcstr
Oct 30, 2025
Merged

Fix ffi abs_cstring#2718
wsmoses merged 1 commit intomainfrom
fcstr

Conversation

@wsmoses
Copy link
Member

@wsmoses wsmoses commented Oct 30, 2025

Fixes #2717

@github-actions
Copy link
Contributor

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/absint.jl b/src/absint.jl
index 9725895e..9905c68b 100644
--- a/src/absint.jl
+++ b/src/absint.jl
@@ -876,19 +876,19 @@ function abs_cstring(@nospecialize(arg::LLVM.Value))::Tuple{Bool, String}
                 break
             end
         end
-        
-        larg = nothing
-        if LLVM.API.LLVMGetValueKind(ce) == LLVM.API.LLVMGlobalAliasValueKind
-            larg = LLVM.Value(ccall((:LLVMAliasGetAliasee, LLVM.API.libllvm), LLVM.API.LLVMValueRef, (LLVM.API.LLVMValueRef,), ce))
-        elseif isa(ce, LLVM.GlobalVariable)
-            larg = LLVM.initializer(ce)
-        end
 
-        if larg !== nothing
-            if (isa(larg, LLVM.ConstantArray) || isa(larg, LLVM.ConstantDataArray)) && eltype(value_type(larg)) == LLVM.IntType(8)
-                return (true, String(map(Base.Fix1(convert, UInt8), collect(larg)[1:(end - 1)])))
+    larg = nothing
+    if LLVM.API.LLVMGetValueKind(ce) == LLVM.API.LLVMGlobalAliasValueKind
+        larg = LLVM.Value(ccall((:LLVMAliasGetAliasee, LLVM.API.libllvm), LLVM.API.LLVMValueRef, (LLVM.API.LLVMValueRef,), ce))
+    elseif isa(ce, LLVM.GlobalVariable)
+        larg = LLVM.initializer(ce)
+    end
+
+    if larg !== nothing
+        if (isa(larg, LLVM.ConstantArray) || isa(larg, LLVM.ConstantDataArray)) && eltype(value_type(larg)) == LLVM.IntType(8)
+            return (true, String(map(Base.Fix1(convert, UInt8), collect(larg)[1:(end - 1)])))
             end
 
-        end
+    end
     return (false, "")
 end

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.61%. Comparing base (107b327) to head (7382f82).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/absint.jl 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2718      +/-   ##
==========================================
- Coverage   72.61%   72.61%   -0.01%     
==========================================
  Files          58       58              
  Lines       18746    18749       +3     
==========================================
+ Hits        13613    13614       +1     
- Misses       5133     5135       +2     

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

@github-actions
Copy link
Contributor

Benchmark Results

main 7382f82... main / 7382f82...
basics/make_zero/namedtuple 0.0554 ± 0.008 μs 0.0516 ± 0.0093 μs 1.07 ± 0.25
basics/make_zero/struct 0.252 ± 0.0081 μs 0.248 ± 0.0069 μs 1.01 ± 0.043
basics/overhead 3.18 ± 0.003 ns 3.18 ± 0.002 ns 1 ± 0.0011
basics/remake_zero!/namedtuple 0.225 ± 0.015 μs 0.225 ± 0.011 μs 1 ± 0.082
basics/remake_zero!/struct 0.225 ± 0.015 μs 0.225 ± 0.013 μs 1 ± 0.088
fold_broadcast/multidim_sum_bcast/1D 10.9 ± 1 μs 11 ± 0.68 μs 0.991 ± 0.11
fold_broadcast/multidim_sum_bcast/2D 12.2 ± 0.35 μs 12.2 ± 0.35 μs 1 ± 0.04
time_to_load 1.23 ± 0.0032 s 1.23 ± 0.0095 s 1.01 ± 0.0082

Benchmark Plots

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

@wsmoses wsmoses merged commit 974b840 into main Oct 30, 2025
46 of 49 checks passed
@wsmoses wsmoses deleted the fcstr branch October 30, 2025 03:45
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.

[1.12] FFI handling

1 participant