Skip to content

Commit 2c3f1c8

Browse files
author
Patrick Häcker
committed
Filter even more LLVM ops during testing
1 parent ff36ec6 commit 2c3f1c8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,14 @@ end
529529
# Performance invariants
530530
# ============================================================================
531531

532-
# Capture LLVM IR of `f(::types...)` and return the lines containing actual operations: drop preamble (`define`/`declare`), labels, braces, comments, blank lines, the trailing `ret` (bookkeeping, not an operation — when the caller inlines `f`, only the operation lines remain), and `--code-coverage` counter increments (`atomicrmw add` into a fixed pointer) so the count is the same with or without coverage instrumentation.
532+
# Capture LLVM IR of `f(::types...)` and return the lines containing actual operations: drop preamble (`define`/`declare`), labels, braces, comments, blank lines, the trailing `ret` (bookkeeping, not an operation — when the caller inlines `f`, only the operation lines remain), and `--code-coverage` line counters so the result is the same with or without coverage instrumentation. The counter is a single `atomicrmw add` through a fixed pointer on Julia 1.11+, or a `load volatile`/`add`/`store volatile` triple through `inttoptr` into a `%lcnt` temporary on Julia 1.10; both carry per-location pointer addresses that never agree between two functions.
533533
function llvm_ops(f, types)
534534
io = IOBuffer()
535535
InteractiveUtils.code_llvm(io, f, types; debuginfo=:none, raw=false)
536536
lines = split(io |> take! |> String, "\n")
537537
filter(lines) do l
538538
!contains(l, r"^\s*($|;|define|declare|\}|\{\s*$|.+:\s*$|ret\b)") &&
539-
!contains(l, "atomicrmw add ptr inttoptr")
539+
!contains(l, "inttoptr") && !contains(l, "%lcnt")
540540
end
541541
end
542542

0 commit comments

Comments
 (0)