Repository navigation
compiler: Preserve compilation invariants under symbol renaming - #3084
FabioLuporini wants to merge 14 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3084 +/- ##
===========================================
- Coverage 84.28% 53.04% -31.25%
===========================================
Files 258 258
Lines 57469 57601 +132
Branches 4914 4918 +4
===========================================
- Hits 48439 30553 -17886
- Misses 8206 26019 +17813
- Partials 824 1029 +205
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| self.reserved.update(i.name for e in exprs for i in e.free_symbols) | ||
|
|
||
| # Before indexification, a Function's free symbols omit its own name | ||
| self.reserved.update(i.name for i in retrieve_functions(exprs)) |
Retrieve Functions uniquely when reserving names, share the default uxreplace traversal through an explicit helper, and remove the unneeded Operator name from the input-name collision test. Keep the CSE position map to avoid repeated linear scans of exprs. In a comparison of the actual topological sort with 128 independent CTemps, including map construction, cached lookup took 39 ms versus 1255 ms for list.index. Add a comment explaining the cached lookup. Validation: focused C/OpenMP regressions (64 passed, 1 xfailed) and C++/OpenMP regressions (62 passed, 1 xfailed). The full CPU audit found separate numerical failures already present before the rebase.
7a1eb98 to
0325dd2
Compare
|
|
||
| def __init__(self, settings=None): | ||
| super().__init__(settings) | ||
| self._order = self.order |
|
|
||
| def __init__(self, settings=None): | ||
| super().__init__(settings) | ||
| self._order = self.order |
|
|
||
|
|
||
| @_uxreplace_dispatch.register(dict) | ||
| @_uxreplace_dispatch.register(frozendict) |
There was a problem hiding this comment.
This dispatcher currently turns a frozendict into a dict. You need to add a cast at the end to make sure it's the correct type.
| @_uxreplace_handle.register(UnevalAdd) | ||
| @_uxreplace_handle.register(UnevalMul) |
There was a problem hiding this comment.
Why not register UnevalMixin instead of having multiple registrations here?
Generated temporary names can affect CSE scheduling, while symbolic substitutions can reorder lowered arithmetic or leave stale references in auxiliary metadata. Application identifiers such as r0 can also collide with compiler-generated temporaries.
This PR addresses these issues and provides a final IET customization point for backend naming passes: