This is an archive of the discontinued LLVM Phabricator instance.

fix for PR17073 (simplifycfg hoists an operation that can trap)
ClosedPublic

Authored by spatel on Jul 7 2014, 9:39 AM.

Details

Reviewers
spatel
hfinkel
Summary

In PR17073 ( http://llvm.org/pr17073 ), simplifycfg illegally hoists an operation in a phi node that can trap.

This patch adds to an existing loop over phi nodes in SimplifyCondBranchToCondBranch() to check for trapping ops and bails out of the optimization if we find one of those.

The test cases verify that trapping ops are not hoisted and non-trapping ops are still optimized as expected.

Diff Detail

Event Timeline

spatel updated this revision to Diff 11120.Jul 7 2014, 9:39 AM
spatel retitled this revision from to fix for PR17073 (simplifycfg hoists an operation that can trap).
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added a reviewer: hfinkel.
spatel added a subscriber: Unknown Object (MLST).
hfinkel edited edge metadata.Jul 7 2014, 2:18 PM

LGTM, thanks!

spatel accepted this revision.Jul 7 2014, 2:33 PM
spatel added a reviewer: spatel.

Thanks! Forgot to add the magic Phab string when I committed, so closing this diff manually.

This revision is now accepted and ready to land.Jul 7 2014, 2:33 PM