[PATCH] D82709: [MachineLICM] don't always hoist rematerializable instructions

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 3 01:11:05 PDT 2021


lkail added a comment.

IIUC, the motivation of this patch is to have part of immediate materialization code reside in the loop, i.e., have code like

  1: %0 = LIS8 64
  2: %1 = ORI8 %0, 17
  loop:
  8: <use %1>

transformed to

  1: %0 = LIS 64
  2: %1 = ORI %0, 17
  loop:
  4: %2 = ORI %0, 17
  8: <use %2>

I think it's currently beyond the ability of `InlineSpiller` when perform re-materialization. Even I set `ORI8` to be trivially rematerilizable, the `LiveRangeEdit` will fail the check `allUsesAvailableAt` since `%0` in `ORI8 %0, 17` is no longer live(`%0`'s live interval is `[1:2)`) in the loop.


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