MergeNode ensure that channel must have 2 users
All checks were successful
Validate Operations / validate-operations (push) Successful in 16m7s

This commit is contained in:
ilgeco
2026-04-09 10:41:49 +02:00
parent ece24867e4
commit b468858d25

View File

@@ -61,11 +61,9 @@ public:
ChannelOrLocalOp getAsChannelValueAndInsertSender(SpatWeightedCompute spatWeightedCompute) {
if (channelSendInserter == nullptr) {
auto [first, second] = channelNewInserter();
channelNewOpVal = first;
channelSendInserter = second;
}
auto [first, second] = channelNewInserter();
channelNewOpVal = first;
channelSendInserter = second;
auto BB = computeResults.innerValue.getParentBlock();
if (!BB->empty() && isa<spatial::SpatYieldOp>(BB->back()))
insertPointSend = InsertPoint(BB, --BB->end());
@@ -292,7 +290,8 @@ private:
}
else {
auto newInst = rewriter.clone(op, mapper);
//TODO Refactor in a lambda? same code just different cast, but templated lambda are C++20 and a free function is a bit too much
// TODO Refactor in a lambda? same code just different cast, but templated lambda are C++20 and a free function
// is a bit too much
if (auto vmOp = llvm::dyn_cast<spatial::SpatWeightedMVMOp>(newInst)) {
auto oldIndex = vmOp.getWeightIndex();
auto newWeight = mapper.lookup(*std::next(fromCompute.getWeights().begin(), oldIndex));