Merge dynamic constant propagation into the constprop pass - #146
Merge dynamic constant propagation into the constprop pass#146amarkdotdev wants to merge 1 commit into
Conversation
Both transforms apply the same rewrite; the dynamic path only swaps in a richer analysis. One MLIR pass now covers both configs. Fixes google#19 Signed-off-by: Aaron <amark@g.jct.ac.il>
|
Thanks for the contribution! We currently only have a process to sync internal changes to github, but not the opposite direction. I'll need to manually create a matching internal change and merge your PR at just the right time :) This will take some time (maybe several days) to figure out, so please be patient in the meantime. |
| // Transforms `op` using the dynamic constant propagation analysis. | ||
| // | ||
| // `babel` is used to minify the prelude. | ||
| // Dynamic constant propagation is the same rewrite as ordinary constant |
There was a problem hiding this comment.
Can we do a more aggressive refactor:
Merge maldoca/js/ir/transforms/{constant_propagation,dynamic_constant_propagation} into a single directory;
Similarly, merge maldoca/js/ir/analyses/{constant_propagation,dynamic_constant_propagation} into a single directory;
Basically, we would just always run the dynamic version, and if the user doesn't provide a prelude, the algorithm naturally falls back to the non-dynamic version.
Let me know if this makes sense!
Ordinary and dynamic constant propagation run the same rewrite; the dynamic path only loads
JsirDynamicConstantPropagationAnalysis(prelude matching) first. There is no reason for two MLIR pass classes.JsirConstantPropagationPassnow handles bothJsirTransformConfigkinds.PerformDynamicConstantPropagationlives next toPerformConstantPropagation, and the old dynamic pass.ccis gone. CLI names (constprop/dynconstprop) and proto fields are unchanged.Fixes #19