This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine][AMDGPU] Handle more buffer intrinsics
ClosedPublic

Authored by piotr on Dec 19 2018, 2:38 AM.

Details

Summary

Include the following intrinsics in the InsctCombine
simplification:

  • amdgcn_raw_buffer_load
  • amdgcn_raw_buffer_load_format
  • amdgcn_struct_buffer_load
  • amdgcn_struct_buffer_load_format

Change-Id: I14deceff74bcb21179baf6aa6e94bf39e7d63d5d

Diff Detail

Repository
rL LLVM

Event Timeline

piotr created this revision.Dec 19 2018, 2:38 AM
arsenm accepted this revision.Dec 19 2018, 2:57 AM
arsenm added a subscriber: arsenm.

LGTM. Can the scalar load intrinsics also be handled?

This revision is now accepted and ready to land.Dec 19 2018, 2:57 AM
piotr added a comment.EditedDec 19 2018, 6:16 AM

LGTM. Can the scalar load intrinsics also be handled?

Hi Matt,

Could you please describe what kind of a transformation you have in mind?

The function simplifyAMDGCNMemoryIntrinsicDemanded only does a useful work for vector inputs.

The primary gain from this patch is to handle such constructs as evidenced in test line 471:

from:

%data = call <3 x float> @llvm.amdgcn.raw.buffer.load.v3f32
%elt0 = extractelement <3 x float> %data, i32 0
ret float %elt0

into

%data = call float @llvm.amdgcn.raw.buffer.load.f32
ret float %data
This revision was automatically updated to reflect the committed changes.
piotr added a comment.Dec 20 2018, 2:15 AM

Thanks for the review. I have just pushed the patch. Feel free to suggest ideas to extend this patch and I will be happy to work on them.