This is an archive of the discontinued LLVM Phabricator instance.

[Sink] Don't move landingpads
ClosedPublic

Authored by loladiro on Nov 6 2015, 7:13 PM.

Details

Summary

Moving landingpads into successor basic blocks makes the verifier sad. I assume the same is true for cleanuppads. Any other EH related pads that need to be put here? Bugpoint-reduced C++ testcase is included.

Diff Detail

Repository
rL LLVM

Event Timeline

loladiro updated this revision to Diff 39621.Nov 6 2015, 7:13 PM
loladiro retitled this revision from to [Sink] Don't move landingpads.
loladiro updated this object.
loladiro added a reviewer: majnemer.
loladiro set the repository for this revision to rL LLVM.
loladiro added a subscriber: llvm-commits.
majnemer accepted this revision.Nov 7 2015, 8:57 AM
majnemer edited edge metadata.

LGTM with tweaks

lib/Transforms/Scalar/Sink.cpp
172–173 ↗(On Diff #39621)

This can be made more concise by writing it as isa<TerminatorInst>(Inst) || isa<PHINode(Inst) || Inst->isEHPad()

test/Transforms/Sink/landingpad.ll
4 ↗(On Diff #39621)

Would you mind renaming these functions something like f, g, and h ?

38–39 ↗(On Diff #39621)

These attributes are not really relevant to this test case.

This revision is now accepted and ready to land.Nov 7 2015, 8:57 AM
This revision was automatically updated to reflect the committed changes.