mirror of https://github.com/llvm/circt.git
[ImportVerilog] Materialize constant calls directly
Instead of lowering constant calls to functions and system tasks, materialize the constant value directly.
This commit is contained in:
parent
b86194929e
commit
6a724e542b
|
@ -636,6 +636,12 @@ struct RvalueExprVisitor {
|
|||
mlir::emitError(loc, "unsupported class method call");
|
||||
return {};
|
||||
}
|
||||
|
||||
// Try to materialize constant values directly.
|
||||
auto constant = context.evaluateConstant(expr);
|
||||
if (auto value = context.materializeConstant(constant, *expr.type, loc))
|
||||
return value;
|
||||
|
||||
return std::visit(
|
||||
[&](auto &subroutine) { return visitCall(expr, subroutine); },
|
||||
expr.subroutine);
|
||||
|
|
Loading…
Reference in New Issue