diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-21 01:07:12 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-21 01:07:12 +0000 |
commit | af79fb5f47b0088c6a8973a7fdbaea96973a429d (patch) | |
tree | be262820979564b6c6e19bf3ad4c50dc4a895b16 /include/llvm/Analysis/ScalarEvolutionExpander.h | |
parent | fb17fd2cdf35f8ad0b9e0e7e1b06a186fce442f8 (diff) | |
download | llvm-af79fb5f47b0088c6a8973a7fdbaea96973a429d.tar.gz llvm-af79fb5f47b0088c6a8973a7fdbaea96973a429d.tar.bz2 llvm-af79fb5f47b0088c6a8973a7fdbaea96973a429d.tar.xz |
Introduce encapsulation for ScalarEvolution's TargetData object, and refactor
the code to minimize dependencies on TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpander.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index b5072da4ad..16db5f39c4 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/include/llvm/Analysis/ScalarEvolutionExpander.h @@ -20,8 +20,6 @@ #include "llvm/Analysis/ScalarEvolutionExpressions.h" namespace llvm { - class TargetData; - /// SCEVExpander - This class uses information about analyze scalars to /// rewrite expressions in canonical form. /// @@ -31,7 +29,6 @@ namespace llvm { struct SCEVExpander : public SCEVVisitor<SCEVExpander, Value*> { ScalarEvolution &SE; LoopInfo &LI; - const TargetData &TD; std::map<SCEVHandle, Value*> InsertedExpressions; std::set<Instruction*> InsertedInstructions; @@ -39,8 +36,8 @@ namespace llvm { friend struct SCEVVisitor<SCEVExpander, Value*>; public: - SCEVExpander(ScalarEvolution &se, LoopInfo &li, const TargetData &td) - : SE(se), LI(li), TD(td) {} + SCEVExpander(ScalarEvolution &se, LoopInfo &li) + : SE(se), LI(li) {} LoopInfo &getLoopInfo() const { return LI; } @@ -85,6 +82,11 @@ namespace llvm { /// we can to share the casts. Value *InsertCastOfTo(Instruction::CastOps opcode, Value *V, const Type *Ty); + + /// InsertNoopCastOfTo - Insert a cast of V to the specified type, + /// which must be possible with a noop cast. + Value *InsertNoopCastOfTo(Value *V, const Type *Ty); + /// InsertBinop - Insert the specified binary operator, doing a small amount /// of work to avoid inserting an obviously redundant operation. static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, |