This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] set instruction number as 1st priority for lsr cost model
ClosedPublic

Authored by shchenz on Jan 13 2020, 11:38 PM.

Details

Summary

This issue comes from case in file test/CodeGen/PowerPC/lsr-insns-cost.ll

Three iteration IVs are used while we expect one. This is because, on PowerPC, register number is 1st priority for lsr cost model now.

This patch changes instruction number as 1st priority.

Diff Detail

Event Timeline

shchenz created this revision.Jan 13 2020, 11:38 PM

Unit tests: pass. 61801 tests passed, 0 failed and 781 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

steven.zhang added inline comments.Feb 10 2020, 1:51 AM
llvm/test/CodeGen/PowerPC/unal-altivec.ll
36

The "add" here is new added ? Does it mean that, for this case, it produces bad code ?

shchenz marked 2 inline comments as done.Feb 10 2020, 7:17 PM
shchenz added inline comments.
llvm/test/CodeGen/PowerPC/unal-altivec.ll
36

Thanks for reviewing this.
Yes, for this case, the inst number inside the loop becomes larger. I plan to look into it later.
For big applications, I get the perf data for cpu spec2017, we get a positive result.

LGTM as the perf number shows good. But please hold on some days in case others have other concern. And please follow up with the bad case.

steven.zhang accepted this revision.Feb 10 2020, 9:24 PM
This revision is now accepted and ready to land.Feb 10 2020, 9:24 PM
jsji added a comment.Feb 13 2020, 11:23 AM

Can we add an option to control the strategy here, so that people can fall back to old behavior? Thanks.

shchenz marked an inline comment as done.Feb 13 2020, 9:31 PM

Can we add an option to control the strategy here, so that people can fall back to old behavior? Thanks.

Good Idea! Will do it in next patch.

shchenz updated this revision to Diff 244575.Feb 13 2020, 11:12 PM

add option ppc-lsr-no-insns-cost to support using default lsr cost model on PowerPC & one test case for the option.

jsji accepted this revision.Feb 14 2020, 6:40 AM

LGTM. Thanks.

This revision was automatically updated to reflect the committed changes.
jsji edited the summary of this revision. (Show Details)Mar 10 2020, 1:10 PM