This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix addi-load bias scheduling heuristics
AbandonedPublic

Authored by qiucf on Jul 8 2021, 2:27 AM.

Details

Reviewers
shchenz
nemanjai
jsji
Group Reviewers
Restricted Project
Summary
  1. LI/LI8 are also some form of ADDI
  2. Fixed the function to check it, the second one should be mayLoad, not !isADDI

According to generated inc file, mtctr is also seen as mayLoad.

Diff Detail

Event Timeline

qiucf created this revision.Jul 8 2021, 2:27 AM
qiucf requested review of this revision.Jul 8 2021, 2:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2021, 2:27 AM
jsji added inline comments.Jul 9 2021, 11:34 AM
llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp
27

This heuristics was intended for the addi in loop induction variable calculation, not for all addi.
So LI/LI8 shouldn't be counted.

Do you have any specific example that we have LI/LI8 in loop and should schedule them earlier?

173

The heuristics was to try to schedule addi as early as possible, not necessary just before mayload instructions.

qiucf planned changes to this revision.Jul 13 2021, 12:47 AM

Thanks for the review and explaining the background. Besides changes here, I was trying to refactor tryCandidate to return bool, so that target hooks may reuse it better. However, we still cannot if (GenericScheduler::tryCandidate(...)) return ... since that will not be not an NFC. However that will make this heuristic hack in higher priority. I need to evaluate it and see if we should proceed.

llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp
27

Ah, thanks for the background. I was not clear about it. So LI/LI8 should be here.

jsji resigned from this revision.Jun 2 2022, 7:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2022, 7:59 AM
qiucf abandoned this revision.Sep 19 2023, 12:25 AM