[PATCH] D152743: [AliasAnalysis] Return NoModRef for loads from constant memory
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 12:53:22 PDT 2023
nikic added a comment.
I'm concerned that this will cause us problems in the future, e.g. if we want to do MemorySSA-based GVN, because we will no longer have MemoryUses for these loads at all, even though we may want to do load CSE on them.
================
Comment at: llvm/lib/Analysis/AliasAnalysis.cpp:482
+ // If the load is from constant memory, it doesn't mod/ref anything.
+ if (!isRefSet(getModRefInfoMask(MemoryLocation::get(L))))
+ return ModRefInfo::NoModRef;
----------------
Should probably use `Loc` rather than `MemoryLocation::get(L)` here, just like all the other methods?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152743/new/
https://reviews.llvm.org/D152743
More information about the llvm-commits
mailing list