[all-commits] [llvm/llvm-project] 7af9d3: Correctly modify the CFG in IfConverter, and then ...

James Y Knight via All-commits all-commits at lists.llvm.org
Thu May 7 15:17:51 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7af9d386da2a2447ac044120ff23770ac0cedc3c
      https://github.com/llvm/llvm-project/commit/7af9d386da2a2447ac044120ff23770ac0cedc3c
  Author: James Y Knight <jyknight at google.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineBasicBlock.h
    M llvm/lib/CodeGen/BranchFolding.cpp
    M llvm/lib/CodeGen/IfConversion.cpp
    M llvm/lib/CodeGen/MachineBasicBlock.cpp
    M llvm/test/CodeGen/ARM/ifcvt3.ll
    M llvm/test/CodeGen/Thumb2/thumb2-ifcvt1.ll

  Log Message:
  -----------
  Correctly modify the CFG in IfConverter, and then remove the
CorrectExtraCFGEdges function.

The latter was a workaround for "Various pieces of code" leaving bogus
extra CFG edges in place. Where by "various" it meant only
IfConverter::MergeBlocks, which failed to clear all of the successors
of dead blocks it emptied out. This wouldn't matter a whole lot,
except that the dead blocks remained listed as predecessors of
still-useful blocks, inhibiting optimizations.

This fix slightly changed two thumb tests, because the correct CFG
successors allowed for the "diamond" if-conversion pattern to be
detected, when it could only use "simple" before.

Additionally, the removal of a now-redundant call to analyzeBranch
(with AllowModify=true) in BranchFolder::OptimizeFunction caused a
later check for an empty block in BranchFolder::OptimizeBlock to
fail. Correct this by moving the call to analyzeBranch in
OptimizeBlock higher.

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




More information about the All-commits mailing list