This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Remove TEEs when dests are unstackified
ClosedPublic

Authored by aheejin on Jun 15 2020, 9:36 AM.

Details

Summary

When created in RegStackify pass, TEE has two destinations, where
op0 is stackified and op1 is not. But it is possible that
op0 becomes unstackified in fixUnwindMismatches function in
CFGStackify pass when a nested try-catch-end is introduced, violating
the invariant of TEEs destinations.

In this case we convert the TEE into two COPYs, which will
eventually be resolved in ExplicitLocals.

Diff Detail

Event Timeline

aheejin created this revision.Jun 15 2020, 9:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2020, 9:36 AM

This is indeed what I had in mind on the other CL.
... Do you think it makes sense/is actually better?

Yeah I switched to this version to address your comment here. And yeah I think this is better that we don't violate assumptions on TEEs and keep ExplicitLocals to its core tasks, while we put all ugly things in fixUnwindMismatches, which is ugly anyway :$... Joking, but I think it's better that fixUnwindMismatches takes care of its own messes.

aheejin updated this revision to Diff 270800.Jun 15 2020, 10:43 AM
  • comment fix
dschuff accepted this revision.Jun 15 2020, 2:23 PM
This revision is now accepted and ready to land.Jun 15 2020, 2:23 PM
This revision was automatically updated to reflect the committed changes.