You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: morph late canonicalization of assign foils local assertion prop #12098
Morph propagates assertions before morphing, and assertion prop doesn't handle copy assertions for copies with sources in obj(addr(lcl)) form. Morph then transforms some of these into simple copies:
If we re-ran assertion prop at this point we'd change the source to tmp1 and quite possibly avoid a struct copy.
Perhaps it makes sense to either retry assertion prop after morphing (at least for this case), or work harder to produce the simple struct copy forms upstream. One common source of these is inlining args....
or work harder to produce the simple struct copy forms upstream
I've experienced a similar situation with struct promotion - apparently doing it before morphing, in LocalAddressVisitor also unblocks copy assertion propagation in some cases. Though in your specific case it looks like we should just produce the "right" IR in the importer, using OBJ(ADDR(LCL_VAR)) is probably another leftover from GT_COPYBLK days. For local variables OBJ should only be needed when struct-typed local fields are involved.
Activity
mikedn commentedon Feb 22, 2019
I've experienced a similar situation with struct promotion - apparently doing it before morphing, in
LocalAddressVisitoralso unblocks copy assertion propagation in some cases. Though in your specific case it looks like we should just produce the "right" IR in the importer, usingOBJ(ADDR(LCL_VAR))is probably another leftover fromGT_COPYBLKdays. For local variablesOBJshould only be needed when struct-typed local fields are involved.AndyAyersMS commentedon Feb 22, 2019
Also
optCopyProp_LclVarScoreprobably needs some tweaking...AndyAyersMS commentedon Aug 26, 2022
Seems like this will largely be addressed by #74384