[PATCH] D105617: [PowerPC] Fix addi-load bias scheduling heuristics

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 13 00:47:45 PDT 2021


qiucf planned changes to this revision.
qiucf added a comment.

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.



================
Comment at: llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp:27
+         Cand.SU->getInstr()->getOpcode() == PPC::ADDI8 ||
+         Cand.SU->getInstr()->getOpcode() == PPC::LI ||
+         Cand.SU->getInstr()->getOpcode() == PPC::LI8;
----------------
jsji wrote:
> 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? 
Ah, thanks for the background. I was not clear about it. So `LI/LI8` should be here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105617/new/

https://reviews.llvm.org/D105617



More information about the llvm-commits mailing list