[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)

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 14:43:55 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp:1086-1087
+                          NewV->getType()->getPointerAddressSpace()};
+    auto IsFlatAS = [](unsigned AS) {
+      // FIXME: isFlatGlobalAddrSpace is missing constant_32bit
+      return AMDGPU::isFlatGlobalAddrSpace(AS) ||
----------------
Is this not just isExtendedGlobalAddrSpace?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp:1091
+    };
+    if (!llvm::all_of(InOutAS, IsFlatAS))
+      return nullptr;
----------------
I don't understand why you are checking both address spaces. The old address space had to have been flat?


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