[PATCH] D82709: [MachineLICM] [PowerPC] hoisting rematerializable cheap instructions based on register pressure.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 03:01:38 PST 2020


shchenz added a comment.

Since @efriedma has concerns about adding more hook in machineLICM pass, and the RA works as expected(@qcolombet please correct me if you find there is any issue in RA process in above comments), I made a new solution for this issue:
instead of hoisting all remat instructions, we now do:

  // For remat instructions which are inside current working loop, we should
  // always hoist them.
  // For remat instructions which intend to be hoisted to outer parent loop, we
  // only hoist non-cheap ones as RA can not pull all remat instructions down to
  // inner loop as it will first try to split them in outer loop.

Now for the new added case `rematerializable-instruction-machine-licm.ll`, we don't have any spills.
But we get some cheap instructions kept inside the loop as expected. This should be alignment with the logic in `CanCauseHighRegPressure` in machinelicm pass. See flag `HoistCheapInsts`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82709



More information about the llvm-commits mailing list