Go to the documentation of this file.
15 #ifndef LLVM_PASSES_OPTIMIZATIONLEVEL_H
16 #define LLVM_PASSES_OPTIMIZATIONLEVEL_H
23 unsigned SpeedLevel = 2;
24 unsigned SizeLevel = 0;
26 : SpeedLevel(SpeedLevel), SizeLevel(SizeLevel) {
29 "Optimization level for speed should be 0, 1, 2, or 3");
31 "Optimization level for size should be 0, 1, or 2");
32 assert((SizeLevel == 0 || SpeedLevel == 2) &&
33 "Optimize for size should be encoded with speedup level == 2");
115 return SizeLevel ==
Other.SizeLevel && SpeedLevel ==
Other.SpeedLevel;
118 return SizeLevel !=
Other.SizeLevel || SpeedLevel !=
Other.SpeedLevel;
This is an optimization pass for GlobalISel generic memory operations.
static const OptimizationLevel O1
Optimize quickly without destroying debuggability.
static const OptimizationLevel O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
OptimizationLevel()=default
bool operator!=(const OptimizationLevel &Other) const
static const OptimizationLevel O0
Disable as many optimizations as possible.
static const OptimizationLevel Oz
A very specialized mode that will optimize for code size at any and all costs.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static const OptimizationLevel O3
Optimize for fast execution as much as possible.
unsigned getSizeLevel() const
unsigned getSpeedupLevel() const
static const OptimizationLevel Os
Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...
bool isOptimizingForSize() const
bool isOptimizingForSpeed() const
Optional< std::vector< StOtherPiece > > Other
bool operator==(const OptimizationLevel &Other) const