[all-commits] [llvm/llvm-project] 0e74d7: [StructurizeCFG] Fix boolean not bug

Jay Foad via All-commits all-commits at lists.llvm.org
Tue Feb 22 09:38:32 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e74d75a295729bc145724ffa0495fee4d1b598c
      https://github.com/llvm/llvm-project/commit/0e74d75a295729bc145724ffa0495fee4d1b598c
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2022-02-22 (Tue, 22 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
    M llvm/test/Transforms/StructurizeCFG/invert-condition.ll

  Log Message:
  -----------
  [StructurizeCFG] Fix boolean not bug

D118623 added code to fold not-of-compare into a compare
with the inverted predicate, if the compare had no other
uses. This relies on accurate use lists in the IR but it
was run before setPhiValues, when some phi inputs are still
stored in a data structure on the side, instead of being
real uses in the IR. The effect was that a phi that should
be using the original compare result would now get an
inverted result instead.

Fix this by moving simplifyConditions after setPhiValues.

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




More information about the All-commits mailing list