LLVM  15.0.0git
Public Member Functions | Friends | List of all members
llvm::SROAPass Class Reference

An optimization pass providing Scalar Replacement of Aggregates. More...

#include "llvm/Transforms/Scalar/SROA.h"

Inheritance diagram for llvm::SROAPass:
Inheritance graph
Collaboration diagram for llvm::SROAPass:
Collaboration graph

Public Member Functions

 SROAPass ()=default
PreservedAnalyses run (Function &F, FunctionAnalysisManager &AM)
 Run the pass over the function. More...
- Public Member Functions inherited from llvm::PassInfoMixin< SROAPass >
void printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)


class sroa::AllocaSliceRewriter
class sroa::SROALegacyPass

Additional Inherited Members

- Static Public Member Functions inherited from llvm::PassInfoMixin< SROAPass >
static StringRef name ()
 Gets the name of the pass we are mixed into. More...

Detailed Description

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.

Definition at line 64 of file SROA.h.

Constructor & Destructor Documentation

◆ SROAPass()

llvm::SROAPass::SROAPass ( )

Member Function Documentation

◆ run()

PreservedAnalyses SROAPass::run ( Function F,
FunctionAnalysisManager AM 

Run the pass over the function.

Definition at line 4766 of file SROA.cpp.

References F, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), and runImpl().

Friends And Related Function Documentation

◆ sroa::AllocaSliceRewriter

friend class sroa::AllocaSliceRewriter

Definition at line 118 of file SROA.h.

◆ sroa::SROALegacyPass

friend class sroa::SROALegacyPass

Definition at line 119 of file SROA.h.

The documentation for this class was generated from the following files: