[PATCH] D52827: [LICM] Make LICM able to hoist phis

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 8 02:14:47 PST 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/LICM.cpp:672
+  // re-hoisted if they end up not dominating all of their uses.
+  std::list<Instruction *> HoistedInstructions;
+
----------------
john.brawn wrote:
> mkazantsev wrote:
> > Why not `SmallVector` and `push_back`? That wouldn't make any difference in terms of effect but less memory-consuming.
> The iteration order when rehoisting will have to be changed (because we have to visit instructions before the instructions they use, i.e. later instructions before earlier instructions), but yes that will work.
You can preserve the order of processing if you just iterate in reverse order.


Repository:
  rL LLVM

https://reviews.llvm.org/D52827





More information about the llvm-commits mailing list