summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/ScalarEvolutionExpander.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-19 13:25:23 +0000
committerDan Gohman <gohman@apple.com>2010-06-19 13:25:23 +0000
commit485c43fc478d5e16c55e14cb2586b56cc1c4c91f (patch)
tree703aa6016187844cb12190e6b3dfe6e7b6353ada /include/llvm/Analysis/ScalarEvolutionExpander.h
parent54eee524f192a0e7395d057481e8d4240729d7b4 (diff)
downloadllvm-485c43fc478d5e16c55e14cb2586b56cc1c4c91f.tar.gz
llvm-485c43fc478d5e16c55e14cb2586b56cc1c4c91f.tar.bz2
llvm-485c43fc478d5e16c55e14cb2586b56cc1c4c91f.tar.xz
Factor out duplicated code for reusing and inserting casts into
a helper function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index 656219d322..9501555aac 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -128,6 +128,14 @@ namespace llvm {
/// of work to avoid inserting an obviously redundant operation.
Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, Value *RHS);
+ /// ReuseOrCreateCast - Arange for there to be a cast of V to Ty at IP,
+ /// reusing an existing cast if a suitable one exists, moving an existing
+ /// cast if a suitable one exists but isn't in the right place, or
+ /// or creating a new one.
+ Value *ReuseOrCreateCast(Value *V, const Type *Ty,
+ Instruction::CastOps Op,
+ BasicBlock::iterator IP);
+
/// InsertNoopCastOfTo - Insert a cast of V to the specified type,
/// which must be possible with a noop cast, doing what we can to
/// share the casts.