This is an archive of the discontinued LLVM Phabricator instance.

[JumpThreading] Change a return of ComputeValueKnownInPredecessors() to prevent triggering an assert
ClosedPublic

Authored by haicheng on Feb 6 2016, 8:30 PM.

Details

Summary

Change a return statement of ComputeValueKnownInPredecessors() to be the same as the rest return statements of the function. Otherwise, it might return true with an empty Result when the current basic block has no predecessors and trigger the first assert of JumpThreading::ProcessThreadableEdges.

Diff Detail

Repository
rL LLVM

Event Timeline

haicheng updated this revision to Diff 47115.Feb 6 2016, 8:30 PM
haicheng retitled this revision from to [JumpThreading] Change a return of ComputeValueKnownInPredecessors() to prevent triggering an assert.
haicheng updated this object.
haicheng added reviewers: mcrosier, gberry, mssimpso.
haicheng set the repository for this revision to rL LLVM.
mssimpso accepted this revision.Feb 7 2016, 9:23 AM
mssimpso edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Feb 7 2016, 9:23 AM
mcrosier edited edge metadata.Feb 7 2016, 9:36 AM

Please add a test case. In the test please comment that you're just making sure the code doesn't assert.

Chad

haicheng added a comment.EditedFeb 8 2016, 7:33 AM

Please add a test case. In the test please comment that you're just making sure the code doesn't assert.

It is quite difficult to create a test case for this without D16809. I will add the test case in D16809.

Please add a test case. In the test please comment that you're just making sure the code doesn't assert.

It is quite difficult to create a test case for this without D16809. I will add the test case in D16809.

SGTM. Feel free to commit and include the test in D16809.

haicheng closed this revision.Feb 8 2016, 10:56 AM

Committed in r260110.