This is an archive of the discontinued LLVM Phabricator instance.

LoopSink: Don't sink into EH pads (PR38462)
ClosedPublic

Authored by hans on Aug 27 2018, 7:54 AM.

Details

Summary

In the PR, LoopSink was trying to sink into a catchswitch block, which doesn't have a valid insertion point.

This isn't very elegant, but should stop the bug at least.

Diff Detail

Repository
rL LLVM

Event Timeline

hans created this revision.Aug 27 2018, 7:54 AM
dmajor added a subscriber: dmajor.Aug 27 2018, 8:19 AM
rnk added inline comments.Aug 27 2018, 2:08 PM
lib/Transforms/Scalar/LoopSink.cpp
157 ↗(On Diff #162677)

This will return true for landingpads and cleanuppads, which we can probably sink into just fine. We can limit this to catchswitches, as they are the only blocks that have no insertion point. I guess the most generic way to test would be:

if (BB->getFirstInsertionPt() == BB->end())
hans updated this revision to Diff 162799.Aug 28 2018, 1:21 AM

Do the general thing: check for the block not having an insertion point.

rnk accepted this revision.Aug 28 2018, 1:26 PM

lgtm, thanks for following up on the bug!

This revision is now accepted and ready to land.Aug 28 2018, 1:26 PM
This revision was automatically updated to reflect the committed changes.