This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Provide bare pointer memref lowering option on gpu-to-nvvm pass
ClosedPublic

Authored by bondhugula on Jun 8 2023, 3:39 PM.

Details

Summary

Provide the bare pointer memref lowering option on gpu-to-nvvm pass.
This is needed whenever we lower memrefs on the host function side and
the kernel calls on the host-side (gpu-to-llvm) with the bare ptr
convention. The GPU module side of the lowering should also "align" and
use the bare pointer convention.

Diff Detail

Event Timeline

bondhugula created this revision.Jun 8 2023, 3:39 PM
Herald added a project: Restricted Project. · View Herald Transcript
bondhugula requested review of this revision.Jun 8 2023, 3:39 PM

Set the option more naturally.

This revision is now accepted and ready to land.Jun 12 2023, 9:37 AM

You might want to add a test though

Add integration test cases for bare pointer memref lowering for kernels as well
as host-side IR. Tests the options for both gpu-to-nvvm and gpu-to-llvm.

@mehdi_amini Here's the test case for using bare pointers on the host side as well.

Adjust comments and dealloc.

Can you add a unit-test please? Integration test are never replacement for unit-tests.

Add unit test case for memref lowering for gpu-to-nvvm.

Can you add a unit-test please? Integration test are never replacement for unit-tests.

Done - added unit test case. (The reason I thought it wasn't necessary was that memref bare ptr lowering already had unit test cases in func-to-llvm. The testing here is repeating/exercising the same lowering. But it's good to have it anyway to show all the users of the feature in the tree and to ensure the option is indeed working.)

mehdi_amini accepted this revision.Jun 18 2023, 1:31 AM