[all-commits] [llvm/llvm-project] 3dc6e5: [LoopPeel] Turn incorrect assert into a check

Fedor Sergeev via All-commits all-commits at lists.llvm.org
Thu Mar 12 03:26:15 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3dc6e53c9783cc2fe4e3eebd5fea9e3acd7bf900
      https://github.com/llvm/llvm-project/commit/3dc6e53c9783cc2fe4e3eebd5fea9e3acd7bf900
  Author: Max Kazantsev <max.kazantsev at azul.com>
  Date:   2020-03-12 (Thu, 12 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp
    A llvm/test/Transforms/LoopUnroll/wrong_assert_in_peeling.ll

  Log Message:
  -----------
  [LoopPeel] Turn incorrect assert into a check

Summary:
This patch replaces incorrectt assert with a check. Previously it asserts that
if SCEV cannot prove `isKnownPredicate(A != B)`, then it should be able to prove
`isKnownPredicate(A == B)`.

Both these fact may be not provable. It is shown in the provided test:

Could not prove: `{-294,+,-2}<%bb1> !=  0`
Asserting: `{-294,+,-2}<%bb1> == 0`

Obviously, this SCEV is not equal to zero, but 0 is in its range so we cannot
also prove that it is not zero.

Instead of assert, we should be checking the required conditions explicitly.

Reviewers: lebedev.ri, fhahn, sanjoy, fedor.sergeev
Reviewed By: lebedev.ri
Subscribers: hiraditya, zzheng, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76050




More information about the All-commits mailing list