[PATCH] D149938: [AMDGPU][InferAddressSpaces] Only rewrite address-spaces that can be trivially casted to flat for llvm.amdgcn.flat.atomic.{fadd,fmax,fmin} (2/2)

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 02:10:59 PDT 2023


jmmartinez added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp:1088-1089
+        static_cast<const GCNTargetMachine &>(getTLI()->getTargetMachine());
+    if (!TM.isNoopAddrSpaceCast(OldAS, NewAS))
+      return nullptr;
     Module *M = II->getParent()->getParent()->getParent();
----------------
jmmartinez wrote:
> arsenm wrote:
> > But the not-noop address space casts are the cases we're interested in handling. Do you mean to check for valid casts?
> The problem is that currently we cannot lower this builtin for other address spaces other than flat.
> 
> I agree that the rewrite of this intrinsic loses almost all interest for this intrinsics. Maybe we shouldn't even rewrite them at all, which would simplify the code.
> 
> Handling CONSTANT_ADDRESS_32BIT gets awkward since it's not handled in isFlatGlobalAddrSpace. I modified isFlatGlobalAddrSpace to take it into account but I've got several fails in other tests (I haven't looked at the details yet).
Ping


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149938/new/

https://reviews.llvm.org/D149938



More information about the llvm-commits mailing list