Change the mem2reg interface to accept a TargetData argument
[oota-llvm.git] / include / llvm / Transforms / Utils / PromoteMemToReg.h
1 //===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
2 //
3 // This file exposes an interface to promote alloca instructions to SSA
4 // registers, by using the SSA construction algorithm.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
9 #define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
10
11 class AllocaInst;
12 class DominanceFrontier;
13 class TargetData;
14 #include <vector>
15
16 /// isAllocaPromotable - Return true if this alloca is legal for promotion.
17 /// This is true if there are only loads and stores to the alloca...
18 ///
19 bool isAllocaPromotable(const AllocaInst *AI, const TargetData &TD);
20
21 /// PromoteMemToReg - Promote the specified list of alloca instructions into
22 /// scalar registers, inserting PHI nodes as appropriate.  This function makes
23 /// use of DominanceFrontier information.  This function does not modify the CFG
24 /// of the function at all.  All allocas must be from the same function.
25 ///
26 void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
27                      DominanceFrontier &DF, const TargetData &TD);
28
29 #endif