17 #include "mlir/Pass/Pass.h"
21 #define GEN_PASS_DEF_LOWERINTRINSICS
22 #include "circt/Dialect/FIRRTL/Passes.h.inc"
26 using namespace circt;
27 using namespace firrtl;
34 struct LowerIntrinsicsPass
35 :
public circt::firrtl::impl::LowerIntrinsicsBase<LowerIntrinsicsPass> {
36 LogicalResult initialize(MLIRContext *context)
override;
37 void runOnOperation()
override;
39 std::shared_ptr<IntrinsicLowerings> lowering;
44 LogicalResult LowerIntrinsicsPass::initialize(MLIRContext *context) {
48 loweringCollection.populateIntrinsicLowerings(lowering);
50 this->lowering = std::make_shared<IntrinsicLowerings>(std::move(lowering));
55 void LowerIntrinsicsPass::runOnOperation() {
56 auto result = lowering->lower(getOperation());
58 return signalPassFailure();
60 numConverted += *result;
63 markAllAnalysesPreserved();
68 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.