Page MenuHomePhabricator

[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.