Remove the offset parameter if it is zero.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM, but wouldn't it be nice if there was some way to autogenerate the Offset to NoOffset Optimization Mapping table?
Comment Actions
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
- create one big table of image instructions with their properties in the intrinsic definitions
- derive the intrinsics from that table (in generic llvm)
- derive the pseudo-instructions from that table (in the amdgpu target)
- 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.