| 1 | //===----------------------------------------------------------------------===// |
| 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 | #ifndef LLVM_LIB_ANALYSIS_ANALYSISOPTIONS_H |
| 10 | #define LLVM_LIB_ANALYSIS_ANALYSISOPTIONS_H |
| 11 | |
| 12 | #include "llvm/IR/Function.h" |
| 13 | #include "llvm/IR/LLVMContext.h" |
| 14 | #include <cstdint> |
| 15 | #include <optional> |
| 16 | |
| 17 | namespace llvm { |
| 18 | |
| 19 | namespace dxbc::SourceInfo::Contents { |
| 20 | enum class CompressionType : uint16_t; |
| 21 | } // namespace dxbc::SourceInfo::Contents |
| 22 | |
| 23 | // Forward-declared so that Analysis headers can include this one. Fields of |
| 24 | // these types default to the zero enumerator. |
| 25 | enum class GVDAGType; |
| 26 | enum class IR2VecKind; |
| 27 | enum class InlinerFunctionImportStatsOpts; |
| 28 | enum class PGOViewCountsType; |
| 29 | |
| 30 | enum class OutputCostKind { |
| 31 | RecipThroughput, |
| 32 | Latency, |
| 33 | CodeSize, |
| 34 | SizeAndLatency, |
| 35 | All, |
| 36 | }; |
| 37 | |
| 38 | enum class IntrinsicCostStrategy { |
| 39 | InstructionCost, |
| 40 | IntrinsicCost, |
| 41 | TypeBasedIntrinsicCost, |
| 42 | }; |
| 43 | |
| 44 | enum class CtxProfPrintMode { Everything, YAML }; |
| 45 | |
| 46 | // Types of dependence test routines. |
| 47 | enum class DependenceTestType { |
| 48 | Default, // All tests except BanerjeeMIV |
| 49 | All, |
| 50 | StrongSIV, |
| 51 | WeakCrossingSIV, |
| 52 | ExactSIV, |
| 53 | WeakZeroSIV, |
| 54 | ExactRDIV, |
| 55 | GCDMIV, |
| 56 | BanerjeeMIV, |
| 57 | }; |
| 58 | |
| 59 | enum class ForceSummaryHotness { None, AllNonCritical, All }; |
| 60 | |
| 61 | enum class InlinePriorityMode : int { Size, Cost, CostBenefit, ML }; |
| 62 | |
| 63 | enum class StencilMergePolicy { Off, Auto, Force }; |
| 64 | |
| 65 | enum class SkipMLPolicyCriteria { Never, IfCallerIsNotCold }; |
| 66 | |
| 67 | } // namespace llvm |
| 68 | |
| 69 | #define OPTIONS_STRUCT_DECL |
| 70 | #include "AnalysisOptions.inc" |
| 71 | |
| 72 | namespace llvm { |
| 73 | |
| 74 | class Loop; |
| 75 | class Module; |
| 76 | |
| 77 | inline const AnalysisOptions &getAnalysisOptions(const LLVMContext &C) { |
| 78 | return C.getLibraryOptions().get<AnalysisOptions>(); |
| 79 | } |
| 80 | |
| 81 | inline const AnalysisOptions &getAnalysisOptions(const Function &F) { |
| 82 | return getAnalysisOptions(C: F.getContext()); |
| 83 | } |
| 84 | |
| 85 | const AnalysisOptions &getAnalysisOptions(const Module &M); |
| 86 | const AnalysisOptions &getAnalysisOptions(const Loop &L); |
| 87 | |
| 88 | } // namespace llvm |
| 89 | |
| 90 | #endif // LLVM_LIB_ANALYSIS_ANALYSISOPTIONS_H |
| 91 | |