LLVM API Documentation
#include "llvm/Transforms/IPO.h"#include "llvm/Constants.h"#include "llvm/DerivedTypes.h"#include "llvm/Module.h"#include "llvm/CallGraphSCCPass.h"#include "llvm/Instructions.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/CallGraph.h"#include "llvm/Target/TargetData.h"#include "llvm/Support/CallSite.h"#include "llvm/Support/CFG.h"#include "llvm/Support/Debug.h"#include "llvm/ADT/DepthFirstIterator.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringExtras.h"#include "llvm/Support/Compiler.h"#include <set>
Go to the source code of this file.
Defines | |
| #define | DEBUG_TYPE "argpromotion" |
Functions | |
| STATISTIC (NumArgumentsPromoted,"Number of pointer arguments promoted") | |
| STATISTIC (NumAggregatesPromoted,"Number of aggregate arguments promoted") | |
| STATISTIC (NumByValArgsPromoted,"Number of byval arguments promoted") | |
| STATISTIC (NumArgumentsDead,"Number of dead pointer args eliminated") | |
| Pass * | llvm::createArgumentPromotionPass (unsigned maxElements=3) |
| static bool | IsAlwaysValidPointer (Value *V) |
| static bool | AllCalleesPassInValidPointerForArgument (Argument *Arg) |
| static bool | IsPrefix (const ArgPromotion::IndicesVector &Prefix, const ArgPromotion::IndicesVector &Longer) |
| static bool | PrefixIn (const ArgPromotion::IndicesVector &Indices, std::set< ArgPromotion::IndicesVector > &Set) |
| Checks if Indices, or a prefix of Indices, is in Set. | |
| static void | MarkIndicesSafe (const ArgPromotion::IndicesVector &ToMark, std::set< ArgPromotion::IndicesVector > &Safe) |
Variables | |
| static RegisterPass< ArgPromotion > | X ("argpromotion","Promote 'by reference' arguments to scalars") |
| #define DEBUG_TYPE "argpromotion" |
Definition at line 32 of file ArgumentPromotion.cpp.
| static bool AllCalleesPassInValidPointerForArgument | ( | Argument * | Arg | ) | [static] |
AllCalleesPassInValidPointerForArgument - Return true if we can prove that all callees pass in a valid pointer for the specified function argument.
Definition at line 209 of file ArgumentPromotion.cpp.
References llvm::Function::arg_begin(), E, llvm::CallSite::get(), llvm::CallSite::getArgument(), llvm::CallSite::getInstruction(), llvm::Argument::getParent(), IsAlwaysValidPointer(), llvm::Value::use_begin(), and llvm::Value::use_end().
| static bool IsAlwaysValidPointer | ( | Value * | V | ) | [static] |
IsAlwaysValidPointer - Return true if the specified pointer is always legal to load.
Definition at line 196 of file ArgumentPromotion.cpp.
Referenced by AllCalleesPassInValidPointerForArgument().
| static bool IsPrefix | ( | const ArgPromotion::IndicesVector & | Prefix, | |
| const ArgPromotion::IndicesVector & | Longer | |||
| ) | [static] |
Returns true if Prefix is a prefix of longer. That means, Longer has a size that is greater than or equal to the size of prefix, and each of the elements in Prefix is the same as the corresponding elements in Longer.
This means it also returns true when Prefix and Longer are equal!
Definition at line 233 of file ArgumentPromotion.cpp.
Referenced by MarkIndicesSafe(), and PrefixIn().
| static void MarkIndicesSafe | ( | const ArgPromotion::IndicesVector & | ToMark, | |
| std::set< ArgPromotion::IndicesVector > & | Safe | |||
| ) | [static] |
Mark the given indices (ToMark) as safe in the the given set of indices (Safe). Marking safe usually means adding ToMark to Safe. However, if there is already a prefix of Indices in Safe, Indices are implicitely marked safe already. Furthermore, any indices that Indices is itself a prefix of, are removed from Safe (since they are implicitely safe because of Indices now).
Definition at line 264 of file ArgumentPromotion.cpp.
References End, IsPrefix(), and Low.
| static bool PrefixIn | ( | const ArgPromotion::IndicesVector & | Indices, | |
| std::set< ArgPromotion::IndicesVector > & | Set | |||
| ) | [static] |
Checks if Indices, or a prefix of Indices, is in Set.
Definition at line 245 of file ArgumentPromotion.cpp.
References IsPrefix(), and Low.
| STATISTIC | ( | NumArgumentsDead | , | |
| "Number of dead pointer args eliminated" | ||||
| ) |
| STATISTIC | ( | NumByValArgsPromoted | , | |
| "Number of byval arguments promoted" | ||||
| ) |
| STATISTIC | ( | NumAggregatesPromoted | , | |
| "Number of aggregate arguments promoted" | ||||
| ) |
| STATISTIC | ( | NumArgumentsPromoted | , | |
| "Number of pointer arguments promoted" | ||||
| ) |
char ID [static] |
Definition at line 68 of file ArgumentPromotion.cpp.
The maximum number of elements to expand, or 0 for unlimited.
Definition at line 82 of file ArgumentPromotion.cpp.
RegisterPass<ArgPromotion> X("argpromotion","Promote 'by reference' arguments to scalars") [static] |