Skip to content

Commit b654c07

Browse files
authored
Merge pull request #430 from xiaohanAMD/xiao.fix-qdqaroundop-crash
return failure if cast failed
2 parents 4bce4f9 + 43fd370 commit b654c07

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Dialect/ONNX/Transforms/QDQAroundOpOpt.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,17 @@ class RemoveQDQAroundOpPattern : public OpRewritePattern<T> {
9595
rewriter.replaceOp(qOp, newOp.getResult());
9696
return success();
9797
}
98+
return failure();
9899
};
99100
};
100101
struct QDQAroundOpOptONNXToONNXPass
101102
: public PassWrapper<QDQAroundOpOptONNXToONNXPass,
102103
OperationPass<func::FuncOp>> {
103104
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(QDQAroundOpOptONNXToONNXPass)
104-
StringRef getArgument() const override {
105+
[[nodiscard]] StringRef getArgument() const override {
105106
return "qdq-around-op-opt-onnx-to-onnx";
106107
}
107-
StringRef getDescription() const override {
108+
[[nodiscard]] StringRef getDescription() const override {
108109
return "Remove QDQ around ops if safe.";
109110
}
110111

0 commit comments

Comments
 (0)