This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Add a pattern for transforming gpu.global_id to thread + blockId * blockDim
ClosedPublic

Authored by fmorac on Apr 21 2023, 6:50 PM.

Details

Summary

This patch implements a rewrite pattern for transforming gpu.global_id x
to gpu.thread_id + gpu.block_id * gpu.block_dim.

Diff Detail

Event Timeline

fmorac created this revision.Apr 21 2023, 6:50 PM
fmorac published this revision for review.Apr 24 2023, 5:49 AM
fmorac added a comment.May 1 2023, 7:23 AM

ping for review

fmorac updated this revision to Diff 521397.May 11 2023, 11:48 AM

Rebasing main.

makslevental accepted this revision.May 23 2023, 3:25 PM

Looks good to me (I'm surprised there isn't a general purpose utility like this that's akin to affine:detensorize).

This revision is now accepted and ready to land.May 23 2023, 3:25 PM