This is an archive of the discontinued LLVM Phabricator instance.

Handle profile mismatch correctly for SamplePGO.
ClosedPublic

Authored by danielcdh on Sep 18 2017, 6:26 PM.

Details

Summary

Fix the bug when promoted call return type mismatches with the promoted function, we should not try to inline it. Otherwise it may lead to compiler crash.

Event Timeline

danielcdh created this revision.Sep 18 2017, 6:26 PM
tejohnson added inline comments.Sep 19 2017, 10:12 AM
lib/Transforms/IPO/SampleProfile.cpp
764

Can this only happen as the result of an ICP? If so, should the check be moved up to where DI is reset after the promotion, and this turned into an assert?

danielcdh added inline comments.Sep 19 2017, 10:47 AM
lib/Transforms/IPO/SampleProfile.cpp
764

Good point. Done.

This revision is now accepted and ready to land.Sep 19 2017, 11:03 AM
danielcdh closed this revision.Sep 19 2017, 11:28 AM