[PATCH] D143648: [AMDGPU][GlobalISel] Fix selection of image sample g16 instructions

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 08:18:15 PST 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:4905
+  const bool IsG16 =
+      ST.hasG16() ? (BaseOpcode->Gradients && GradTy == S16) : GradTy == S16;
   const bool IsA16 = AddrTy == S16;
----------------
This simplifies to `GradTy == S16 && (!ST.hasG16() || BaseOpcode->Gradients)` - but perhaps your way is more readable.


================
Comment at: llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.sample.g16.a16.dim.ll:860
 
+define amdgpu_ps <4 x float> @sample_d_1d_g16_a16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s) {
+; GFX10-LABEL: sample_d_1d_g16_a16:
----------------
How would these new tests fail without your patch? Would they fail machine verification?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143648



More information about the llvm-commits mailing list