[PATCH] D146737: [AMDGPU] Trim zero components from buffer and image stores

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 12:41:26 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp:366
+
+  for (int i = VWidth - 1; i >= 0; --i) {
+    APInt DemandOneElt = APInt::getOneBitSet(VWidth, i);
----------------
I don't think you want to loop to go down to i = 0. If the 0'th element is zero then you will remove the whole store instruction, which would not be right. Can you add a test for that case please?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146737



More information about the llvm-commits mailing list