[PATCH] D73558: AMDGPU: Correct memory size for image intrinsics

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 01:48:25 PST 2020


nhaehnle added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:916-922
+      // TODO: Account for dmask reducing loaded size.
+      if (auto *ST = dyn_cast<StructType>(CI.getType())) {
         // Some intrinsics return an aggregate type - special case to work out
         // the correct memVT
-        Info.memVT = memVTFromAggregate(CI.getType());
-      }
+        Info.memVT = memVTFromImageReturn(*ST);
+      } else
+        Info.memVT = MVT::getVT(CI.getType(), true);
----------------
I think I'd prefer to have all of this logic inside of memVTFromImageReturn. That would make the function name fit better, since with this change it's really more "memVTFromImageReturnIfItsAStruct"...


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

https://reviews.llvm.org/D73558





More information about the llvm-commits mailing list