X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FAnalysis%2FInstructionSimplify.h;h=d760a4cba1cfbafa8bed4a3fc89f43d77556ff82;hb=326ae27c4f744cc7fb43f5a413d042d54fc1ddc0;hp=dd643a0469387c603da5d93783071dd2d9355017;hpb=c98bd9f1a79adffe73acd337b6f7f9afa6bae078;p=oota-llvm.git diff --git a/include/llvm/Analysis/InstructionSimplify.h b/include/llvm/Analysis/InstructionSimplify.h index dd643a04693..d760a4cba1c 100644 --- a/include/llvm/Analysis/InstructionSimplify.h +++ b/include/llvm/Analysis/InstructionSimplify.h @@ -14,12 +14,25 @@ // ("and i32 %x, %x" -> "%x"). If the simplification is also an instruction // then it dominates the original instruction. // +// These routines implicitly resolve undef uses. The easiest way to be safe when +// using these routines to obtain simplified values for existing instructions is +// to always replace all uses of the instructions with the resulting simplified +// values. This will prevent other code from seeing the same undef uses and +// resolving them to different values. +// +// These routines are designed to tolerate moderately incomplete IR, such as +// instructions that are not connected to basic blocks yet. However, they do +// require that all the IR that they encounter be valid. In particular, they +// require that all non-constant values be defined in the same function, and the +// same call context of that function (and not split between caller and callee +// contexts of a directly recursive call, for example). +// //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H #define LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H -#include "llvm/User.h" +#include "llvm/IR/User.h" namespace llvm { template @@ -211,7 +224,7 @@ namespace llvm { /// the result. /// /// If this call could not be simplified returns null. - Value *SimplifyCall(Value *F, User::op_iterator ArgBegin, + Value *SimplifyCall(Value *V, User::op_iterator ArgBegin, User::op_iterator ArgEnd, const DataLayout *TD = 0, const TargetLibraryInfo *TLI = 0, const DominatorTree *DT = 0); @@ -220,7 +233,7 @@ namespace llvm { /// result. /// /// If this call could not be simplified returns null. - Value *SimplifyCall(Value *F, ArrayRef Args, + Value *SimplifyCall(Value *V, ArrayRef Args, const DataLayout *TD = 0, const TargetLibraryInfo *TLI = 0, const DominatorTree *DT = 0);