CIRCT 22.0.0git
Loading...
Searching...
No Matches
RTGPassPipelines.cpp
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
13#include "mlir/Pass/PassManager.h"
14#include "mlir/Transforms/Passes.h"
15
16using namespace mlir;
17
18//===----------------------------------------------------------------------===//
19// Pipeline implementation.
20//===----------------------------------------------------------------------===//
21
23 OpPassManager &pm, const RandomizationPipelineOptions &options) {
24 {
25 ElaborationPassOptions passOptions;
26 passOptions.seed = options.seed;
27 pm.addPass(rtg::createElaborationPass(passOptions));
28 }
29 pm.addPass(rtg::createInlineSequencesPass());
30 pm.addPass(createSymbolDCEPass());
31 {
32 auto &testPm = pm.nest<rtg::TestOp>();
33 MemoryAllocationPassOptions passOptions;
34 passOptions.useImmediates = options.memoriesAsImmediates;
35 testPm.addPass(rtg::createMemoryAllocationPass(passOptions));
36 testPm.addPass(rtg::createLowerUniqueLabelsPass());
37 testPm.addPass(rtg::createLinearScanRegisterAllocationPass());
38 }
39 {
40 auto &anyPm = pm.nestAny();
41 anyPm.addPass(mlir::createCSEPass());
42 anyPm.addPass(createSimpleCanonicalizerPass());
43 }
44 pm.addPass(rtg::createUniqueValidateOpsPass());
45}
46
47//===----------------------------------------------------------------------===//
48// Pipeline registration.
49//===----------------------------------------------------------------------===//
50
52 PassPipelineRegistration<RandomizationPipelineOptions>(
53 "rtg-randomization-pipeline",
54 "The default pipeline for randomizing RTG tests.",
56}
static std::unique_ptr< Pass > createSimpleCanonicalizerPass()
Create a simple canonicalizer pass.
void registerPipelines()
Registers all pipelines for the rtg dialect.
void buildRandomizationPipeline(mlir::OpPassManager &pm, const RandomizationPipelineOptions &options)
Adds the randomization pipeline to the OpPassManager.