Skip to content

Commit 9ab7324

Browse files
authored
Fix crash when processing getMakeTensorPtr op through while loop (#4567)
Properly handle while loop in `getMakeTensorPtr`. This is common code, but given upstream is deprecating the feature I don't think they want to take this change. The test for this is in #4463 but I think it is better to keep the commit logically separate and not have it squashed and merged with #4463.
1 parent a293ad3 commit 9ab7324

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Dialect/Triton/IR/Utility.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ tt::MakeTensorPtrOp tt::getMakeTensorPtrOp(Value v) {
8989
: condBr.getFalseDestOperands()[argNum]);
9090
return tt::getMakeTensorPtrOp(argOwner->getOperand(argNum));
9191
}
92+
if (auto whileOp = dyn_cast<scf::WhileOp>(argOwner)) {
93+
return tt::getMakeTensorPtrOp(whileOp.getOperand(argNum));
94+
}
9295
llvm_unreachable("Unable to getMakeTensorPtr()");
9396
}
9497

0 commit comments

Comments
 (0)