This is an archive of the discontinued LLVM Phabricator instance.

[LV][NFC] Optimize out an extra call to isMoreProfitable
Needs ReviewPublic

Authored by ebrevnov on Sep 13 2021, 3:01 AM.

Details

Summary

Current implementation of selecting best cost for epilog vectorization is sub-optimal and can be improved by ~2x. The problem is that isMoreProfitable is called twice. First we compare cost of each candidate against scalar cost and cache those ones that are more optimal than the scalar one. Second we travers via cached VFs and try to find most beneficial among them. The thing is that we don't really need to know which ones are better than the scalar one. It's simply enough to do the second step plus one compare against scalar cost.

Diff Detail

Event Timeline

ebrevnov created this revision.Sep 13 2021, 3:01 AM
ebrevnov requested review of this revision.Sep 13 2021, 3:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2021, 3:01 AM
ebrevnov edited the summary of this revision. (Show Details)Sep 13 2021, 5:31 AM
ebrevnov added reviewers: fhahn, lebedev.ri, Ayal, anna.
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2022, 2:36 AM
lebedev.ri resigned from this revision.Jan 12 2023, 5:31 PM

This review may be stuck/dead, consider abandoning if no longer relevant.
Removing myself as reviewer in attempt to clean dashboard.