[llvm] [AMDGPU] Don't select scalar loads for LDS/scratch (PR #227423)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 05:33:41 PDT 2026


================
@@ -829,6 +829,11 @@ def S_DCACHE_INV_VOL_ci : SMRD_Real_ci <0x1d, S_DCACHE_INV_VOL>;
 //===----------------------------------------------------------------------===//
 
 class SMRDLoadPat<PatFrag Op> : PatFrag <(ops node:$ptr), (Op node:$ptr), [{ return isUniformLoad(N);}]> {
+  // Scalar loads can only access memory through a 64-bit address, so never
+  // consider loads from LDS, GDS or scratch.
----------------
arsenm wrote:

The comment is inaccurate, this pattern does cover 32-bit constant addresses (though I think you can also just drop it)

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


More information about the llvm-commits mailing list