|
| 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 options influencing building of codegen pipeline. |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +#ifndef LLVM_CODEGEN_CGPASSBUILDEROPTION_H |
| 14 | +#define LLVM_CODEGEN_CGPASSBUILDEROPTION_H |
| 15 | + |
| 16 | +#include "llvm/ADT/Optional.h" |
| 17 | +#include "llvm/ADT/StringRef.h" |
| 18 | +#include "llvm/Target/TargetOptions.h" |
| 19 | +#include <vector> |
| 20 | + |
| 21 | +namespace llvm { |
| 22 | +class TargetMachine; |
| 23 | + |
| 24 | +enum class RunOutliner { TargetDefault, AlwaysOutline, NeverOutline }; |
| 25 | +enum class RegAllocType { Default, Basic, Fast, Greedy, PBQP }; |
| 26 | +enum class CFLAAType { None, Steensgaard, Andersen, Both }; |
| 27 | + |
| 28 | +// Not one-on-one but mostly corresponding to commandline options in |
| 29 | +// TargetPassConfig.cpp |
| 30 | +struct CGPassBuilderOption { |
| 31 | + // Enable optimized register allocation compilation path |
| 32 | + Optional<bool> OptimizeRegAlloc; |
| 33 | + |
| 34 | + // Enable interprocedural register allocation to reduce load/store at |
| 35 | + // procedure calls |
| 36 | + Optional<bool> EnableIPRA; |
| 37 | + |
| 38 | + // Enable debug logging of pass pipeline |
| 39 | + bool DebugPM = false; |
| 40 | + |
| 41 | + // Disable machine function verification |
| 42 | + bool DisableVerify = false; |
| 43 | + |
| 44 | + // Fold null checks into faulting memory operations |
| 45 | + bool EnableImplicitNullChecksPass = false; |
| 46 | + |
| 47 | + // Collect probability-driven block placement stats |
| 48 | + bool EnableMachineBlockPlacementStatsPass = false; |
| 49 | + |
| 50 | + // Run MachineScheduler post regalloc (independent of preRA sched) |
| 51 | + bool EnablePostMachineSchedulerPass = false; |
| 52 | + |
| 53 | + // Run live interval analysis earlier in the pipeline |
| 54 | + bool EnableLiveIntervalsPass = false; |
| 55 | + |
| 56 | + // Disable Loop Strength Reduction Pass |
| 57 | + bool DisableLoopStrengthReducePass = false; |
| 58 | + |
| 59 | + // Disable Codegen Prepare |
| 60 | + bool DisableCodeGenPreparePass = false; |
| 61 | + |
| 62 | + // Disable MergeICmps Pass |
| 63 | + bool DisableMergeICmpsPass = false; |
| 64 | + |
| 65 | + // Disable Partial Libcall Inlining Pass |
| 66 | + bool DisablePartiallyInlineLibCallsPass = false; |
| 67 | + |
| 68 | + // Disable ConstantHoisting Pass |
| 69 | + bool DisableConstantHoistingPass = false; |
| 70 | + |
| 71 | + // Print LLVM IR produced by the loop-reduce pass |
| 72 | + bool PrintAfterLSR = false; |
| 73 | + |
| 74 | + // Print LLVM IR input to isel pass |
| 75 | + bool PrintISelInput = false; |
| 76 | + |
| 77 | + // Dump garbage collector data |
| 78 | + bool PrintGCInfo = false; |
| 79 | + |
| 80 | + // Enable codegen in SCC order. |
| 81 | + bool RequiresCodeGenSCCOrder = false; |
| 82 | + |
| 83 | + // Enable the machine outliner |
| 84 | + RunOutliner EnableMachineOutliner = RunOutliner::TargetDefault; |
| 85 | + |
| 86 | + // Register allocator to use |
| 87 | + RegAllocType RegAlloc = RegAllocType::Default; |
| 88 | + |
| 89 | + // Experimental option to use CFL-AA in codegen |
| 90 | + CFLAAType UseCFLAA = CFLAAType::None; |
| 91 | + |
| 92 | + // Enable abort calls when "global" instruction selection fails to |
| 93 | + // lower/select an instruction |
| 94 | + Optional<GlobalISelAbortMode> EnableGlobalISelAbort; |
| 95 | + |
| 96 | + // Verify generated machine code" |
| 97 | + Optional<bool> VerifyMachineCode; |
| 98 | + |
| 99 | + // Enable the "fast" instruction selector |
| 100 | + Optional<bool> EnableFastISelOption; |
| 101 | + |
| 102 | + // Enable the "global" instruction selector |
| 103 | + Optional<bool> EnableGlobalISelOption; |
| 104 | +}; |
| 105 | + |
| 106 | +CGPassBuilderOption getCGPassBuilderOption(); |
| 107 | + |
| 108 | +} // namespace llvm |
| 109 | + |
| 110 | +#endif // LLVM_CODEGEN_CGPASSBUILDEROPTION_H |
0 commit comments