[llvm] Attributor: Infer noalias.addrspace metadata for memory instructions (PR #136553)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Tue May 6 11:02:27 PDT 2025
================
@@ -12780,6 +12781,214 @@ struct AAAddressSpaceCallSiteArgument final : AAAddressSpaceImpl {
};
} // namespace
+/// ------------------------ No Alias Address Space ---------------------------
+namespace {
+struct AANoAliasAddrSpaceImpl : public AANoAliasAddrSpace {
+ AANoAliasAddrSpaceImpl(const IRPosition &IRP, Attributor &A)
+ : AANoAliasAddrSpace(IRP, A) {}
+
+ void initialize(Attributor &A) override {
+ assert(getAssociatedType()->isPtrOrPtrVectorTy() &&
+ "Associated value is not a pointer");
+
+ if (!A.getInfoCache().getFlatAddressSpace().has_value()) {
+ resetASRanges(A);
----------------
shiltian wrote:
why do you want to have reset in multiple places instead of just one at the beginning? This is initialize so I'd expect every one would have to initialzie/reset it.
https://github.com/llvm/llvm-project/pull/136553
More information about the llvm-commits
mailing list