mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-27 11:55:49 +00:00
[mlir][Linalg] Fix incorrect erase order
This commit is contained in:
parent
d462aa5a61
commit
52e25523a9
@ -595,11 +595,14 @@ LogicalResult mlir::linalg::hoistPaddingOnTensors(SimplePadOp &simplePadOp,
|
||||
b.create<SubTensorOp>(loc, simplePadOp.getResultType(), packedTensor,
|
||||
offsets, sizes, strides)
|
||||
->getResult(0));
|
||||
simplePadOp.erase();
|
||||
|
||||
Operation *toErase = simplePadOp;
|
||||
|
||||
// Make the newly cloned `simplePadOp` available to the caller.
|
||||
simplePadOp =
|
||||
cast<SimplePadOp>(bvm.lookup(simplePadOp.result()).getDefiningOp());
|
||||
|
||||
toErase->erase();
|
||||
|
||||
return success();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user