| 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_TRANSFORMS_SCALAR_SCALAROPTIONS_H |
| 10 | #define LLVM_LIB_TRANSFORMS_SCALAR_SCALAROPTIONS_H |
| 11 | |
| 12 | #include "llvm/Analysis/TargetTransformInfo.h" |
| 13 | #include "llvm/IR/Function.h" |
| 14 | #include "llvm/IR/LLVMContext.h" |
| 15 | #include "llvm/Transforms/Utils/LoopUtils.h" |
| 16 | #include <limits> |
| 17 | #include <optional> |
| 18 | |
| 19 | namespace llvm { |
| 20 | enum class CRCStrategyKind { Disable, Auto, Table, Clmul }; |
| 21 | enum class LoopInterchangeRule { |
| 22 | PerLoopCacheAnalysis, |
| 23 | PerInstrOrderCost, |
| 24 | ForVectorization, |
| 25 | Ignore |
| 26 | }; |
| 27 | enum class MatrixLayoutTy { ColumnMajor, RowMajor }; |
| 28 | } // namespace llvm |
| 29 | |
| 30 | #define OPTIONS_STRUCT_DECL |
| 31 | #include "ScalarOptions.inc" |
| 32 | |
| 33 | namespace llvm { |
| 34 | |
| 35 | class Loop; |
| 36 | |
| 37 | inline const ScalarOptions &getScalarOptions(const LLVMContext &C) { |
| 38 | return C.getLibraryOptions().get<ScalarOptions>(); |
| 39 | } |
| 40 | |
| 41 | inline const ScalarOptions &getScalarOptions(const Function &F) { |
| 42 | return getScalarOptions(C: F.getContext()); |
| 43 | } |
| 44 | |
| 45 | const ScalarOptions &getScalarOptions(const Loop &L); |
| 46 | |
| 47 | } // namespace llvm |
| 48 | |
| 49 | #endif // LLVM_LIB_TRANSFORMS_SCALAR_SCALAROPTIONS_H |
| 50 |