Skip to content

Split instcombine test file into one file per pattern (#519).#616

Merged
math-fehr merged 1 commit into
mainfrom
sishtiaq/519-split-instcombine-test
May 21, 2026
Merged

Split instcombine test file into one file per pattern (#519).#616
math-fehr merged 1 commit into
mainfrom
sishtiaq/519-split-instcombine-test

Conversation

@sishtiaq
Copy link
Copy Markdown
Collaborator

I've split Test/Passes/instcombine.mlir into 16 files in Test/Passes/InstCombine.
What I don't know, so would appreciate feedback on:

  1. Is this the right granularity to split at? It's basically file-per-pattern, but one person's pattern is another person's multi-pattern:)
  2. The names of the files. The other tests in Test/Passes aren't super descriptive, so I've kept the new names high-level.

@sishtiaq sishtiaq requested a review from math-fehr May 20, 2026 18:17
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

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: 4d589ab Previous: 758a751 Ratio
add-fold-worklist/create 2209000 ns (± 64817) 1832000 ns (± 92681) 1.21
add-fold-worklist/rewrite 3772000 ns (± 46208) 3432000 ns (± 108244) 1.10
add-fold-worklist-local/create 2251000 ns (± 109363) 1980000 ns (± 89350) 1.14
add-fold-worklist-local/rewrite 3216000 ns (± 30372) 2864000 ns (± 24201) 1.12
add-zero-worklist/create 2347000 ns (± 97712) 1825000 ns (± 20379) 1.29
add-zero-worklist/rewrite 2604000 ns (± 55969) 2166000 ns (± 24366) 1.20
add-zero-reuse-worklist/create 1844000 ns (± 92673) 1558000 ns (± 32059) 1.18
add-zero-reuse-worklist/rewrite 2084500 ns (± 49605) 1768000 ns (± 19705) 1.18
mul-two-worklist/create 2248000 ns (± 32538) 1832000 ns (± 73493) 1.23
mul-two-worklist/rewrite 5443000 ns (± 63057) 4780000 ns (± 35704) 1.14
add-fold-forwards/create 2300000 ns (± 40856) 1993000 ns (± 82291) 1.15
add-fold-forwards/rewrite 3110000 ns (± 27727) 2711500 ns (± 136664) 1.15
add-zero-forwards/create 2301000 ns (± 22832) 1922000 ns (± 92695) 1.20
add-zero-forwards/rewrite 2095000 ns (± 32129) 1793000 ns (± 68165) 1.17
add-zero-reuse-forwards/create 1947500 ns (± 93571) 1558500 ns (± 78046) 1.25
add-zero-reuse-forwards/rewrite 1673500 ns (± 30651) 1388000 ns (± 64317) 1.21
mul-two-forwards/create 2345000 ns (± 54429) 1824000 ns (± 71272) 1.29
mul-two-forwards/rewrite 3796000 ns (± 75108) 3254000 ns (± 90075) 1.17
add-zero-reuse-first/create 1962000 ns (± 82770) 1563500 ns (± 122105) 1.25
add-zero-reuse-first/rewrite 8000 ns (± 405) 10000 ns (± 2383) 0.80
add-zero-lots-of-reuse-first/create 1939000 ns (± 92326) 1549000 ns (± 25383) 1.25
add-zero-lots-of-reuse-first/rewrite 888000 ns (± 26529) 788000 ns (± 19741) 1.13

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

@sishtiaq sishtiaq force-pushed the sishtiaq/519-split-instcombine-test branch from 1bb7f79 to ddaf44d Compare May 20, 2026 18:20
@sishtiaq sishtiaq marked this pull request as ready for review May 20, 2026 18:24
@regehr
Copy link
Copy Markdown
Collaborator

regehr commented May 21, 2026

this LGTM! although I don't really have any particular strong feelings about files containing fewer vs. more test cases

Copy link
Copy Markdown
Contributor

@luisacicolini luisacicolini left a comment

Choose a reason for hiding this comment

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

Thank you, lgtm!
I don't have particularly strong feelings, although looking at llvm's test organization I wonder if we might want one test per operation and some "special" files for particular rewrites (e.g., de morgan)? Not sure.

@sishtiaq sishtiaq force-pushed the sishtiaq/519-split-instcombine-test branch from ddaf44d to 5230537 Compare May 21, 2026 12:48
@sishtiaq sishtiaq force-pushed the sishtiaq/519-split-instcombine-test branch from 5230537 to 4d589ab Compare May 21, 2026 12:50
@sishtiaq
Copy link
Copy Markdown
Collaborator Author

Added test.test in mult_two.mlir to use the mult_two variable.

Copy link
Copy Markdown
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@math-fehr math-fehr added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit c832609 May 21, 2026
5 checks passed
@math-fehr math-fehr deleted the sishtiaq/519-split-instcombine-test branch May 21, 2026 22:43
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.

4 participants