//===-- Local.h - Functions to perform local transformations ----*- C++ -*-===//
-//
+//
// 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.
-//
+//
//===----------------------------------------------------------------------===//
//
// This family of functions perform various local transformations to the
class Pass;
class PHINode;
class AllocaInst;
+class ConstantExpr;
//===----------------------------------------------------------------------===//
// Local constant propagation...
/// with the specified arguments, returning null if unsuccessful.
Constant *ConstantFoldCall(Function *F, const std::vector<Constant*> &Operands);
+/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
+/// getelementptr constantexpr, return the constant value being addressed by the
+/// constant expression, or null if something is funny and we can't decide.
+Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
//===----------------------------------------------------------------------===//
// 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...
//
/// 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);
+AllocaInst *DemoteRegToStack(Instruction &X, bool VolatileLoads = false);
} // End llvm namespace