[all-commits] [llvm/llvm-project] fda324: [LoopIdiom] BCmp: check, not assert that loop exit...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Thu Oct 17 04:00:23 PDT 2019

  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fda3243fdd9880441af11dd39a3120b3874fd42c
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2019-10-17 (Thu, 17 Oct 2019)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
    M llvm/test/Transforms/LoopIdiom/bcmp-negative-tests.ll

  Log Message:
  [LoopIdiom] BCmp: check, not assert that loop exits exit out of the loop (PR43687)

We can't normally stumble into that assertion because a tautological
*conditional* `br` in loop body is required, one that always
branches to loop latch. But that should have been always folded
to an unconditional branch before we get it.
But that is not guaranteed if the pass is run standalone.
So let's just promote the assertion into a proper check.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43687

llvm-svn: 375100

More information about the All-commits mailing list