[llvm] [AMDGPU] Enable constant offset promotion to immediate FLAT (PR #93884)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 16:28:13 PDT 2024


================
@@ -2055,10 +2055,20 @@ bool SILoadStoreOptimizer::promoteConstantOffsetToImm(
   if (!(MI.mayLoad() ^ MI.mayStore()))
     return false;
 
-  // TODO: Support flat and scratch.
-  if (AMDGPU::getGlobalSaddrOp(MI.getOpcode()) < 0)
----------------
rampitec wrote:

If not anything, checking existence of global SADDR form is a very obscure and indirect way of checking support for immediate offset and address size. This is actually how I discovered this piece of code, it just started to fail with the experimental patch.

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


More information about the llvm-commits mailing list