16 #include "mlir/Pass/Pass.h"
20 #define GEN_PASS_DEF_LOWERINTRINSICS
21 #include "circt/Dialect/FIRRTL/Passes.h.inc"
25 using namespace circt;
26 using namespace firrtl;
33 struct LowerIntrinsicsPass
34 :
public circt::firrtl::impl::LowerIntrinsicsBase<LowerIntrinsicsPass> {
35 LogicalResult initialize(MLIRContext *context)
override;
36 void runOnOperation()
override;
38 std::shared_ptr<IntrinsicLowerings> lowering;
43 LogicalResult LowerIntrinsicsPass::initialize(MLIRContext *context) {
47 loweringCollection.populateIntrinsicLowerings(lowering);
49 this->lowering = std::make_shared<IntrinsicLowerings>(std::move(lowering));
54 void LowerIntrinsicsPass::runOnOperation() {
55 auto result = lowering->lower(getOperation());
57 return signalPassFailure();
59 numConverted += *result;
62 markAllAnalysesPreserved();
67 return std::make_unique<LowerIntrinsicsPass>();
Lowering helper which collects all intrinsic converters.
std::unique_ptr< mlir::Pass > createLowerIntrinsicsPass()
This is the pass constructor.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.