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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 3 13:01:13 PDT 2018


efriedma added a comment.

> This has no impact by itself that I've been able to see, as LICM typically doesn't see such phis as they will have been converted into selects by the time LICM is run

That's surprising... I would have expected this to show up in some cases. Some branches can't eliminated due to side-effects.



================
Comment at: lib/Transforms/Scalar/LICM.cpp:797
+  // so we iterate through them in first-in-last-out order which ensures that
+  // when we hoist an instruction we hoist its operands.
+  Instruction *HoistPoint = OriginalPreheader->getTerminator();
----------------
Would it be better to insert a PHI node, rather than re-hoist?


Repository:
  rL LLVM

https://reviews.llvm.org/D52827





More information about the llvm-commits mailing list