[PATCH] D123473: [LICM] Only create load in pre-header when promoting load.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 04:30:39 PDT 2022


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2177
+  }
+  SSA.AddAvailableValue(Preheader, InitialValue);
 
----------------
nikic wrote:
> Do we need to add the poison value here at all? If we don't add it, shouldn't SSAUpdater avoid creating the phi altogether and directly use the value stored in the loop?
We don't need to add the poison value. We still need the phi node in the test case, because the store doesn't dominate the exit. The SSA updater uses undef instead of poison.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123473



More information about the llvm-commits mailing list