[PATCH] D113160: [stack-safety] Check SCEV constraints at memory instructions.
Kirill Stoimenov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 12 11:37:01 PST 2021
kstoimenov added inline comments.
================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:121
ConstantRange Range;
- std::map<const Instruction *, ConstantRange> Accesses;
+ std::set<const Instruction *> UnsafeAccesses;
----------------
I am not sure what is the ratio of unsafe to safe accesses is, but I would expect that more of them are unsafe, right? In that case it makes more sense to have a set of SafeAccesses to use less memory.
================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:951
const auto &Info = getInfo();
- auto It = Info.AccessIsUnsafe.find(&I);
- if (It == Info.AccessIsUnsafe.end()) {
- return true;
- }
- return !It->second;
+ return Info.UnsafeAccesses.find(&I) == Info.UnsafeAccesses.end();
}
----------------
Nit: could be !Info.UnsafeAccesses.contains(&I).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113160/new/
https://reviews.llvm.org/D113160
More information about the llvm-commits
mailing list