[llvm] [AMDGPU] Optimize image sample followed by llvm.amdgcn.cvt.pkrtz into d16 variant (PR #145203)
Georg Lehmann via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 1 03:19:32 PDT 2025
================
@@ -247,6 +247,42 @@ simplifyAMDGCNImageIntrinsic(const GCNSubtarget *ST,
ArgTys[0] = User->getType();
});
}
+
+ // Fold image.sample + cvt.pkrtz -> extractelement idx0 into a single
+ // d16 image sample.
----------------
DadSchoorse wrote:
> conversion of other input data formats uses round-to-nearest-even.
This is exactly the issue I mentioned. For fixed points formats, the data is not converted to fp32 and then truncated to fp16, it's directly rounded to fp16.
https://github.com/llvm/llvm-project/pull/145203
More information about the llvm-commits
mailing list