argon
argon copied to clipboard
CSE / Scheduling issue
Given IR that looks something like:
x1 = OpA(...)
...
x2 = OpB(x1,...)
In a transformer, if we insert an operation x3 prior to x1 which also uses x1 due to CSE:
x3 = OpC(x1,...)
x1 = OpA(...)
...
x2 = OpB(x1,...)
Scheduling appears to leave it in this order, including during code generation, causing issues with generated code. Not clear if this is a new issue with scheduling or one previously undiscovered in LMS.
Fix should revise scheduling to move x1 before all of its uses