Tentative implementation of HasIRContext. - #417
Conversation
|
!radar |
|
Benchmark results for 3a90a7a against c2650f2 are in! @math-fehr Large changes (13🟥)
Medium changes (1🟥)
Small changes (7🟥)
|
There was a problem hiding this comment.
VeIR Benchmarks
Details
| Benchmark suite | Current: 205d7c1 | Previous: 964db92 | Ratio |
|---|---|---|---|
add-fold-worklist/create |
2611000 ns |
2240000 ns |
1.17 |
add-fold-worklist/rewrite |
3806000 ns |
3814000 ns |
1.00 |
add-fold-worklist-local/create |
2895000 ns |
2265000 ns |
1.28 |
add-fold-worklist-local/rewrite |
3190000 ns |
3205000 ns |
1.00 |
add-zero-worklist/create |
3281000 ns |
2441000 ns |
1.34 |
add-zero-worklist/rewrite |
2550000 ns |
2605000 ns |
0.98 |
add-zero-reuse-worklist/create |
2584000 ns |
2025000 ns |
1.28 |
add-zero-reuse-worklist/rewrite |
2098000 ns |
2000000 ns |
1.05 |
mul-two-worklist/create |
2855000 ns |
2439000 ns |
1.17 |
mul-two-worklist/rewrite |
5324000 ns |
5524000 ns |
0.96 |
add-fold-forwards/create |
3034000 ns |
2262000 ns |
1.34 |
add-fold-forwards/rewrite |
3083000 ns |
3141000 ns |
0.98 |
add-zero-forwards/create |
3050000 ns |
2239000 ns |
1.36 |
add-zero-forwards/rewrite |
2062000 ns |
2026000 ns |
1.02 |
add-zero-reuse-forwards/create |
2593000 ns |
1850000 ns |
1.40 |
add-zero-reuse-forwards/rewrite |
1711000 ns |
1580000 ns |
1.08 |
mul-two-forwards/create |
3001000 ns |
2285000 ns |
1.31 |
mul-two-forwards/rewrite |
3717000 ns |
3771000 ns |
0.99 |
add-zero-reuse-first/create |
2742000 ns |
1865000 ns |
1.47 |
add-zero-reuse-first/rewrite |
8000 ns |
8000 ns |
1 |
add-zero-lots-of-reuse-first/create |
2669000 ns |
1834000 ns |
1.46 |
add-zero-lots-of-reuse-first/rewrite |
955000 ns |
788000 ns |
1.21 |
This comment was automatically generated by workflow using github-action-benchmark.
bacc378 to
876c9b5
Compare
|
!radar |
|
Benchmark results for 876c9b5 against c2650f2 are in! @math-fehr Large changes (23🟥) Too many entries to display here. View the full report on radar instead. Medium changes (1🟥)
Small changes (5🟥)
|
|
Why did you replace all the grind call in |
|
I'll update it again good point. The issue was originally that InBounds cannot be used by grind anymore, so I changed them. But now I realized that you can use inBounds_def if the typeclass is already in grind, and it seems I missed some, I'll fix that. |
876c9b5 to
205d7c1
Compare
|
Nice. This seems to go in a great direction. |
|
Just so you know, I'm first testing this on |
Tentative implementation on the entire file Workaround a Lean bug
205d7c1 to
3726a62
Compare
Currently, we have
IRContext,WfIRContext,Rewriter, andWfRewriterthat all "contains" anIRContext.What we would like to have is a coercion from all of these to
IRContext. However, asIRContexthas a parameter that we always implicitely deduce, the coercion almost never works.One of the solution would be to reimplement all getters so that they can use these different classes, but I wanted to try if there was another solution before trying this.
The implementation here uses a new typeclass
HasIRContext, which is essentially just the coercion from the types toIRContext.Please let me know what you think of the design