This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Start handling _L to _LZ optimization
ClosedPublic

Authored by arsenm on Feb 10 2020, 6:10 AM.

Details

Summary

We currently don't have a way to map to the equivalent intrinsic
opcode, so track immediate 0s in place of the address for the
selection to know to change the final opcode.

Diff Detail

Event Timeline

arsenm created this revision.Feb 10 2020, 6:10 AM
nhaehnle added inline comments.Mar 30 2020, 8:16 AM
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
3727–3731

This no longer applies, does it? MIMGLZMappingTable contains L and LZ fields of type MIMGBaseOpcode now.

arsenm marked an inline comment as done.Mar 30 2020, 8:51 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
3727–3731

This is still in terms of the machine opcode, not the intrinsic ID

nhaehnle added inline comments.Mar 30 2020, 8:57 AM
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
3727–3731

How about doing a reverse lookup with a second index like

def getImageDimInstrinsicByBaseOpcode : SearchIndex {
  let Table = ImageDimIntrinsicTable;
  let Key = ["BaseOpcode", "Dim"];
}

which should auto-generate a C++ function with signature:

const ImageDimIntrinsicInfo *getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, MIMGDim Dim);
arsenm updated this revision to Diff 253667.Mar 30 2020, 12:31 PM

Change intrinsic ID

Change intrinsic ID

Probably also need to do this for // Optimize _mip away, when 'lod' is zero

Change intrinsic ID

Actually this requires removing the operand, which ripples through all of the other patches. At this point I think this needs to be a follow up patch

arsenm accepted this revision.Mar 30 2020, 2:03 PM

Split out the intrinsic change, 42d5609809836aceff41f78ab652a882d4982260

This revision is now accepted and ready to land.Mar 30 2020, 2:03 PM
arsenm closed this revision.Mar 30 2020, 2:03 PM