LLVM 17.0.0git
|
An optimization pass providing Scalar Replacement of Aggregates. More...
#include "llvm/Transforms/Scalar/SROA.h"
Public Member Functions | |
SROAPass (SROAOptions PreserveCFG) | |
If PreserveCFG is set, then the pass is not allowed to modify CFG in any way, even if it would update CFG analyses. | |
PreservedAnalyses | run (Function &F, FunctionAnalysisManager &AM) |
Run the pass over the function. | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
![]() | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Friends | |
class | sroa::AllocaSliceRewriter |
class | sroa::SROALegacyPass |
Additional Inherited Members | |
![]() | |
static StringRef | name () |
Gets the name of the pass we are mixed into. | |
An optimization pass providing Scalar Replacement of Aggregates.
This pass takes allocations which can be completely analyzed (that is, they don't escape) and tries to turn them into scalar SSA values. There are a few steps to this process.
1) It takes allocations of aggregates and analyzes the ways in which they are used to try to split them into smaller allocations, ideally of a single scalar data type. It will split up memcpy and memset accesses as necessary and try to isolate individual scalar accesses. 2) It will transform accesses into forms which are suitable for SSA value promotion. This can be replacing a memset with a scalar store of an integer value, or it can involve speculating operations on a PHI or select to be a PHI or select of the results. 3) Finally, this will try to detect a pattern of accesses which map cleanly onto insert and extract operations on a vector value, and convert them to this form. By doing so, it will enable promotion of vector aggregates to SSA vector values.
SROAPass::SROAPass | ( | SROAOptions | PreserveCFG | ) |
void SROAPass::printPipeline | ( | raw_ostream & | OS, |
function_ref< StringRef(StringRef)> | MapClassName2PassName | ||
) |
Definition at line 5159 of file SROA.cpp.
References OS, and llvm::PreserveCFG.
PreservedAnalyses SROAPass::run | ( | Function & | F, |
FunctionAnalysisManager & | AM | ||
) |
Run the pass over the function.
Definition at line 5153 of file SROA.cpp.
References F, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), and runImpl().
|
friend |
|
friend |