Remove dangling constant op (#205)
This commit is contained in:
parent
7e05f371de
commit
8b6cf7c661
|
@ -222,8 +222,12 @@ private:
|
|||
|
||||
// Trailing optional inputs.
|
||||
if (!variadicIn)
|
||||
for (auto i = inputs.size(); i < expectedNumOperands; i++)
|
||||
for (auto i = inputs.size(); i < expectedNumOperands; i++) {
|
||||
if (!none_)
|
||||
none_ = builder_.create<mlir::ConstantOp>(
|
||||
UnknownLoc(), builder_.getUnitAttr());
|
||||
inputs.emplace_back(none_);
|
||||
}
|
||||
|
||||
std::vector<mlir::Type> outputTypes;
|
||||
|
||||
|
@ -482,11 +486,6 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
// Create a NoneTyped constant to be used for optional operation inputs
|
||||
// which are not used.
|
||||
none_ =
|
||||
builder_.create<mlir::ConstantOp>(UnknownLoc(), builder_.getUnitAttr());
|
||||
|
||||
// Import nodes in the graph.
|
||||
for (const auto &item : graph.node()) {
|
||||
ImportNode(item);
|
||||
|
|
Loading…
Reference in New Issue