Skip to content

Commit

Permalink
Small bugfix in EmplaceAllocations (#15261)
Browse files Browse the repository at this point in the history
Added some checks to avoid insertion point errors. This is a bit of a
quick fix, as ideally we would find a way to move entire trees up when
possible, but I'll file an issue for that.
  • Loading branch information
dan-garvey committed Oct 27, 2023
1 parent 222bcf2 commit f29895e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ static bool tryEmplaceDispatchOp(IREE::Stream::AsyncDispatchOp dispatchOp) {
// TODO(#14566): continue if sparse emplacement on multiple results.
break;
}
if (!IREE::Util::isValueUsableForOp(updateOp.getTargetSize(), dispatchOp))
break;
if (!IREE::Util::isValueUsableForOp(updateOp.getTargetOffset(),
dispatchOp))
break;
if (!IREE::Util::isValueUsableForOp(updateOp.getTargetEnd(), dispatchOp))
break;
if (!IREE::Util::isValueUsableForOp(updateOp.getUpdateSize(), dispatchOp))
break;
if (!IREE::Util::tryMoveProducerBefore(updateOp.getTarget(),
dispatchOp)) {
// Failed to move while keeping valid SSA dominance.
Expand Down

0 comments on commit f29895e

Please sign in to comment.