[PATCH] D101190: [LoopIdiom] Ignore memory accesses to constant memory

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 11:54:11 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:876
+              intersectModRef(AA.getModRefInfo(&I, StoreLoc), Access))) {
+        if (auto MemLoc = MemoryLocation::getOrNone(&I)) {
+          if (!AA.pointsToConstantMemory(*MemLoc)) {
----------------
Without looking at the users of this function, just going by the contract on the function, I think you can only do this if Access is Mod (as you can't write to constant memory), but not if Access is Ref or ModRef.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101190



More information about the llvm-commits mailing list