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;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static const OptimizationLevel O3
Optimize for fast execution as much as possible.
bool operator==(const OptimizationLevel &Other) const
bool isOptimizingForSize() const
static const OptimizationLevel Oz
A very specialized mode that will optimize for code size at any and all costs.
OptimizationLevel()=default
static const OptimizationLevel O0
Disable as many optimizations as possible.
unsigned getSizeLevel() const
static const OptimizationLevel Os
Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...
bool operator!=(const OptimizationLevel &Other) const
unsigned getSpeedupLevel() const
static const OptimizationLevel O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
bool isOptimizingForSpeed() const
static const OptimizationLevel O1
Optimize quickly without destroying debuggability.
This is an optimization pass for GlobalISel generic memory operations.