[all-commits] [llvm/llvm-project] a3d2f4: [[mlir][linalg] Infer reduction-neutral padding va...
Jianhui Li via All-commits
all-commits at lists.llvm.org
Tue Sep 15 11:05:03 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a3d2f4b4a0aee08f26aa218e4e4d9dae1afa1d7a
https://github.com/llvm/llvm-project/commit/a3d2f4b4a0aee08f26aa218e4e4d9dae1afa1d7a
Author: Jianhui Li <jian.hui.li at intel.com>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
A mlir/test/Dialect/Linalg/pad-neutral.mlir
Log Message:
-----------
[[mlir][linalg] Infer reduction-neutral padding values in rewriteAsPaddedOp (#216517)
**Problem**:
with no explicit options.paddingValues, rewriteAsPaddedOp padded every
operand with zero — silently corrupting reductions (a padded
maximumf/mulf element gets combined).
**Change**:
Added a new public linalg::inferPaddingValues(builder, toPad) to pick a
semantics-preserving value per operand:
- no reduction dim → zero;
- contraction → zero (0 annihilates through the multiply);
- other reductions → the combiner's neutral (-inf for maximumf, 1 for
mulf, …), found via matchReduction so the real accumulator combiner is
used.
rewriteAsPaddedOp calls it when options.paddingValues is empty. If no
value can be inferred, it returns failure() with the error "could not
infer a padding value"; the caller is then expected to determine the
value and supply it explicitly through options.paddingValues.
assited-by-claude
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list