Skip to content

Commit b9c02fc

Browse files
committed
fix a bug
1 parent ec4e7ad commit b9c02fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mlir/lib/Dialect/XeGPU/Utils/XeGPUUtils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ xegpu::LayoutAttr xegpu::getLayoutAttr(const Value value) {
141141
auto parentOp = arg.getOwner()->getParentOp();
142142
if (auto loop = dyn_cast<LoopLikeOpInterface>(parentOp)) {
143143
OpOperand *tiedInit = loop.getTiedLoopInit(arg);
144-
return getLayoutAttr(tiedInit->get());
144+
if (tiedInit)
145+
return getLayoutAttr(tiedInit->get());
145146
}
146147
}
147148

@@ -178,11 +179,15 @@ void xegpu::setLayoutAttrs(Operation *op,
178179
function_ref<LayoutAttr(Value)> getLayoutImpl) {
179180
op->walk([&](Operation *nestOp) {
180181
for (OpOperand &opr : nestOp->getOpOperands()) {
182+
llvm::dbgs() << "set layout for: " << opr.get();
181183
auto layout = getLayoutImpl(opr.get());
184+
llvm::dbgs() << " with: " << layout << "\n";
182185
setLayoutAttr(opr, layout);
183186
}
184187
for (OpResult result : nestOp->getOpResults()) {
188+
llvm::dbgs() << "set layout for: " << result;
185189
auto layout = getLayoutImpl(result);
190+
llvm::dbgs() << " with: " << layout << "\n";
186191
setLayoutAttr(result, layout);
187192
}
188193
});

0 commit comments

Comments
 (0)