LLVM API Documentation

ScalarReplAggregates.cpp File Reference

#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Pass.h"
#include "llvm/Instructions.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include <iostream>

Include dependency graph for ScalarReplAggregates.cpp:

Go to the source code of this file.

Functions

FunctionPassllvm::createScalarReplAggregatesPass ()
static bool AllUsersAreLoads (Value *Ptr)
 AllUsersAreLoads - Return true if all users of this value are loads.
static bool MergeInType (const Type *In, const Type *&Accum)
const TypegetUIntAtLeastAsBitAs (unsigned NumBits)

Variables

Statistic NumReplaced ("scalarrepl","Number of allocas broken up")
Statistic NumPromoted ("scalarrepl","Number of allocas promoted")
Statistic NumConverted ("scalarrepl","Number of aggregates converted to scalar")
RegisterOpt< SROA > X ("scalarrepl","Scalar Replacement of Aggregates")


Function Documentation

static bool AllUsersAreLoads ( Value Ptr  )  [static]

AllUsersAreLoads - Return true if all users of this value are loads.

Definition at line 275 of file ScalarReplAggregates.cpp.

References E, Load, llvm::Value::use_begin(), and llvm::Value::use_end().

const Type* getUIntAtLeastAsBitAs ( unsigned  NumBits  ) 

getUIntAtLeastAsBitAs - Return an unsigned integer type that is at least as big as the specified type. If there is no suitable type, this returns null.

Definition at line 435 of file ScalarReplAggregates.cpp.

static bool MergeInType ( const Type In,
const Type *&  Accum 
) [static]

MergeInType - Add the 'In' type to the accumulated type so far. If the types are incompatible, return true, otherwise update Accum and return false.

Definition at line 418 of file ScalarReplAggregates.cpp.

References llvm::Type::getTypeID(), and llvm::Type::isIntegral().


Variable Documentation

Statistic NumConverted("scalarrepl","Number of aggregates converted to scalar") [static]

Statistic NumPromoted("scalarrepl","Number of allocas promoted") [static]

Statistic NumReplaced("scalarrepl","Number of allocas broken up") [static]

RegisterOpt<SROA> X("scalarrepl","Scalar Replacement of Aggregates") [static]