2003-02-23 00:04:52 +01:00
|
|
|
//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2003-10-20 22:19:47 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2003-10-20 22:19:47 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-02-23 00:04:52 +01: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 23:41:34 +01:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2003-02-23 00:04:52 +01:00
|
|
|
class AllocaInst;
|
2004-10-27 18:14:51 +02:00
|
|
|
struct DominatorTree;
|
|
|
|
struct DominanceFrontier;
|
2003-03-03 18:25:18 +01:00
|
|
|
class TargetData;
|
2004-09-15 03:02:30 +02:00
|
|
|
class AliasSetTracker;
|
2003-02-23 00:04:52 +01:00
|
|
|
|
|
|
|
/// isAllocaPromotable - Return true if this alloca is legal for promotion.
|
|
|
|
/// This is true if there are only loads and stores to the alloca...
|
|
|
|
///
|
2003-03-03 18:25:18 +01:00
|
|
|
bool isAllocaPromotable(const AllocaInst *AI, const TargetData &TD);
|
2003-02-23 00:04:52 +01: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 03:02:30 +02:00
|
|
|
/// If AST is specified, the specified tracker is updated to reflect changes
|
|
|
|
/// made to the IR.
|
|
|
|
///
|
2003-02-23 00:04:52 +01:00
|
|
|
void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
|
2003-10-05 23:20:13 +02:00
|
|
|
DominatorTree &DT, DominanceFrontier &DF,
|
2004-09-15 03:02:30 +02:00
|
|
|
const TargetData &TD, AliasSetTracker *AST = 0);
|
2003-02-23 00:04:52 +01:00
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-02-23 00:04:52 +01:00
|
|
|
#endif
|