Commit f273b16
committed
Per-Fusion Axioms and Metadata
Moved `axioms_` and `metadata_` from `IrContainer` to the `Fusion` class.
This completes the deprecation of `parent_` usage for val-creating methods,
which was necessary because `parent_` implies a 1-1 relationship
(container → Fusion), but Phase 2 has 1-many (shared containers).
Methods that used `parent_` to create vals were moved to Fusion:
- `metadataOf(Val*)` - Now uses `v->container()` to get owning Fusion
- `axioms()` - Now creates axiom vals owned by `this` Fusion
- `assumePositive/assumeNonNegative` - Now adds to `this` Fusion's axioms
- Added `axioms_` and `metadata_` private members
- Changed method declarations from forwarding to actual implementations
- Added includes for `ir/builder.h` and `ir/internal_nodes.h`
- Implemented `metadataOf()`, `axioms()`, `assumePositive()`,
`assumeNonNegative()` methods
- Updated `clear()` to reset `axioms_` and `metadata_`
- Removed `metadataOf()`, `axioms()`, `assumePositive()`,
`assumeNonNegative()` declarations
- Removed `lazyInitAxioms()` declaration
- Removed `axioms_` and `metadata_` members
- Removed implementations of above methods
- Updated `IrContainer::swap` to remove axioms_/metadata_ swapping
- Updated `IrContainer::copy` to remove axioms_/metadata_ handling
- Updated `IrContainer::clear` to remove axioms_/metadata_ clearing
Each Fusion now has its own axioms and metadata cache. This ensures:
1. No ownership conflicts when multiple Fusions share an IrContainer
2. Correct behavior when one Fusion is destroyed (doesn't affect others)
3. Lazy creation pattern preserved (create on first access)
This is a prerequisite for the copy/move semantics changes which will
swap/transfer these per-Fusion members.1 parent d6c9b7c commit f273b16
4 files changed
Lines changed: 80 additions & 90 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| |||
768 | 774 | | |
769 | 775 | | |
770 | 776 | | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
771 | 825 | | |
772 | 826 | | |
773 | 827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
570 | | - | |
571 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
575 | | - | |
576 | | - | |
| 574 | + | |
577 | 575 | | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
| 576 | + | |
| 577 | + | |
585 | 578 | | |
586 | 579 | | |
587 | 580 | | |
| |||
661 | 654 | | |
662 | 655 | | |
663 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
664 | 665 | | |
665 | 666 | | |
666 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 86 | + | |
| 87 | + | |
91 | 88 | | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
| 92 | + | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
| |||
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 114 | + | |
124 | 115 | | |
125 | 116 | | |
126 | 117 | | |
| |||
201 | 192 | | |
202 | 193 | | |
203 | 194 | | |
204 | | - | |
205 | 195 | | |
206 | | - | |
207 | 196 | | |
208 | 197 | | |
209 | 198 | | |
| |||
239 | 228 | | |
240 | 229 | | |
241 | 230 | | |
242 | | - | |
243 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
244 | 234 | | |
245 | 235 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | 236 | | |
288 | 237 | | |
289 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 96 | | |
107 | 97 | | |
108 | 98 | | |
| |||
136 | 126 | | |
137 | 127 | | |
138 | 128 | | |
139 | | - | |
140 | | - | |
141 | 129 | | |
142 | 130 | | |
143 | 131 | | |
| |||
173 | 161 | | |
174 | 162 | | |
175 | 163 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 164 | + | |
| 165 | + | |
180 | 166 | | |
181 | 167 | | |
182 | 168 | | |
| |||
0 commit comments