This is an archive of the discontinued LLVM Phabricator instance.

[InlineCost] Do not take INT_MAX when Cost is negative
ClosedPublic

Authored by junbuml on Jun 20 2017, 6:16 PM.

Details

Summary

visitSwitchInst should not take INT_MAX when Cost is negative. Instead of INT_MAX , we also use a valid upperbound cost when overflow occurs in Cost.

Diff Detail

Event Timeline

junbuml created this revision.Jun 20 2017, 6:16 PM
dmgreen accepted this revision.Jun 21 2017, 8:00 AM

Thanks for the fix. Much appreciated.

I was hoping to take another look at getting you a better test case, but it looks like you came up with something good.

This fixes the differences we were seeing, so LGTM. Cheers.

This revision is now accepted and ready to land.Jun 21 2017, 8:00 AM
This revision was automatically updated to reflect the committed changes.