[PATCH] D98718: [AA][NFC] Convert AliasResult to class containing offset for PartialAlias case.
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 16 09:45:37 PDT 2021
nikic added inline comments.
================
Comment at: llvm/include/llvm/Analysis/AliasAnalysis.h:111
+
+ AliasResult() : HasOffset(false) {}
+ constexpr AliasResult(const Result &Alias)
----------------
Why does this ctor only initialize HasOffset?
================
Comment at: llvm/include/llvm/Analysis/AliasAnalysis.h:124
+ if (-(1 << (OffsetBits - 1)) <= NewOffset &&
+ NewOffset < (1 << (OffsetBits - 1))) {
+ HasOffset = true;
----------------
I believe this is `isInt<OffsetBits>(NewOffset)`.
================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:1119
LocationSize VRightSize = V1Size;
+ const bool Swapped = Off.isNegative();
----------------
aliasCheck() performs location swapping as well. I think now you need to adjust it to negate the offset if a swapped location is used.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98718/new/
https://reviews.llvm.org/D98718
More information about the llvm-commits
mailing list