[llvm-commits] [llvm] r137712 - in /llvm/trunk/lib: Analysis/ScalarEvolutionExpander.cpp Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Transforms/Instrumentation/GCOVProfiling.cpp

Nick Lewycky nlewycky at google.com
Tue Aug 16 10:51:03 PDT 2011


On 15 August 2011 21:52, Bill Wendling <isanbard at gmail.com> wrote:

> Author: void
> Date: Mon Aug 15 23:52:55 2011
> New Revision: 137712
>
> URL: http://llvm.org/viewvc/llvm-project?rev=137712&view=rev
> Log:
> A few places where we want to skip the landingpad instruction for
> insertion.
>
> Modified:
>    llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
>    llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
>    llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
>
> Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=137712&r1=137711&r2=137712&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
> +++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Mon Aug 15 23:52:55
> 2011
> @@ -1323,8 +1323,11 @@
>       // If the SCEV is computable at this level, insert it into the header
>       // after the PHIs (and after any other instructions that we've
> inserted
>       // there) so that it is guaranteed to dominate any user inside the
> loop.
> -      if (L && SE.hasComputableLoopEvolution(S, L) &&
> !PostIncLoops.count(L))
> +      if (L && SE.hasComputableLoopEvolution(S, L) &&
> !PostIncLoops.count(L)) {
>         InsertPt = L->getHeader()->getFirstNonPHI();
> +        if (isa<LandingPadInst>(InsertPt))
> +          InsertPt = llvm::next(BasicBlock::iterator(InsertPt));
> +      }
>       while (isInsertedInstruction(InsertPt) ||
> isa<DbgInfoIntrinsic>(InsertPt))
>         InsertPt = llvm::next(BasicBlock::iterator(InsertPt));
>       break;
>
> Modified:
> llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=137712&r1=137711&r2=137712&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
> (original)
> +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
> Mon Aug 15 23:52:55 2011
> @@ -601,6 +601,7 @@
>   // Advance to a place where it is safe to insert the new store and
>   // insert it.
>   BBI = DestBB->getFirstNonPHI();
> +  if (isa<LandingPadInst>(BBI)) ++BBI;
>   StoreInst *NewSI = new StoreInst(MergedVal, SI.getOperand(1),
>                                    SI.isVolatile(),
>                                    SI.getAlignment(),
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=137712&r1=137711&r2=137712&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Mon Aug 15
> 23:52:55 2011
> @@ -505,7 +505,9 @@
>       }
>       for (int i = 0, e = ComplexEdgeSuccs.size(); i != e; ++i) {
>         // call runtime to perform increment
> -        IRBuilder<> Builder(ComplexEdgeSuccs[i+1]->getFirstNonPHI());
> +        BasicBlock::iterator InsertPt =
> ComplexEdgeSuccs[i+1]->getFirstNonPHI();
> +        if (isa<LandingPadInst>(InsertPt)) ++InsertPt;
> +        IRBuilder<> Builder(InsertPt);
>

How about a method like getFirstNonPHI() but that skips landingpad called
getFirstInsertPoint? The comment for such a method would be that it returns
the earliest insertpt that does not have an ordering constraint in the IR?

Nick


>         Value *CounterPtrArray =
>             Builder.CreateConstInBoundsGEP2_64(EdgeTable, 0,
>                                                i *
> ComplexEdgePreds.size());
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110816/cd860f19/attachment.html>


More information about the llvm-commits mailing list