6 Commits

Author SHA1 Message Date
Nishant Patel
9f50004651
[MLIR][XeGPU] Enhance the peephole optimization to remove the convert_layout after multi-reduction rewrite (#188849) 2026-04-01 13:55:11 -07:00
Jianhui Li
989ea0e2d7
[MLIR][XeGPU] Lowering 2-Dimensional Reductions of N-D Tensors into Chained 1-D Reductions (#186034)
This PR relaxes the 2d reduction lowering in the peephole optimization
pass to allow source tensor to have n-d shape.
It also fixes a minor bug of accumulator lowering in the current
implementation.
2026-03-19 07:53:46 -07:00
Sang Ik Lee
97a6aa83ca
[MLIR][XeGPU][GPU] Optimize GPU to XeVM pipeline (#184711)
Some XeGPU transforms can generate code sequences that can simplified by
folding. But full canonicalization is not required. As an alternative,
remove canonicalize from some parts of the pipeline where only folding
is needed and add folding at the end of XeGPU blocking pass
and XeGPU peephole optimize pass.
2026-03-10 10:52:15 -07:00
Charitha Saumya
c6db35fd34
[mlir][xegpu] Retain order attribute during load + transpose optimization. (#183608)
As described in the title `order` attribute is ignored in this
transformation causing downstream test failures.
2026-02-26 14:51:37 -08:00
Jianhui Li
61b8a57839
[MLIR][XeGPU] Refactor layout propagation utilities (#179016)
This PR refactors layout propagation into two distinct components:
result/anchor layout setup and source layout inference from the result.

For operations that require a specific result layout due to semantic or
hardware constraints, the propagation logic explicitly sets up the
result or anchor layout. Otherwise, it infers the source layout from the
backward-propagated consumer layout.

The result or anchor layout may differ from the backward-propagated
consumer layout; any such discrepancies are resolved via the existing
layout-conflict mechanism.

**This PR introduces the following utility functions:**

Source layout inference:

> inferBroadcastSourceLayout()
> inferMultiReductionSourceLayout()
> inferBitCastSourceLayout()
> inferShapeCastSourceLayout()
> inferInsertStridedSliceSourceLayout()

Result / anchor layout setup:

> setupMultiReductionResultLayout()
> setupBitCastResultLayout()
> setupInsertStridedSliceResultLayout()
> setupLoadMatrixAnchorLayout()
> setupStoreMatrixAnchorLayout()
> setupLoadGatherAnchorLayout()
> setupStoreScatterAnchorLayout()

Part of subgroup distribution related code changes are separated and
created as PR https://github.com/llvm/llvm-project/pull/179018/changes.
2026-02-05 19:26:25 -08:00
Artem Kroviakov
0b7d14e9a8
[MLIR][XeGPU] Add 2D vector.multi_reduction optimization (#171154) 2026-01-14 12:58:30 +01:00