Page MenuHomePhabricator

fix weights for promoted indirect calls
Needs ReviewPublic

Authored by david2050 on Feb 1 2019, 8:43 AM.

Details

Summary

When an indirect call is inliend, the introduced
operations that guard that direct call have debug
information copied from the original call. This
yields incorrect values for conditionally the
generated blocks. Here we copy the weights directly
from the profile to the BlockWeights map and then
ignore the operations in those blocks.

The added test has a more realistic profile to
illustrate the changes.

Diff Detail

Event Timeline

david2050 created this revision.Feb 1 2019, 8:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2019, 8:43 AM
david2050 updated this revision to Diff 184763.Feb 1 2019, 8:47 AM

fix formatting

wmi added a comment.Apr 2 2019, 9:24 AM

That is a good improvement. Thanks! I will evaluate how much impact it will have in our benchmarks.

lib/Transforms/IPO/SampleProfile.cpp
851–852

It is better to understand it with a comment.

test/Transforms/SampleProfile/Inputs/indirect-call2.prof
13–32

Looks like a large part of the profile has not been used. Can we remove them?

test/Transforms/SampleProfile/indirect-call2.ll
5

Could you add a check for new pass manager?

73

Looks like a large part of the metadata are unused. Can we remove them?

wmi added a comment.Apr 3 2019, 10:06 AM

No major improvement or regression was found in our test.