[PATCH] IndVarSimplify: Don't let LFTR compare against a poison value

Andrew Trick atrick at apple.com
Wed Sep 3 17:17:03 PDT 2014


> On Sep 3, 2014, at 5:12 PM, David Majnemer <david.majnemer at gmail.com> wrote:
> 
> I think we inferred that the rewritten exit condition was unreachable because of the NUW/NSW behavior of the SCEV.
> 
> Before my patch, we had BBs that looked like this:
>  for.inc13.i:
>    %indvars.iv.next.i = add nuw nsw i32 %indvars.iv.i, 1
>    br i1 true, label %for.cond2.preheader.i, label %fn1.exit.us-lcssa.us <http://fn1.exit.us-lcssa.us/>-lcssa
> 
> After my patch, the same BB looks like this:
>  for.inc13.1:
>    %indvars.iv.next.i = add nuw nsw i32 %indvars.iv.i, 1
>    br i1 %exitcond19.i, label %for.cond2.preheader.i, label %fn1.exit.us-lcssa.us <http://fn1.exit.us-lcssa.us/>-lcssa

Makes sense. Thanks for fixing it.
-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140903/4e123a78/attachment.html>


More information about the llvm-commits mailing list