LLVM 22.0.0git
RegAllocGreedyPass.h
Go to the documentation of this file.
1//==- RegAllocGreedyPass.h --- greedy register allocator pass ------*-C++-*-==//
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#ifndef LLVM_CODEGEN_REGALLOC_GREEDY_PASS_H
9#define LLVM_CODEGEN_REGALLOC_GREEDY_PASS_H
10
14#include "llvm/IR/PassManager.h"
15
16using namespace llvm;
17
18class RAGreedyPass : public PassInfoMixin<RAGreedyPass> {
19public:
20 struct Options {
23 Options(RegAllocFilterFunc F = nullptr, StringRef FN = "all")
24 : Filter(std::move(F)), FilterName(FN) {};
25 };
26
27 RAGreedyPass(Options Opts = Options()) : Opts(std::move(Opts)) {}
29
31 return MachineFunctionProperties().setNoPHIs();
32 }
33
35 return MachineFunctionProperties().setIsSSA();
36 }
37
38 void
40 function_ref<StringRef(StringRef)> MapClassName2PassName) const;
41 static bool isRequired() { return true; }
42
43private:
44 Options Opts;
45};
46
47#endif // LLVM_CODEGEN_REGALLOC_GREEDY_PASS_H
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition: MD5.cpp:55
raw_pwrite_stream & OS
static bool isRequired()
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) const
MachineFunctionProperties getRequiredProperties() const
MachineFunctionProperties getClearedProperties() const
PreservedAnalyses run(MachineFunction &F, MachineFunctionAnalysisManager &AM)
RAGreedyPass(Options Opts=Options())
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
Properties which a MachineFunction may have at a given point in time.
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:112
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
std::function< bool(const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, const Register Reg)> RegAllocFilterFunc
Filter function for register classes during regalloc.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1886
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:856
Options(RegAllocFilterFunc F=nullptr, StringRef FN="all")
RegAllocFilterFunc Filter
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:70