This is an archive of the discontinued LLVM Phabricator instance.

[Power9] Add addi post-ra scheduling heuristic
ClosedPublic

Authored by steven.zhang on May 19 2020, 10:10 PM.

Details

Reviewers
jsji
Group Reviewers
Restricted Project
Commits
rGf8eabd6d016e: [Power9] Add addi post-ra scheduling heuristic
Summary

The instruction addi is usually used to post increase the loop indvar, which looks like this:

label_X:
 load x, base(i)
 ...
 y = op x
 ...
 i = addi i, 1
 goto label_X

However, for PowerPC, if there are too many vsx instructions that between y = op x and i = addi i, 1, it will use all the hw resource that block the execution of i = addi, i, 1, which result in the stall of the load instruction in next iteration. So, a heuristic is added to move the addi as early as possible to have the load hide the latency of vsx instructions, if other heuristic didn't apply to avoid the starve.

Our internal loops testing shows improvement with this change.

Diff Detail

Event Timeline

steven.zhang created this revision.May 19 2020, 10:10 PM
steven.zhang edited the summary of this revision. (Show Details)May 20 2020, 10:17 PM

Gentle ping...

steven.zhang edited the summary of this revision. (Show Details)Jun 1 2020, 6:36 PM
jsji accepted this revision as: jsji.Jun 1 2020, 7:55 PM

LGTM.

This revision is now accepted and ready to land.Jun 1 2020, 7:55 PM
This revision was automatically updated to reflect the committed changes.