[PATCH] D124232: [AMDGPU] Use d16 flag for image.sample instructions

Mariusz Sikora via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 00:15:47 PDT 2022


mariusz-sikora-at-amd created this revision.
Herald added subscribers: hsmhsm, foad, wenlei, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: All.
mariusz-sikora-at-amd requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Image.sample instruction can be forced to return half type instead of
float when d16 flag is enabled.

This patch adds new pattern in InstCombine to detect if output of
image.sample is used later only by fptrunc which converts the type
from float to half. If pattern is detected then fptrunc and image.sample
are combined to single image.sample which is returning half type.
Later in Lowering part d16 flag is added to image sample intrinsic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124232

Files:
  llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
  llvm/test/Transforms/InstCombine/AMDGPU/image-sample-half.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124232.424390.patch
Type: text/x-patch
Size: 14572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220422/eb739b1d/attachment-0001.bin>


More information about the llvm-commits mailing list