DeadLock
This commit is contained in:
@@ -17,10 +17,10 @@ std::optional<unsigned> getDirectComputeLikeInputIndex(Operation* owner, unsigne
|
||||
return operandNumber - inputBegin;
|
||||
};
|
||||
|
||||
if (auto compute = dyn_cast<spatial::SpatCompute>(owner))
|
||||
if (auto compute = dyn_cast<spatial::SpatScheduledCompute>(owner))
|
||||
return getInputIndex(owner, compute.getInputs().size());
|
||||
|
||||
if (auto computeBatch = dyn_cast<spatial::SpatComputeBatch>(owner))
|
||||
if (auto computeBatch = dyn_cast<spatial::SpatScheduledComputeBatch>(owner))
|
||||
return getInputIndex(owner, computeBatch.getInputs().size());
|
||||
|
||||
return std::nullopt;
|
||||
@@ -32,13 +32,13 @@ void replaceAndEraseDirectComputeLikeInput(PatternRewriter& rewriter,
|
||||
Value replacement) {
|
||||
Block& body = owner->getRegion(0).front();
|
||||
BlockArgument bodyArgument;
|
||||
if (auto compute = dyn_cast<spatial::SpatCompute>(owner)) {
|
||||
if (auto compute = dyn_cast<spatial::SpatScheduledCompute>(owner)) {
|
||||
auto computeArg = compute.getInputArgument(inputIndex);
|
||||
assert(computeArg && "expected compute input block argument");
|
||||
bodyArgument = *computeArg;
|
||||
}
|
||||
else {
|
||||
auto batchArg = cast<spatial::SpatComputeBatch>(owner).getInputArgument(inputIndex);
|
||||
auto batchArg = cast<spatial::SpatScheduledComputeBatch>(owner).getInputArgument(inputIndex);
|
||||
assert(batchArg && "expected compute_batch input block argument");
|
||||
bodyArgument = *batchArg;
|
||||
}
|
||||
@@ -46,10 +46,10 @@ void replaceAndEraseDirectComputeLikeInput(PatternRewriter& rewriter,
|
||||
|
||||
rewriter.startOpModification(owner);
|
||||
bodyArgument.replaceAllUsesWith(replacement);
|
||||
if (auto compute = dyn_cast<spatial::SpatCompute>(owner))
|
||||
if (auto compute = dyn_cast<spatial::SpatScheduledCompute>(owner))
|
||||
compute.getInputsMutable().erase(inputIndex);
|
||||
else
|
||||
cast<spatial::SpatComputeBatch>(owner).getInputsMutable().erase(inputIndex);
|
||||
cast<spatial::SpatScheduledComputeBatch>(owner).getInputsMutable().erase(inputIndex);
|
||||
body.eraseArgument(bodyArgIndex);
|
||||
rewriter.finalizeOpModification(owner);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user