[llvm] [AMDGPU] Fix spurious NoAlias results (PR #122309)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 03:32:28 PST 2025


================
@@ -85,7 +85,8 @@ AliasResult AMDGPUAAResult::alias(const MemoryLocation &LocA,
         // variables in shared or private address space.
         const auto *ObjB =
             getUnderlyingObject(B.Ptr->stripPointerCastsForAliasAnalysis());
-        return (ObjA == ObjB) ? AliasResult::MustAlias : AliasResult::NoAlias;
+        return isIdentifiedObject(ObjB) && ObjA != ObjB ? AliasResult::NoAlias
----------------
arsenm wrote:

```suggestion
        return  ObjA != ObjB && isIdentifiedObject(ObjB) ? AliasResult::NoAlias
```

https://github.com/llvm/llvm-project/pull/122309


More information about the llvm-commits mailing list