[PATCH] D124787: [NVPTX] Implement NVPTX AliasAnalysis
Artem Belevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 14:09:59 PDT 2022
tra added a subscriber: asbirlea.
tra added a comment.
LGTM in general.
@asbirlea : Could you take a look and check if we've got all the right pieces for the pass for both new and old PM, please?
================
Comment at: llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.cpp:64
+ if (Result == AliasResult::NoAlias)
+ return Result;
+
----------------
Nit. I'd rephrase it a bit and put `alias()` call closer to the condition check.
```
if (getAliasResult(AS1, AS2) != AliasResult::NoAlias)
return AAResultBase::alias(Loc1, Loc2, AAQI);
return AliasResult::NoAlias;
```
Maybe, even fold it into a single `return (...== NoAlias) ? NoAlias : alias();`
================
Comment at: llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.cpp:71
+ AAQueryInfo &AAQI, bool OrLocal) {
+ unsigned AS = Loc.Ptr->getType()->getPointerAddressSpace();
+ if (AS == AddressSpace::ADDRESS_SPACE_CONST)
----------------
Kernel parameters are also read-only: https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#state-spaces
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124787/new/
https://reviews.llvm.org/D124787
More information about the llvm-commits
mailing list