diff options
| author | Ian Wood <ianwood2024@u.northwestern.edu> | 2024-11-27 00:00:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-26 16:00:18 -0800 |
| commit | 06514c550105b3111c23751421265c318bd69ac6 (patch) | |
| tree | 2aa117e40ceef14a402a8290ba381f25ab415d3f /llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp | |
| parent | 43b6b78771e9ab4da912b574664e713758c43110 (diff) | |
| download | llvm-06514c550105b3111c23751421265c318bd69ac6.zip llvm-06514c550105b3111c23751421265c318bd69ac6.tar.gz llvm-06514c550105b3111c23751421265c318bd69ac6.tar.bz2 | |
[MLIR][Linalg] Fix linalg crash during elementwise op fusion (#117667)
`isOpOperandCanBeDroppedAfterFusedLinalgs` crashes when `indexingMaps`
is empty. This can occur when `producer` only has DPS init operands and
`consumer ` only has a single DPS input operand (all operands are
ignored and nothing gets added to `indexingMaps`). This is because
`concatAffineMaps` wasn't handling the maps being empty properly.
Similar to `canOpOperandsBeDroppedImpl`, I added an early return when
the maps are of size zero. Additionally, `concatAffineMaps`'s
declaration comment says it returns an empty map when `maps` is empty
but it has no way to get the `MLIRContext` needed to construct the empty
affine map when the array is empty. So, I changed this to take the
context.
__NOTE: concatAffineMaps now takes an MLIRContext to be able to
construct an empty map in the case where `maps` is empty.__
---------
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Co-authored-by: Quinn Dawkins <quinn.dawkins@gmail.com>
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp')
0 files changed, 0 insertions, 0 deletions
