[llvm-commits] [llvm] r99001 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolutionExpander.h lib/Analysis/ScalarEvolutionExpander.cpp

Jeffrey Yasskin jyasskin at google.com
Fri Mar 19 22:46:12 PDT 2010


Rolling this back fixes the 2 valgrind errors at
http://google1.osuosl.org:8011/builders/llvm-i686-linux-vg/builds/118/steps/test-llvm/logs/stdio.
Could you take a look?

On Fri, Mar 19, 2010 at 2:51 PM, Dan Gohman <gohman at apple.com> wrote:
> Author: djg
> Date: Fri Mar 19 16:51:03 2010
> New Revision: 99001
>
> URL: http://llvm.org/viewvc/llvm-project?rev=99001&view=rev
> Log:
> Fix more places to more thoroughly ignore debug intrinsics. This fixes
> use-before-def errors in SCEVExpander-produced code in sqlite3 when debug
> info with optimization is enabled, though the testcases for this are
> dependent on use-list order.
>
> Modified:
>    llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
>    llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
>
> Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h?rev=99001&r1=99000&r2=99001&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h (original)
> +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h Fri Mar 19 16:51:03 2010
> @@ -79,12 +79,7 @@
>     /// expandCodeFor - Insert code to directly compute the specified SCEV
>     /// expression into the program.  The inserted code is inserted into the
>     /// specified block.
> -    Value *expandCodeFor(const SCEV *SH, const Type *Ty, Instruction *I) {
> -      BasicBlock::iterator IP = I;
> -      while (isInsertedInstruction(IP)) ++IP;
> -      Builder.SetInsertPoint(IP->getParent(), IP);
> -      return expandCodeFor(SH, Ty);
> -    }
> +    Value *expandCodeFor(const SCEV *SH, const Type *Ty, Instruction *I);
>
>     /// setIVIncInsertPos - Set the current IV increment loop and position.
>     void setIVIncInsertPos(const Loop *L, Instruction *Pos) {
>
> Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=99001&r1=99000&r2=99001&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
> +++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Fri Mar 19 16:51:03 2010
> @@ -1240,6 +1240,15 @@
>   return LHS;
>  }
>
> +Value *SCEVExpander::expandCodeFor(const SCEV *SH, const Type *Ty,
> +                                   Instruction *I) {
> +  BasicBlock::iterator IP = I;
> +  while (isInsertedInstruction(IP) || isa<DbgInfoIntrinsic>(IP))
> +    ++IP;
> +  Builder.SetInsertPoint(IP->getParent(), IP);
> +  return expandCodeFor(SH, Ty);
> +}
> +
>  Value *SCEVExpander::expandCodeFor(const SCEV *SH, const Type *Ty) {
>   // Expand the code for this SCEV.
>   Value *V = expand(SH);
> @@ -1278,9 +1287,7 @@
>       // there) so that it is guaranteed to dominate any user inside the loop.
>       if (L && S->hasComputableLoopEvolution(L) && L != PostIncLoop)
>         InsertPt = L->getHeader()->getFirstNonPHI();
> -      while (isa<DbgInfoIntrinsic>(InsertPt))
> -        InsertPt = llvm::next(BasicBlock::iterator(InsertPt));
> -      while (isInsertedInstruction(InsertPt))
> +      while (isInsertedInstruction(InsertPt) || isa<DbgInfoIntrinsic>(InsertPt))
>         InsertPt = llvm::next(BasicBlock::iterator(InsertPt));
>       break;
>     }
> @@ -1316,7 +1323,8 @@
>   // subsequently inserted code will be dominated.
>   if (Builder.GetInsertPoint() == I) {
>     BasicBlock::iterator It = cast<Instruction>(I);
> -    do { ++It; } while (isInsertedInstruction(It));
> +    do { ++It; } while (isInsertedInstruction(It) ||
> +                        isa<DbgInfoIntrinsic>(It));
>     Builder.SetInsertPoint(Builder.GetInsertBlock(), It);
>   }
>  }
> @@ -1324,7 +1332,7 @@
>  void SCEVExpander::restoreInsertPoint(BasicBlock *BB, BasicBlock::iterator I) {
>   // If we acquired more instructions since the old insert point was saved,
>   // advance past them.
> -  while (isInsertedInstruction(I)) ++I;
> +  while (isInsertedInstruction(I) || isa<DbgInfoIntrinsic>(I)) ++I;
>
>   Builder.SetInsertPoint(BB, I);
>  }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list