[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
Fri Apr 22 14:12:37 PDT 2022


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2165
+    // A new load is introduced, remove WriteOnly attribute from the function.
+    Preheader->getParent()->removeFnAttr(Attribute::WriteOnly);
+    PreheaderLoad =
----------------
nlopes wrote:
> we can't remove the writeonly attribute locally. We would need to remove it transitively as it's illegal for a writeonly function to call a non-writeonly function.
> We need to bail out if a non-local store is needed.
Yeah, I tried to allude to that in the message for the update. Updated to assert no problematic loads will be introduced in write only functions as per clarification in D124124.


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