1 //===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file exposes an interface to promote alloca instructions to SSA
11 // registers, by using the SSA construction algorithm.
13 //===----------------------------------------------------------------------===//
15 #ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
16 #define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
24 class DominanceFrontier;
25 class AliasSetTracker;
27 /// isAllocaPromotable - Return true if this alloca is legal for promotion.
28 /// This is true if there are only loads and stores to the alloca...
30 bool isAllocaPromotable(const AllocaInst *AI);
32 /// PromoteMemToReg - Promote the specified list of alloca instructions into
33 /// scalar registers, inserting PHI nodes as appropriate. This function makes
34 /// use of DominanceFrontier information. This function does not modify the CFG
35 /// of the function at all. All allocas must be from the same function.
37 /// If AST is specified, the specified tracker is updated to reflect changes
40 void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
41 DominatorTree &DT, DominanceFrontier &DF,
42 AliasSetTracker *AST = 0);
44 } // End llvm namespace