Skip to content

feat(verifier): check dominance#944

Open
regehr wants to merge 12 commits into
mainfrom
regehr/dominance-checker
Open

feat(verifier): check dominance#944
regehr wants to merge 12 commits into
mainfrom
regehr/dominance-checker

Conversation

@regehr

@regehr regehr commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

ok this is a substantial tooling up of our verifier. the patch got bigger and messier than I wanted, but I think it's all good changes.
the main thing this does is attempts to make our verifier return the same verdict as MLIR's verifier, for a variety of interesting cases. so there are lots of new tests! and also there's a new test predicate VEIR_MLIR_SAME_VERDICT that insists that either mlir-opt and veir-opt both accept or both reject a test case.
I had to change a bunch of unrelated test cases-- these are ones that are rejected by upstream MLIR, and now are rejected by Veir.
the other goal of this patch is to hopefully set us up to de-axiomitize Veir/Dominance.lean. our goal is that this verifier acts as a dynamic checker for freshly parsed code, and after that all transformations must prove that their output is verified if their input is.

@regehr regehr self-assigned this Jun 28, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

VeIR Benchmarks

Details
Benchmark suite Current: 41ff357 Previous: 0fb06d1 Ratio
add-fold-worklist/create 2198000 ns (± 36915) 2363500 ns (± 142914) 0.93
add-fold-worklist/rewrite 3897000 ns (± 31134) 3862000 ns (± 89211) 1.01
add-fold-worklist-local/create 2171000 ns (± 99868) 2319000 ns (± 43764) 0.94
add-fold-worklist-local/rewrite 3350000 ns (± 38895) 3243000 ns (± 16956) 1.03
add-zero-worklist/create 2217000 ns (± 44471) 2370000 ns (± 67833) 0.94
add-zero-worklist/rewrite 2494000 ns (± 69826) 2440000 ns (± 110726) 1.02
add-zero-reuse-worklist/create 1844000 ns (± 85894) 1952000 ns (± 79423) 0.94
add-zero-reuse-worklist/rewrite 2118000 ns (± 28323) 2031000 ns (± 45637) 1.04
mul-two-worklist/create 2150000 ns (± 108616) 2318500 ns (± 113259) 0.93
mul-two-worklist/rewrite 5544500 ns (± 60446) 5460000 ns (± 67150) 1.02
add-fold-forwards/create 2195000 ns (± 59031) 2233000 ns (± 111607) 0.98
add-fold-forwards/rewrite 2953000 ns (± 75522) 2892000 ns (± 47901) 1.02
add-zero-forwards/create 2188000 ns (± 71381) 2138000 ns (± 94887) 1.02
add-zero-forwards/rewrite 1901000 ns (± 22782) 1853000 ns (± 20849) 1.03
add-zero-reuse-forwards/create 1857500 ns (± 91511) 1965000 ns (± 32277) 0.95
add-zero-reuse-forwards/rewrite 1538000 ns (± 33289) 1560000 ns (± 55053) 0.99
mul-two-forwards/create 2160000 ns (± 108109) 2218000 ns (± 110558) 0.97
mul-two-forwards/rewrite 3618000 ns (± 73790) 3577000 ns (± 74570) 1.01
add-zero-reuse-first/create 1824000 ns (± 76020) 1857500 ns (± 121827) 0.98
add-zero-reuse-first/rewrite 8000 ns (± 2763) 8000 ns (± 1925) 1
add-zero-lots-of-reuse-first/create 1852000 ns (± 84841) 1907500 ns (± 97143) 0.97
add-zero-lots-of-reuse-first/rewrite 784000 ns (± 19370) 764000 ns (± 49366) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

@axelcool1234 axelcool1234 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My first skim of this PR. Will give another review round when I'm not busy :)

Comment thread Veir/IR/Dominance.lean
Comment thread Veir/IR/Dominance.lean
@axelcool1234

Copy link
Copy Markdown
Collaborator

For the dominance analysis changes, LGTM :)

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