SuccessChanges

Summary

  1. MachineBasicBlock::updateTerminator now requires an explicit layout successor. (details)
  2. Simplify MachineVerifier's block-successor verification. (details)
  3. [gcov] Delete unneeded code (details)
Commit 1978309db1f9f7530269950d87b18d4c3abe1d05 by jyknight
MachineBasicBlock::updateTerminator now requires an explicit layout successor.

Previously, it tried to infer the correct destination block from the
successor list, but this is a rather tricky propspect, given the
existence of successors that occur mid-block, such as invoke, and
potentially in the future, callbr/INLINEASM_BR. (INLINEASM_BR, in
particular would be problematic, because its successor blocks are not
distinct from "normal" successors, as EHPads are.)

Instead, require the caller to pass in the expected fallthrough
successor explicitly. In most callers, the correct block is
immediately clear. But, in MachineBlockPlacement, we do need to record
the original ordering, before starting to reorder blocks.

Unfortunately, the goal of decoupling the behavior of end-of-block
jumps from the successor list has not been fully accomplished in this
patch, as there is currently no other way to determine whether a block
is intended to fall-through, or end as unreachable. Further work is
needed there.

Differential Revision: https://reviews.llvm.org/D79605
The file was modifiedllvm/lib/CodeGen/BBSectionsPrepare.cpp
The file was modifiedllvm/lib/CodeGen/TailDuplicator.cpp
The file was modifiedllvm/lib/Target/ARM/ARMConstantIslandPass.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp
The file was modifiedllvm/lib/CodeGen/MachineBlockPlacement.cpp
The file was modifiedllvm/lib/CodeGen/MachineBasicBlock.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
The file was modifiedllvm/lib/CodeGen/BranchRelaxation.cpp
The file was modifiedllvm/include/llvm/CodeGen/MachineBasicBlock.h
Commit 748d92b4d3142ad57266211351d3377ed976f3dc by jyknight
Simplify MachineVerifier's block-successor verification.

There's two properties we want to verify:

1. That the successors returned by analyzeBranch are in the CFG
   successor list, and
2. That there are no extraneous successors are in the CFG successor
   list.

The previous implementation mostly accomplished this, but in a very
convoluted manner.

Differential Revision: https://reviews.llvm.org/D79793
The file was modifiedllvm/test/CodeGen/Hexagon/cext-opt-range-offset.mir
The file was modifiedllvm/test/MachineVerifier/verifier-pseudo-terminators.mir
The file was modifiedllvm/lib/CodeGen/MachineVerifier.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/eh-labels.mir
Commit 693ff89f47ffe1f357ddd3a5112cd90eb8b3e2d1 by maskray
[gcov] Delete unneeded code
The file was modifiedllvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp