Skip to content

Commit 227c4cc

Browse files
committed
Set default other = 0 for masked load
1 parent 2b728ad commit 227c4cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Conversion/StructuredToMemref/StructuredToMemref.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,13 @@ struct LoadConverter : public OpConversionPattern<tts::LoadOp> {
784784
SmallVector<OpFoldResult> mixedDims = op.getMixedMaskDims();
785785

786786
// Fill load destination with other value
787-
if (Value other = op.getOther()) {
788-
fillWithValue(loc, alloc, other, tensorType.getShape(),
789-
op.getMixedMaskDims(), op.getStaticMaskDims(), rewriter);
787+
Value other = op.getOther();
788+
if (!other) {
789+
other = rewriter.create<arith::ConstantOp>(
790+
loc, rewriter.getZeroAttr(elemType));
790791
}
792+
fillWithValue(loc, alloc, other, tensorType.getShape(),
793+
op.getMixedMaskDims(), op.getStaticMaskDims(), rewriter);
791794

792795
auto ptrDefiningOp = ptr.getDefiningOp();
793796
if (ptrDefiningOp->hasAttr(WRAP_SIDE_BY_SIDE) ||

0 commit comments

Comments
 (0)