LLVM 22.0.0git
HardwareLoops.h
Go to the documentation of this file.
1//===- HardwareLoops.h ------------------------------------------*- 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/// \file
9///
10/// Defines an IR pass for the creation of hardware loops.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_HARDWARELOOPS_H
15#define LLVM_CODEGEN_HARDWARELOOPS_H
16
17#include "llvm/IR/PassManager.h"
18
19namespace llvm {
20
22 std::optional<unsigned> Decrement;
23 std::optional<unsigned> Bitwidth;
24 std::optional<bool> Force;
25 std::optional<bool> ForcePhi;
26 std::optional<bool> ForceNested;
27 std::optional<bool> ForceGuard;
28
31 return *this;
32 }
34 Bitwidth = Width;
35 return *this;
36 }
38 this->Force = Force;
39 return *this;
40 }
43 return *this;
44 }
47 return *this;
48 }
51 return *this;
52 }
53 bool getForcePhi() const {
54 return ForcePhi.has_value() && ForcePhi.value();
55 }
56 bool getForceNested() const {
57 return ForceNested.has_value() && ForceNested.value();
58 }
59 bool getForceGuard() const {
60 return ForceGuard.has_value() && ForceGuard.value();
61 }
62};
63
64class HardwareLoopsPass : public PassInfoMixin<HardwareLoopsPass> {
66
67public:
69 : Opts(Opts) { }
70
71 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
72};
73
74} // end namespace llvm
75
76#endif // LLVM_CODEGEN_HARDWARELOOPS_H
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:55
HardwareLoopsPass(HardwareLoopOptions Opts={})
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Count
Definition InstrProf.h:139
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
std::optional< bool > Force
HardwareLoopOptions & setForceNested(bool Force)
std::optional< bool > ForceGuard
std::optional< unsigned > Decrement
HardwareLoopOptions & setDecrement(unsigned Count)
HardwareLoopOptions & setForceGuard(bool Force)
HardwareLoopOptions & setForce(bool Force)
HardwareLoopOptions & setCounterBitwidth(unsigned Width)
std::optional< unsigned > Bitwidth
HardwareLoopOptions & setForcePhi(bool Force)
std::optional< bool > ForcePhi
std::optional< bool > ForceNested
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:70