This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Remove unnecessary instructions after TRY marker placement
ClosedPublic

Authored by aheejin on Feb 24 2019, 1:50 AM.

Details

Summary

This removes unnecessary instructions after TRY marker placement. There
are two cases:

  • end/end_block can be removed if they overlap with try/end_try and they have the same return types.
  • br right before catch that branches to after end_try can be deleted.

Diff Detail

Repository
rL LLVM

Event Timeline

aheejin created this revision.Feb 24 2019, 1:50 AM
aheejin updated this revision to Diff 188076.Feb 24 2019, 1:52 AM

Deleted newlines

aheejin updated this revision to Diff 188077.Feb 24 2019, 2:05 AM

Fix an indentation

aheejin updated this revision to Diff 188081.Feb 24 2019, 2:48 AM

Run removeUnnecessaryInstrs only when EH is used

aheejin updated this revision to Diff 188121.Feb 25 2019, 3:30 AM

Add annotations

aheejin updated this revision to Diff 188125.Feb 25 2019, 3:49 AM

Add annotations to rethrow too

dschuff added inline comments.Feb 25 2019, 1:30 PM
lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
847 ↗(On Diff #188125)

should this unconditional run still be here?

aheejin updated this revision to Diff 188301.Feb 25 2019, 8:11 PM
aheejin marked 2 inline comments as done.

Remove a stray redundant line

aheejin added inline comments.Feb 25 2019, 8:11 PM
lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
847 ↗(On Diff #188125)

No. I forgot to delete it. Thanks for the catch.

aheejin updated this revision to Diff 188302.Feb 25 2019, 8:27 PM

I should've unregister the scope before deleting MI

dschuff accepted this revision.Feb 26 2019, 1:57 PM
This revision is now accepted and ready to land.Feb 26 2019, 1:57 PM
This revision was automatically updated to reflect the committed changes.