2003-02-22 23:04:52 +00:00
|
|
|
//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
|
2005-04-21 20:59:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 20:59:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-02-22 23:04:52 +00:00
|
|
|
//
|
|
|
|
// This file exposes an interface to promote alloca instructions to SSA
|
|
|
|
// registers, by using the SSA construction algorithm.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
|
|
|
|
#define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
|
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2003-02-22 23:04:52 +00:00
|
|
|
class AllocaInst;
|
2007-06-07 21:57:03 +00:00
|
|
|
class DominatorTree;
|
2006-11-05 19:31:28 +00:00
|
|
|
class DominanceFrontier;
|
2004-09-15 01:02:30 +00:00
|
|
|
class AliasSetTracker;
|
2009-07-05 22:41:43 +00:00
|
|
|
class LLVMContext;
|
2003-02-22 23:04:52 +00:00
|
|
|
|
|
|
|
/// isAllocaPromotable - Return true if this alloca is legal for promotion.
|
|
|
|
/// This is true if there are only loads and stores to the alloca...
|
|
|
|
///
|
2007-04-25 17:15:20 +00:00
|
|
|
bool isAllocaPromotable(const AllocaInst *AI);
|
2003-02-22 23:04:52 +00:00
|
|
|
|
|
|
|
/// PromoteMemToReg - Promote the specified list of alloca instructions into
|
|
|
|
/// scalar registers, inserting PHI nodes as appropriate. This function makes
|
|
|
|
/// use of DominanceFrontier information. This function does not modify the CFG
|
|
|
|
/// of the function at all. All allocas must be from the same function.
|
|
|
|
///
|
2004-09-15 01:02:30 +00:00
|
|
|
/// If AST is specified, the specified tracker is updated to reflect changes
|
|
|
|
/// made to the IR.
|
|
|
|
///
|
2003-02-22 23:04:52 +00:00
|
|
|
void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
|
2007-06-07 21:57:03 +00:00
|
|
|
DominatorTree &DT, DominanceFrontier &DF,
|
2009-07-06 23:00:19 +00:00
|
|
|
LLVMContext *Context,
|
2007-04-25 18:41:11 +00:00
|
|
|
AliasSetTracker *AST = 0);
|
2003-02-22 23:04:52 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-02-22 23:04:52 +00:00
|
|
|
#endif
|