1 //===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // 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 LLVM_TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
16 #define LLVM_TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
24 class AliasSetTracker;
26 /// isAllocaPromotable - Return true if this alloca is legal for promotion.
27 /// This is true if there are only loads and stores to the alloca...
29 bool isAllocaPromotable(const AllocaInst *AI);
31 /// PromoteMemToReg - Promote the specified list of alloca instructions into
32 /// scalar registers, inserting PHI nodes as appropriate. This function makes
33 /// use of DominanceFrontier information. This function does not modify the CFG
34 /// of the function at all. All allocas must be from the same function.
36 /// If AST is specified, the specified tracker is updated to reflect changes
39 void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
40 DominatorTree &DT, AliasSetTracker *AST = 0);
42 } // End llvm namespace