[llvm-commits] [llvm] r69310 - /llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp

Dan Gohman gohman at apple.com
Thu Apr 16 14:34:54 PDT 2009


Author: djg
Date: Thu Apr 16 16:34:54 2009
New Revision: 69310

URL: http://llvm.org/viewvc/llvm-project?rev=69310&view=rev
Log:
Handle a pointer type correctly in SCEVExpander::visitAddRecExpr.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=69310&r1=69309&r2=69310&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Thu Apr 16 16:34:54 2009
@@ -227,6 +227,8 @@
   // If this is a simple linear addrec, emit it now as a special case.
   if (S->isAffine()) {   // {0,+,F} --> i*F
     Value *F = expand(S->getOperand(1));
+    if (isa<PointerType>(F->getType()))
+      F = InsertCastOfTo(Instruction::PtrToInt, F, TD.getIntPtrType());
     
     // IF the step is by one, just return the inserted IV.
     if (ConstantInt *CI = dyn_cast<ConstantInt>(F))





More information about the llvm-commits mailing list