1 //===- CGPassBuilderOption.h - Options for pass builder ---------*- 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 //
9 // This file declares the CCState and CCValAssign classes, used for lowering
10 // and implementing calling conventions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TARGET_CGPASSBUILDEROPTION_H
15 #define LLVM_TARGET_CGPASSBUILDEROPTION_H
16 
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Target/TargetOptions.h"
19 #include <optional>
20 
21 namespace llvm {
22 
23 enum class RunOutliner { TargetDefault, AlwaysOutline, NeverOutline };
24 enum class RegAllocType { Default, Basic, Fast, Greedy, PBQP };
25 
26 // Not one-on-one but mostly corresponding to commandline options in
27 // TargetPassConfig.cpp.
28 struct CGPassBuilderOption {
29   std::optional<bool> OptimizeRegAlloc;
30   std::optional<bool> EnableIPRA;
31   bool DebugPM = false;
32   bool DisableVerify = false;
33   bool EnableImplicitNullChecks = false;
34   bool EnableBlockPlacementStats = false;
35   bool MISchedPostRA = false;
36   bool EarlyLiveIntervals = false;
37 
38   bool DisableLSR = false;
39   bool DisableCGP = false;
40   bool PrintLSR = false;
41   bool DisableMergeICmps = false;
42   bool DisablePartialLibcallInlining = false;
43   bool DisableConstantHoisting = false;
44   bool DisableSelectOptimize = true;
45   bool PrintISelInput = false;
46   bool PrintGCInfo = false;
47   bool RequiresCodeGenSCCOrder = false;
48 
49   RunOutliner EnableMachineOutliner = RunOutliner::TargetDefault;
50   RegAllocType RegAlloc = RegAllocType::Default;
51   std::optional<GlobalISelAbortMode> EnableGlobalISelAbort;
52 
53   std::optional<bool> VerifyMachineCode;
54   std::optional<bool> EnableFastISelOption;
55   std::optional<bool> EnableGlobalISelOption;
56 };
57 
58 CGPassBuilderOption getCGPassBuilderOption();
59 
60 } // namespace llvm
61 
62 #endif // LLVM_TARGET_CGPASSBUILDEROPTION_H
63