[llvm] Attributor: Infer noalias.addrspace metadata for memory instructions (PR #136553)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 5 02:20:18 PDT 2025
================
@@ -12767,6 +12768,193 @@ struct AAAddressSpaceCallSiteArgument final : AAAddressSpaceImpl {
};
} // namespace
+/// ------------------------ No Alias Address Space ---------------------------
+// This attribute assumes flat address space can alias all other address space
+namespace {
+struct AANoAliasAddrSpaceImpl : public AANoAliasAddrSpace {
+ AANoAliasAddrSpaceImpl(const IRPosition &IRP, Attributor &A)
+ : AANoAliasAddrSpace(IRP, A) {}
+
+ void initialize(Attributor &A) override {
----------------
Shoreshen wrote:
Hi @shiltian , the noaliasaddrspace attribute can only apply on memory related instructions. The associated value we embedded in is the ptr of the memory operation. So normally cannot have this attribute.
I've add checks that if the instructions that uses the ptr has the metadata. If yes, we leave it the original way~
https://github.com/llvm/llvm-project/pull/136553
More information about the llvm-commits
mailing list