1 //===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
3 // This file exposes an interface to promote alloca instructions to SSA
4 // registers, by using the SSA construction algorithm.
6 //===----------------------------------------------------------------------===//
8 #ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
9 #define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
13 class DominanceFrontier;
17 /// isAllocaPromotable - Return true if this alloca is legal for promotion.
18 /// This is true if there are only loads and stores to the alloca...
20 bool isAllocaPromotable(const AllocaInst *AI, const TargetData &TD);
22 /// PromoteMemToReg - Promote the specified list of alloca instructions into
23 /// scalar registers, inserting PHI nodes as appropriate. This function makes
24 /// use of DominanceFrontier information. This function does not modify the CFG
25 /// of the function at all. All allocas must be from the same function.
27 void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
28 DominatorTree &DT, DominanceFrontier &DF,
29 const TargetData &TD);