[PATCH] D152772: [LoopSink] Allow sinking to PHI-use

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 21:29:29 PDT 2023


wenlei created this revision.
wenlei added reviewers: nikic, asbirlea, reames.
Herald added subscribers: wlei, StephenFan, hoy, modimo, hiraditya.
Herald added a project: All.
wenlei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This change allows sinking defs from loop preheader with PHI-use into loop body. Loop sink can now see through PHI-use and select incoming blocks of value being used as candidate sink destination.

It makes loop sink more effective so more LICM can be undone if proven unprofitable with profile info. It addresses the motivating case in D87551 <https://reviews.llvm.org/D87551>, without resorting to profile guided LICM which breaks canonicalization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152772

Files:
  llvm/lib/Transforms/Scalar/LoopSink.cpp
  llvm/test/Transforms/LICM/loopsink-phi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152772.530764.patch
Type: text/x-patch
Size: 6797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230613/b43e7843/attachment.bin>


More information about the llvm-commits mailing list