This is an archive of the discontinued LLVM Phabricator instance.

[WinEHPrepare] Update demotion logic
ClosedPublic

Authored by JosephTremoulet on Aug 11 2015, 12:16 PM.

Details

Summary

Update the demotion logic in WinEHPrepare to avoid creating new cleanups by
walking predecessors as necessary to insert stores for EH-pad PHIs.

Also avoid creating stores for EH-pad PHIs that have no uses.

The store/load placement is still pretty naive. Likely future improvements
(at least for optimized compiles) include:

  • Share loads for related uses as possible
  • Coalesce non-interfering use/def-related PHIs
  • Store at definition point rather than each PHI pred for non-interfering lifetimes.

Diff Detail

Event Timeline

JosephTremoulet retitled this revision from to [WinEHPrepare] Update demotion logic.
JosephTremoulet updated this object.
JosephTremoulet added reviewers: majnemer, rnk.
JosephTremoulet added a subscriber: llvm-commits.
majnemer accepted this revision.Aug 12 2015, 2:46 PM
majnemer edited edge metadata.

Thanks for working on this!

LGTM with nits applied.

lib/CodeGen/WinEHPrepare.cpp
3230–3231

This looks a little funny, could you run clang-format over it?

3262

This assert shouldn't be necessary, cast will do that for you.

3278–3280

Could you reformat this with clang-format.

3297–3298

This should be formatted as well.

This revision is now accepted and ready to land.Aug 12 2015, 2:46 PM
JosephTremoulet edited edge metadata.
  • Remove redundant assertion
  • Clang-format modified code (caught cases noted in review plus a couple more)
JosephTremoulet marked 4 inline comments as done.Aug 12 2015, 3:10 PM
  • Remove unused variable