CIRCT 20.0.0git
Loading...
Searching...
No Matches
RtgToolOptions.cpp
Go to the documentation of this file.
1//===- RtgToolOptions.cpp -------------------------------------------------===//
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
13#include "mlir/Transforms/Passes.h"
14
15using namespace circt;
16using namespace circt::rtg;
17
18//===----------------------------------------------------------------------===//
19// RTG Tool Pipelines
20//===----------------------------------------------------------------------===//
21
22void rtg::populateRandomizerPipeline(mlir::PassManager &pm,
23 const RtgToolOptions &options) {
24 if (options.getVerifyPasses())
25 pm.enableVerifier(options.getVerifyPasses());
26
27 if (options.getVerbosePassExecution())
28 pm.addInstrumentation(
30 "rtgtool"));
31
33
34 if (options.getOutputFormat() == RtgToolOptions::OutputFormat::MLIR)
35 return;
36
37 {
38 ElaborationPassOptions passOptions;
39 passOptions.seed = options.getSeed();
40 pm.addPass(rtg::createElaborationPass(passOptions));
41 }
42 pm.addNestedPass<rtg::TestOp>(rtg::createLinearScanRegisterAllocationPass());
43 pm.addPass(mlir::createCSEPass());
45
46 if (options.getOutputFormat() == RtgToolOptions::OutputFormat::ElaboratedMLIR)
47 return;
48
49 {
50 EmitRTGISAAssemblyPassOptions passOptions;
51 SmallVector<std::string> unsupported(options.getUnsupportedInstructions());
52 passOptions.unsupportedInstructions = unsupported;
53 passOptions.unsupportedInstructionsFile =
55 passOptions.splitOutput = options.getSplitOutput();
56 passOptions.path = options.getOutputPath();
57 pm.addPass(rtg::createEmitRTGISAAssemblyPass(passOptions));
58 }
59}
The set of options used to control the behavior of the RTG tool.
OutputFormat getOutputFormat() const
std::string getOutputPath() const
ArrayRef< std::string > getUnsupportedInstructions() const
std::string getUnsupportedInstructionsFile() const
bool getVerbosePassExecution() const
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
std::unique_ptr< Pass > createSimpleCanonicalizerPass()
Create a simple canonicalizer pass.
Definition Passes.cpp:15