[llvm-commits] [llvm] r165187 - in /llvm/trunk: lib/Transforms/Scalar/IndVarSimplify.cpp test/Transforms/IndVarSimplify/crash.ll

Chandler Carruth chandlerc at google.com
Wed Oct 3 18:16:11 PDT 2012


On Wed, Oct 3, 2012 at 4:59 PM, Jakub Staszak <kubastaszak at gmail.com> wrote:

> Author: kuba
> Date: Wed Oct  3 18:59:47 2012
> New Revision: 165187
>
> URL: http://llvm.org/viewvc/llvm-project?rev=165187&view=rev
> Log:
> Fix PR13967.
>

Please include a bit more details in the commit log. What was fixed? How?
Why? etc....


>
> Modified:
>     llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
>     llvm/trunk/test/Transforms/IndVarSimplify/crash.ll
>
> Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=165187&r1=165186&r2=165187&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Wed Oct  3
> 18:59:47 2012
> @@ -1262,7 +1262,10 @@
>      return true;
>
>    // Do LFTR if the exit condition's IV is *not* a simple counter.
> -  Value *IncV = Phi->getIncomingValueForBlock(L->getLoopLatch());
> +  int Idx = Phi->getBasicBlockIndex(L->getLoopLatch());
> +  if (Idx < 0)
> +    return true;
> +  Value *IncV = Phi->getIncomingValue(Idx);
>    return Phi != getLoopPhiForCounter(IncV, L, DT);
>  }
>
>
> Modified: llvm/trunk/test/Transforms/IndVarSimplify/crash.ll
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/crash.ll?rev=165187&r1=165186&r2=165187&view=diff
>
> ==============================================================================
> --- llvm/trunk/test/Transforms/IndVarSimplify/crash.ll (original)
> +++ llvm/trunk/test/Transforms/IndVarSimplify/crash.ll Wed Oct  3 18:59:47
> 2012
> @@ -87,3 +87,29 @@
>  main.f.exit:                                      ; preds = %"3.i"
>    unreachable
>  }
> +
> +
> +; PR13967
> +
> +define void @f() nounwind ssp {
> +bb:
> +  br label %bb4
> +
> +bb4:
> +  %tmp = phi i64 [ %tmp5, %bb7 ], [ undef, %bb ]
> +  %tmp5 = add nsw i64 %tmp, 1
> +  %extract.t1 = trunc i64 %tmp5 to i32
> +  br i1 false, label %bb6, label %bb7
> +
> +bb6:
> +  br label %bb7
> +
> +bb7:
> +  %.off0 = phi i32 [ undef, %bb6 ], [ %extract.t1, %bb4 ]
> +  %tmp8 = icmp eq i32 %.off0, 0
> +  br i1 %tmp8, label %bb9, label %bb4
> +
> +bb9:
> +  ret void
> +}
> +
>
>
> _______________________________________________
> 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/20121003/0fb5e1c9/attachment.html>


More information about the llvm-commits mailing list