#define LLVM_TRANSFORMS_UTILS_LOCAL_H
#include "llvm/Function.h"
+
+namespace llvm {
+
class Pass;
+class PHINode;
+class AllocaInst;
//===----------------------------------------------------------------------===//
// Local constant propagation...
///
bool ConstantFoldTerminator(BasicBlock *BB);
+/// ConstantFoldInstruction - Attempt to constant fold the specified
+/// instruction. If successful, the constant result is returned, if not, null
+/// is returned. Note that this function can only fail when attempting to fold
+/// instructions like loads and stores, which have no constant expression form.
+///
+Constant *ConstantFoldInstruction(Instruction *I);
+
//===----------------------------------------------------------------------===//
// Local dead code elimination...
///
bool dceInstruction(BasicBlock::iterator &BBI);
+//===----------------------------------------------------------------------===//
+// PHI Instruction Simplification
+//
+
+/// hasConstantValue - If the specified PHI node always merges together the same
+/// value, return the value, otherwise return null.
+///
+Value *hasConstantValue(PHINode *PN);
+
//===----------------------------------------------------------------------===//
// Control Flow Graph Restructuring...
///
bool SimplifyCFG(BasicBlock *BB);
+/// DemoteRegToStack - This function takes a virtual register computed by an
+/// Instruction& X and replaces it with a slot in the stack frame, allocated via
+/// alloca. This allows the CFG to be changed around without fear of
+/// invalidating the SSA information for the value. It returns the pointer to
+/// the alloca inserted to create a stack slot for X.
+///
+AllocaInst *DemoteRegToStack(Instruction &X);
+
+} // End llvm namespace
+
#endif