[PATCH] D128128: [GlobalOpt] Perform store->dominated load forwarding for stored once globals

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 13:26:39 PDT 2022


jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:1458
+  // global.
+  if (!isa<Constant>(StoredOnceValue) && !F->hasNoSync())
+    return false;
----------------
nikic wrote:
> Possible complication here might be storing the address of a thread-local, which is Constant but not necessarily the same between two invocations. (Though that would be solved by https://reviews.llvm.org/D125291.)
Good point. `Constant::isThreadDependent`. Though. I don't know why we require constant in the first place. What is the motivation here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128128



More information about the llvm-commits mailing list