X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FTransforms%2FUtils%2FLocal.h;h=25183154272cfdafa82a76b8cf376b4f212c7773;hb=cc0f703f421a5893cf3203c0aa35d597dbdee195;hp=eb219456700f7260678fae52c03b490b8965bef8;hpb=a2631b0225321363368519f1b9b533b2f226faa7;p=oota-llvm.git diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index eb219456700..25183154272 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -1,10 +1,10 @@ //===-- 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 @@ -22,6 +22,7 @@ namespace llvm { class Pass; class PHINode; class AllocaInst; +class ConstantExpr; //===----------------------------------------------------------------------===// // Local constant propagation... @@ -55,6 +56,10 @@ bool canConstantFoldCallTo(Function *F); /// with the specified arguments, returning null if unsuccessful. Constant *ConstantFoldCall(Function *F, const std::vector &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... @@ -73,16 +78,6 @@ bool isInstructionTriviallyDead(Instruction *I); /// 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... // @@ -103,7 +98,7 @@ bool SimplifyCFG(BasicBlock *BB); /// 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