[llvm] [AMDGPU] Add !noalias metadata to mem-accessing calls w/o pointer args (PR #188949)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 00:24:48 PDT 2026


================
@@ -0,0 +1,42 @@
+; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -passes=amdgpu-lower-kernel-arguments %s | FileCheck %s
+
+; Regression test for a bug where addAliasScopeMetadata skipped memory-
+; accessing calls with no pointer arguments, leaving them without !noalias
+; metadata. This caused AA to conservatively report them as potential
+; clobbers of noalias kernel arguments, blocking downstream scalarization
+; in AMDGPUAnnotateUniformValues and causing severe performance regressions
+; (e.g. in rocFFT).
+
+declare i32 @memory_read_no_ptr_args() #1
+
+; The call reads memory but has no pointer arguments — it cannot alias
+; any noalias kernel argument. The pass must add !noalias metadata to it.
+define amdgpu_kernel void @call_without_ptr_args(ptr addrspace(1) noalias %out, ptr addrspace(1) noalias %in) #0 {
+; CHECK-LABEL: @call_without_ptr_args(
+; CHECK: call i32 @memory_read_no_ptr_args(), !noalias [[SCOPES:![0-9]+]]
----------------
michaelselehov wrote:

No, it was a leftover. Removed.

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


More information about the llvm-commits mailing list