Add support for PatternRewriter::eraseOp.
This hook is useful when an operation is known to be dead, and no replacement values make sense. PiperOrigin-RevId: 275052756
This commit is contained in:
committed by
A. Unique TensorFlower
parent
f1f9e3b8d1
commit
dfe09cc621
@@ -363,7 +363,7 @@ struct FuncOpConversion : public LLVMLegalizationPattern<FuncOp> {
|
||||
}
|
||||
}
|
||||
|
||||
rewriter.replaceOp(op, llvm::None);
|
||||
rewriter.eraseOp(op);
|
||||
return matchSuccess();
|
||||
}
|
||||
};
|
||||
@@ -474,7 +474,7 @@ struct OneToOneLLVMOpLowering : public LLVMLegalizationPattern<SourceOp> {
|
||||
|
||||
// If the operation produced 0 or 1 result, return them immediately.
|
||||
if (numResults == 0)
|
||||
return rewriter.replaceOp(op, llvm::None), this->matchSuccess();
|
||||
return rewriter.eraseOp(op), this->matchSuccess();
|
||||
if (numResults == 1)
|
||||
return rewriter.replaceOp(op, newOp.getOperation()->getResult(0)),
|
||||
this->matchSuccess();
|
||||
|
||||
Reference in New Issue
Block a user