[PATCH] D102615: [LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 02:21:50 PDT 2021


mkazantsev added a comment.

In D102615#2781346 <https://reviews.llvm.org/D102615#2781346>, @uabelho wrote:

> In D102615#2781330 <https://reviews.llvm.org/D102615#2781330>, @mkazantsev wrote:
>
>> @uabelho Looking into your example, I don't think enough evidence it's a miscompile. Your test has non-side-effecting infinite loop, which has undefined behavior. So it's legal to make the replacement. Can you construct the example without an infinite loop?
>
> Hm, is it really? For input 1, 1, 0 I think it terminates and return the value 20 after executing this path:
>
>   entry -> if.end -> bb2 -> bb4 -> bb12 -> bb2 -> bb4 ->bb13 -> ret
>
> ?

Hm, I'll look closer... Must be something I didn't understand.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102615/new/

https://reviews.llvm.org/D102615



More information about the llvm-commits mailing list