[PATCH] D98718: [AA][NFC] Convert AliasResult to class containing offset for PartialAlias case.
Daniil Fukalov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 17 06:25:08 PDT 2021
dfukalov marked 3 inline comments as done.
dfukalov added a comment.
@nikic thanks for review, and what do you think about `Optional<AliasResult>` - should it be refactored to `Optional<AliasResult::Result>` in MemorySSA?
Or, possibly, will this module use PartialAlias offsets?
================
Comment at: llvm/include/llvm/Analysis/AliasAnalysis.h:111
+
+ AliasResult() : HasOffset(false) {}
+ constexpr AliasResult(const Result &Alias)
----------------
nikic wrote:
> Why does this ctor only initialize HasOffset?
Yes, it was incorrect, we should no get an uninitialized `Alias` field.
================
Comment at: llvm/include/llvm/Analysis/AliasAnalysis.h:124
+ if (-(1 << (OffsetBits - 1)) <= NewOffset &&
+ NewOffset < (1 << (OffsetBits - 1))) {
+ HasOffset = true;
----------------
nikic wrote:
> I believe this is `isInt<OffsetBits>(NewOffset)`.
Thanks for hint!
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