LLVM 24.0.0git
VectorizeOptions.h
Go to the documentation of this file.
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_VECTORIZE_VECTORIZEOPTIONS_H
10#define LLVM_LIB_TRANSFORMS_VECTORIZE_VECTORIZEOPTIONS_H
11
12#include "llvm/IR/Function.h"
13#include "llvm/IR/LLVMContext.h"
15#include <optional>
16
17namespace llvm {
19enum class TailFoldingStyle;
20
21/// Option tail-folding-policy controls the tail-folding strategy and lists all
22/// available options. The vectorizer will attempt to fold the tail-loop into
23/// the vector loop (main/epilogue loops) and predicate the instructions
24/// accordingly. If tail-folding fails, there are different fallback strategies
25/// depending on these values:
27
28// The -sbvec-stop-at and -sbvec-stop-bndl value that disables the limit.
29constexpr unsigned long SBVecStopDisabled = ~0UL;
30
31#ifdef EXPENSIVE_CHECKS
32constexpr bool VPlanVerifyEachDefault = true;
33#else
34constexpr bool VPlanVerifyEachDefault = false;
35#endif
36} // namespace llvm
37
38#define OPTIONS_STRUCT_DECL
39#include "VectorizeOptions.inc"
40
41namespace llvm {
42
43class Loop;
44namespace sandboxir {
45class Context;
46} // namespace sandboxir
47
48inline const VectorizeOptions &getVectorizeOptions(const LLVMContext &C) {
49 return C.getLibraryOptions().get<VectorizeOptions>();
50}
51
52inline const VectorizeOptions &getVectorizeOptions(const Function &F) {
53 return getVectorizeOptions(F.getContext());
54}
55
56const VectorizeOptions &getVectorizeOptions(const Loop &L);
57const VectorizeOptions &getVectorizeOptions(const sandboxir::Context &C);
58
59} // namespace llvm
60
61#endif // LLVM_LIB_TRANSFORMS_VECTORIZE_VECTORIZEOPTIONS_H
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
This file defines the LoopVectorizationLegality class.
#define F(x, y, z)
Definition MD5.cpp:54
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
This is an optimization pass for GlobalISel generic memory operations.
TailFoldingPolicyTy
Option tail-folding-policy controls the tail-folding strategy and lists all available options.
constexpr unsigned long SBVecStopDisabled
constexpr bool VPlanVerifyEachDefault
const VectorizeOptions & getVectorizeOptions(const LLVMContext &C)