[MachineBasicBlock] Explicit FT branching param
authorAnshil Gandhi <gandhi21299@gmail.com>
Tue, 17 Jan 2023 21:34:27 +0000 (14:34 -0700)
committerAnshil Gandhi <Anshil.Gandhi@amd.com>
Wed, 18 Jan 2023 00:12:08 +0000 (17:12 -0700)
commit5073a622a785e8fd542fd15484970a435ef2e3e5
tree6b23d2ae30c5f79d926054f8d78e231dc8c4e5d8
parentc43f38ec63641a68c36e6f782f14b77543f0a8d8
[MachineBasicBlock] Explicit FT branching param

Introduce a parameter in getFallThrough() to optionally
allow returning the fall through basic block in spite of
an explicit branch instruction to it. This parameter is
set to false by default.

Introduce getLogicalFallThrough() which calls
getFallThrough(false) to obtain the block while avoiding
insertion of a jump instruction to its immediate successor.

This patch also reverts the changes made by D134557 and
solves the case where a jump is inserted after another jump
(branch-relax-no-terminators.mir).

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D140790
llvm/include/llvm/CodeGen/MachineBasicBlock.h
llvm/lib/CodeGen/BranchRelaxation.cpp
llvm/lib/CodeGen/MachineBasicBlock.cpp
llvm/test/CodeGen/AMDGPU/branch-relax-indirect-branch.mir [new file with mode: 0644]