This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Reduction ops canonicalizatios
ClosedPublic

Authored by Hardcode84 on Apr 25 2023, 1:13 PM.

Details

Summary

Make group ops uniform if gpu.launch is their direct parent.

Diff Detail

Event Timeline

Hardcode84 created this revision.Apr 25 2023, 1:13 PM
Hardcode84 requested review of this revision.Apr 25 2023, 1:13 PM
ThomasRaoux added inline comments.May 9 2023, 6:52 AM
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
435–438

this is only correct if we assume all control flow is structured control flow right? I believe LaunchOp region is allowed to have multiple blocks. I wonder if we should check that the op belongs to the first block of LaunchOp region instead?

Hardcode84 added inline comments.May 9 2023, 7:00 AM
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
435–438

I believe LaunchOp region is allowed to have multiple blocks

Does it really? I'm only using structured cf so I've never checked it.

I will add a check so it will only do fold for entry blocks then.

Hardcode84 updated this revision to Diff 520826.May 9 2023, 2:51 PM

rebase, only convert ops in entry block.

Hardcode84 marked an inline comment as done.May 9 2023, 2:51 PM
ThomasRaoux accepted this revision.May 9 2023, 3:25 PM
This revision is now accepted and ready to land.May 9 2023, 3:25 PM
This revision was automatically updated to reflect the committed changes.