Hacker News new | ask | show | jobs
by conwor 2757 days ago
Thank you for the feedback!

This transformation is encoded exactly like simple and declarative term rewriting rule, and it may be called from any phase of compiler, except the last one when IR passed through backend and IR objects acquire machine code attributes - registers and code ordering. But we guarantee that at this phase there are no terms in IR applicable to this and other similar simple rules.

During IR "lowering" we do not rebuild the whole IR into some other form, we just rebuild parts of them, which are too high-level for backend. Additions are obviously not among them, so the is no problem for using this transformation in lowered IR.