diff options
| author | Dan Gohman <gohman@apple.com> | 2009-08-20 16:42:55 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-08-20 16:42:55 +0000 |
| commit | 8a8ad7d8e8479337f82dd8970fa9d113b9aa862d (patch) | |
| tree | 48d6b37b45b94dcc75a92b43ece641a07ed91fa1 /llvm/lib/Analysis/ScalarEvolutionExpander.cpp | |
| parent | f91a992c30d9644c43446451c7cb8ec1e28fdd1a (diff) | |
| download | bcm5719-llvm-8a8ad7d8e8479337f82dd8970fa9d113b9aa862d.tar.gz bcm5719-llvm-8a8ad7d8e8479337f82dd8970fa9d113b9aa862d.zip | |
Various comment and whitespace cleanups.
llvm-svn: 79533
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 999fd55c86d..34724709b0f 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -53,10 +53,9 @@ Value *SCEVExpander::InsertNoopCastOfTo(Value *V, const Type *Ty) { return CE->getOperand(0); } - // FIXME: keep track of the cast instruction. if (Constant *C = dyn_cast<Constant>(V)) return ConstantExpr::getCast(Op, C, Ty); - + if (Argument *A = dyn_cast<Argument>(V)) { // Check to see if there is already a cast! for (Value::use_iterator UI = A->use_begin(), E = A->use_end(); @@ -317,13 +316,17 @@ static void SplitAddRecs(SmallVectorImpl<const SCEV *> &Ops, } } -/// expandAddToGEP - Expand a SCEVAddExpr with a pointer type into a GEP -/// instead of using ptrtoint+arithmetic+inttoptr. This helps -/// BasicAliasAnalysis and other passes analyze the result. +/// expandAddToGEP - Expand an addition expression with a pointer type into +/// a GEP instead of using ptrtoint+arithmetic+inttoptr. This helps +/// BasicAliasAnalysis and other passes analyze the result. See the rules +/// for getelementptr vs. inttoptr in +/// http://llvm.org/docs/LangRef.html#pointeraliasing +/// for details. /// -/// Design note: This depends on ScalarEvolution not recognizing inttoptr -/// and ptrtoint operators, as they may introduce pointer arithmetic -/// which may not be safely converted into getelementptr. +/// Design note: The correctness of using getelmeentptr here depends on +/// ScalarEvolution not recognizing inttoptr and ptrtoint operators, as +/// they may introduce pointer arithmetic which may not be safely converted +/// into getelementptr. /// /// Design note: It might seem desirable for this function to be more /// loop-aware. If some of the indices are loop-invariant while others |

