blob: 19c1c70e4529b2239d333b6b63bcd82a770d87a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef RCC_CODEGEN_MACHINESTACKSLOTCOLORING_H
#define RCC_CODEGEN_MACHINESTACKSLOTCOLORING_H
#include "rcc/CodeGen/MachinePass.h"
#include <cstddef>
namespace rcc {
struct MachineStackSlotColoringOptions final {
std::size_t MaximumColoredSlots = 4'096;
};
class MachineStackSlotColoringPass final : public MachineFunctionPass {
public:
explicit MachineStackSlotColoringPass(MachineStackSlotColoringOptions Options = {}) noexcept
: Options(Options) {}
[[nodiscard]] const MachinePassContract &contract() const noexcept override;
[[nodiscard]] Expected<MachinePassResult> run(MachineFunction &Function,
const TargetDescription &Target,
MachineAnalysisManager &Analyses) override;
private:
[[nodiscard]] Expected<MachinePassResult> runImplementation(MachineFunction &Function) const;
MachineStackSlotColoringOptions Options;
};
} // namespace rcc
#endif // RCC_CODEGEN_MACHINESTACKSLOTCOLORING_H
|