[PATCH] D153932: [AliasAnalysis] Mark fences as not Mod'ing unescaped local values
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 27 19:15:15 PDT 2023
efriedma added inline comments.
================
Comment at: llvm/lib/Analysis/AliasAnalysis.cpp:513
AAQueryInfo &AAQI) {
- // All we know about a fence instruction is what we get from the ModRef
- // mask: if Loc is a constant memory location, the fence definitely could
- // not modify it.
- if (Loc.Ptr)
+ // All we know about a fence instruction is what we get from the ModRef mask:
+ // if Loc is a constant memory location or cannot have a pointer outside this
----------------
The bit about the ModRef mask doesn't make sense in the rewritten comment.
================
Comment at: llvm/lib/Analysis/AliasAnalysis.cpp:518
+ if (isIdentifiedFunctionLocal(Loc.Ptr) &&
+ AAQI.CI->isNotCapturedBeforeOrAt(Loc.Ptr, S)) {
+ return ModRefInfo::Ref;
----------------
"before" in isNotCapturedBeforeOrAt is not happens-before... so if the value is captured after the fence, operations could appear to happen on it before the fence. That might mean reordering read operations across the fence isn't actually legal? Not sure.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153932/new/
https://reviews.llvm.org/D153932
More information about the llvm-commits
mailing list