This is an archive of the discontinued LLVM Phabricator instance.

[LSR][NFC] don't collect chains when isNumRegsMajorCostOfLSR is false
ClosedPublic

Authored by shchenz on Nov 26 2020, 1:42 AM.

Details

Summary

This is an NFC patch and it only concerns compiling time on targets where isNumRegsMajorCostOfLSR is overloaded. For now, it is only for PowerPC target.

Because all the collected chains will be marked as not profitable in isProfitableChain when isNumRegsMajorCostOfLSR returns false, we don't need to waste time to collect the chain at the very beginning.

This patch just reverts the change in function isProfitableChain in https://reviews.llvm.org/D89665 and moves the newly added hook check at the very beginning.

We may get a potential issue if another hook isProfitableLSRChainElement returns true for some chain element on targets that isNumRegsMajorCostOfLSR returns false, but for now I can not see any target do that. So I guess it should be ok now?

Diff Detail

Event Timeline

shchenz created this revision.Nov 26 2020, 1:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 26 2020, 1:42 AM
shchenz requested review of this revision.Nov 26 2020, 1:42 AM
shchenz added a reviewer: Restricted Project.Nov 26 2020, 9:45 PM
samparker accepted this revision.Dec 1 2020, 1:09 AM

Okay, fair enough.

This revision is now accepted and ready to land.Dec 1 2020, 1:09 AM