[all-commits] [llvm/llvm-project] 628f63: [SimplifyCFG] If FoldTwoEntryPHINode() changed thi...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Thu Aug 12 10:03:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 628f63d3d5ab71ab68e496443d261d91549c5ca6
      https://github.com/llvm/llvm-project/commit/628f63d3d5ab71ab68e496443d261d91549c5ca6
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-08-12 (Thu, 12 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/SimplifyCFG/merge-cond-stores-2.ll

  Log Message:
  -----------
  [SimplifyCFG] If FoldTwoEntryPHINode() changed things, restart

Mainly, i want to add an assertion that `SimplifyCFGOpt::simplifyCondBranch()`
doesn't get asked to deal with non-unconditional branches,
and if i do that, then said assertion fires on existing tests,
and this is what prevents it from firing.


  Commit: f30a7dff8a5b32919951dcbf92e4a9d56c4679ff
      https://github.com/llvm/llvm-project/commit/f30a7dff8a5b32919951dcbf92e4a9d56c4679ff
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-08-12 (Thu, 12 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp

  Log Message:
  -----------
  [NFCI][SimplifyCFG] simplifyCondBranch(): assert that branch is non-tautological

We really shouldn't deal with a conditional branch that can be trivially
constant-folded into an unconditional branch.

Indeed, barring failure to trigger BB reprocessing, that should be true,
so let's assert as much, and hope the assertion never fires.
If it does, we have a bug to fix.


Compare: https://github.com/llvm/llvm-project/compare/45938114b247...f30a7dff8a5b


More information about the All-commits mailing list