LLVM  15.0.0git
Scalarizer.h
Go to the documentation of this file.
1 //===- Scalarizer.h --- Scalarize vector operations -----------------------===//
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 /// \file
10 /// This pass converts vector operations into scalar operations, in order
11 /// to expose optimization opportunities on the individual scalar operations.
12 /// It is mainly intended for targets that do not have vector units, but it
13 /// may also be useful for revectorizing code to different vector widths.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_TRANSFORMS_SCALAR_SCALARIZER_H
18 #define LLVM_TRANSFORMS_SCALAR_SCALARIZER_H
19 
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/IR/PassManager.h"
22 
23 namespace llvm {
24 
25 class Function;
26 class FunctionPass;
27 
29  // These optional booleans correspond 1:1 to cl::opt<bool> options defined in
30  // Scalarizer.cpp. When the cl::opt are specified, they take precedence.
31  // When the cl::opt are not specified, the present optional booleans allow to
32  // override the cl::opt's default values.
35 };
36 
37 class ScalarizerPass : public PassInfoMixin<ScalarizerPass> {
38  ScalarizerPassOptions Options;
39 
40 public:
42 
44  Options.ScalarizeVariableInsertExtract = Value;
45  }
46  void setScalarizeLoadStore(bool Value) { Options.ScalarizeLoadStore = Value; }
47 };
48 
49 /// Create a legacy pass manager instance of the Scalarizer pass
50 FunctionPass *createScalarizerPass();
51 
52 }
53 
54 #endif /* LLVM_TRANSFORMS_SCALAR_SCALARIZER_H */
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
Optional.h
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371
llvm::Function
Definition: Function.h:60
llvm::Optional< bool >
F
#define F(x, y, z)
Definition: MD5.cpp:55
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::ScalarizerPass
Definition: Scalarizer.h:37
llvm::ScalarizerPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: Scalarizer.cpp:999
llvm::ScalarizerPass::setScalarizeVariableInsertExtract
void setScalarizeVariableInsertExtract(bool Value)
Definition: Scalarizer.h:43
llvm::ScalarizerPassOptions
Definition: Scalarizer.h:28
llvm::ScalarizerPass::setScalarizeLoadStore
void setScalarizeLoadStore(bool Value)
Definition: Scalarizer.h:46
llvm::createScalarizerPass
FunctionPass * createScalarizerPass()
Create a legacy pass manager instance of the Scalarizer pass.
Definition: Scalarizer.cpp:357
llvm::ScalarizerPassOptions::ScalarizeVariableInsertExtract
llvm::Optional< bool > ScalarizeVariableInsertExtract
Definition: Scalarizer.h:33
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
PassManager.h
llvm::ScalarizerPassOptions::ScalarizeLoadStore
llvm::Optional< bool > ScalarizeLoadStore
Definition: Scalarizer.h:34
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:42
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::codeview::PublicSymFlags::Function
@ Function