[llvm] [AMDGPU] Support D16 folding for image.sample with multiple extractelement and fptrunc users (PR #141758)

Harrison Hao via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 23:28:42 PDT 2025


================
@@ -270,6 +270,62 @@ simplifyAMDGCNImageIntrinsic(const GCNSubtarget *ST,
                                      });
         }
       }
+
+      // Only perform D16 folding if every user of the image sample is
+      // an ExtractElementInst immediately followed by an FPTrunc to half.
+      SmallVector<ExtractElementInst *, 4> Extracts;
+      SmallVector<FPTruncInst *, 4> Truncs;
----------------
harrisonGPU wrote:

Thanks, I have updated it.

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


More information about the llvm-commits mailing list