This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnroll] Adjust CostKind query
ClosedPublic

Authored by samparker on Aug 11 2020, 5:28 AM.

Details

Summary

When TTI was updated to use an explicit cost, TCK_CodeSize was used although the default implicit cost would have been the hand-wavey cost of size and latency. So, revert back to this behaviour. This is not expected to have (much) impact on targets since most (all?) of them return the same value for SizeAndLatency and CodeSize.
When optimising for size, the logic has been changed to query CodeSize costs instead of SizeAndLatency.
This patch also adds a testing option in the unroller so that OptSize thresholds can be specified.

Diff Detail

Event Timeline

samparker created this revision.Aug 11 2020, 5:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2020, 5:28 AM
samparker requested review of this revision.Aug 11 2020, 5:28 AM
samparker updated this revision to Diff 284686.Aug 11 2020, 6:22 AM

Added a few more tests.

samparker edited the summary of this revision. (Show Details)Aug 11 2020, 6:38 AM
dmgreen accepted this revision.Aug 12 2020, 4:49 AM

Sounds like an improvement to me. Better than using TCK_CodeSize and the option is a nice addition.

This revision is now accepted and ready to land.Aug 12 2020, 4:49 AM
This revision was automatically updated to reflect the committed changes.