This is an archive of the discontinued LLVM Phabricator instance.

[NewPassManager] Resolve assertion in CGSCCPassManager when CallCounts change.
ClosedPublic

Authored by asbirlea on Aug 1 2019, 4:43 PM.

Details

Summary

If the CallCounts change after an iteration of the DevirtSCCRepeatedPass, this is not reflected in the local CallCounts structure triggering the assertion checking the before/after sizes.
Since it is valid for the size to change and this only uses the CallCounts for the devirtualizing heuristic, keep a <Function*, CallCount> map instead, and make the devirtualizing decision using the counts for the functions that exist both before and after the pass.

Resolves PR42726.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea created this revision.Aug 1 2019, 4:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2019, 4:43 PM
asbirlea updated this revision to Diff 212932.Aug 1 2019, 4:48 PM

Update test.

chandlerc accepted this revision.Aug 1 2019, 6:07 PM

LGTM! Thanks for fixing this nasty bug (and sorry I wrote it).

This revision is now accepted and ready to land.Aug 1 2019, 6:07 PM
This revision was automatically updated to reflect the committed changes.