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

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 02:09:27 PDT 2021


uabelho added a comment.

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

?


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