[PATCH] D117876: [AMDGPU][InstCombine] Remove zero image offset

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 24 09:27:06 PST 2022


sebastian-ne added a comment.

> wouldn't it be nice if there was some way to autogenerate the Offset to NoOffset Optimization Mapping table?

Definitely would be nice. I couldn’t find a way to do that easily though. The features (offset, g16, coarse derivatives, lod, bias, etc., etc.) of image instructions are heavily dependent on each other, making it hard to be generic over them.
The only place where the dependencies are spelled out is in the amdgpu intrinsic definitions (which is part of generic llvm and does not have the instruction definitions).

Maybe one could

1. create one big table of image instructions with their properties in the intrinsic definitions
2. derive the intrinsics from that table (in generic llvm)
3. derive the pseudo-instructions from that table (in the amdgpu target)
4. create a lookup table for feature-matrix (offset, lod, etc.) to intrinsic/instruction

Having that would be nice but creating that would surely be a lot of work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117876



More information about the llvm-commits mailing list