LLVM 24.0.0git
LogicalSROA.cpp File Reference

This transformation implements the well known scalar replacement of aggregates transformation but for logical pointers. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "logical-sroa"

Functions

static SmallVector< LifetimeIntrinsic * > collectLifetimeIntrinsicsUsing (Instruction &I)
static bool isAllocaSplittable (StructuredAllocaInst &SAI)
static SmallVector< SmallVector< StructuredGEPInst * > > collectPerFieldSGEP (StructuredAllocaInst &SAI)
static void copyLifetimeIntrinsicFor (IRBuilder<> &B, LifetimeIntrinsic *II, Value *V)
static void rewriteSGEPChain (IRBuilder<> &B, StructuredGEPInst *SGEP, StructuredAllocaInst *FieldAlloca)
static bool runOnStructuredAlloca (StructuredAllocaInst &SAI)
static bool runLogicalSROA (Function &F)

Detailed Description

This transformation implements the well known scalar replacement of aggregates transformation but for logical pointers.

It tries to identify promotable elements of an aggregate alloca, and promote them to multiple allocas of scalar type.

FIXME: nested aggregates are not fully optimized (#192619). FIXME: array are not optimized (#192620).

Definition in file LogicalSROA.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "logical-sroa"

Definition at line 32 of file LogicalSROA.cpp.

Function Documentation

◆ collectLifetimeIntrinsicsUsing()

SmallVector< LifetimeIntrinsic * > collectLifetimeIntrinsicsUsing ( Instruction & I)
static

◆ collectPerFieldSGEP()

◆ copyLifetimeIntrinsicFor()

void copyLifetimeIntrinsicFor ( IRBuilder<> & B,
LifetimeIntrinsic * II,
Value * V )
static

Definition at line 141 of file LogicalSROA.cpp.

References B(), II, and llvm_unreachable.

Referenced by runOnStructuredAlloca().

◆ isAllocaSplittable()

◆ rewriteSGEPChain()

◆ runLogicalSROA()

◆ runOnStructuredAlloca()