CIRCT 23.0.0git
Loading...
Searching...
No Matches
RTGPassPipelines.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef CIRCT_DIALECT_RTG_TRANSFORMS_RTGPASSPIPELINES_H
10#define CIRCT_DIALECT_RTG_TRANSFORMS_RTGPASSPIPELINES_H
11
12#include "mlir/Pass/PassOptions.h"
13
14namespace circt {
15namespace rtg {
16
17/// Options for the RTG randomization pipeline.
19 : public mlir::PassPipelineOptions<RandomizationPipelineOptions> {
20 PassOptions::Option<unsigned> seed{*this, "seed",
21 llvm::cl::desc("Seed for the RNG.")};
22 PassOptions::Option<bool> memoriesAsImmediates{
23 *this, "memories-as-immediates",
24 llvm::cl::desc("Lower memories to immediates instead of labels."),
25 llvm::cl::init(true)};
26};
27
28/// Options for the RTG emission pipeline.
30 : public mlir::PassPipelineOptions<EmissionPipelineOptions> {
31 PassOptions::Option<bool> splitOutput{
32 *this, "split-output",
33 llvm::cl::desc("If 'true' emits one file per 'rtg.test' in the IR. The "
34 "name of the file matches the test name and is placed in "
35 "'path'. Otherwise, path is interpreted as the full file "
36 "path including filename."),
37 llvm::cl::init(false)};
38 PassOptions::Option<std::string> path{
39 *this, "path",
40 llvm::cl::desc("The directory or file path in which the output files "
41 "should be created. If empty is is emitted to stderr (not "
42 "allowed if 'split-output' is set to 'true')")};
43};
44
45//===----------------------------------------------------------------------===//
46// Building and Registering.
47//===----------------------------------------------------------------------===//
48
49/// Adds the randomization pipeline to the `OpPassManager`.
50void populateRandomizationPipeline(mlir::OpPassManager &pm,
51 const RandomizationPipelineOptions &options);
52
53/// Adds the emission pipeline to the `OpPassManager`.
54void populateEmissionPipeline(mlir::OpPassManager &pm,
55 const EmissionPipelineOptions &options);
56
57/// Registers all pipelines for the `rtg` dialect.
59
60} // namespace rtg
61} // namespace circt
62
63#endif // CIRCT_DIALECT_RTG_TRANSFORMS_RTGPASSPIPELINES_H
void populateEmissionPipeline(mlir::OpPassManager &pm, const EmissionPipelineOptions &options)
Adds the emission pipeline to the OpPassManager.
void registerPipelines()
Registers all pipelines for the rtg dialect.
void populateRandomizationPipeline(mlir::OpPassManager &pm, const RandomizationPipelineOptions &options)
Adds the randomization pipeline to the OpPassManager.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition rtg.py:1
Options for the RTG emission pipeline.
PassOptions::Option< bool > splitOutput
PassOptions::Option< std::string > path
Options for the RTG randomization pipeline.
PassOptions::Option< bool > memoriesAsImmediates
PassOptions::Option< unsigned > seed