Added LLVM copyright header (for lack of a better term).
[oota-llvm.git] / include / llvm / Transforms / Utils / PromoteMemToReg.h
1 //===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file exposes an interface to promote alloca instructions to SSA
11 // registers, by using the SSA construction algorithm.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
16 #define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
17
18 class AllocaInst;
19 class DominatorTree;
20 class DominanceFrontier;
21 class TargetData;
22 #include <vector>
23
24 /// isAllocaPromotable - Return true if this alloca is legal for promotion.
25 /// This is true if there are only loads and stores to the alloca...
26 ///
27 bool isAllocaPromotable(const AllocaInst *AI, const TargetData &TD);
28
29 /// PromoteMemToReg - Promote the specified list of alloca instructions into
30 /// scalar registers, inserting PHI nodes as appropriate.  This function makes
31 /// use of DominanceFrontier information.  This function does not modify the CFG
32 /// of the function at all.  All allocas must be from the same function.
33 ///
34 void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
35                      DominatorTree &DT, DominanceFrontier &DF,
36                      const TargetData &TD);
37
38 #endif