Skip to content

Commit 6530bd3

Browse files
committed
[BranchRelaxation] Correct JumpToFT value
Toggle true/false values of the JumpToFallThrough parameter to simplify code and make it consistent with the documentation for the `getFallThrough(..)` method. Reviewed By: bcahoon Differential Revision: https://reviews.llvm.org/D148139
1 parent d093d34 commit 6530bd3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/include/llvm/CodeGen/MachineBasicBlock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,12 @@ class MachineBasicBlock
796796
/// it. If an explicit branch to the fallthrough block is not allowed,
797797
/// set JumpToFallThrough to be false. Non-null return is a conservative
798798
/// answer.
799-
MachineBasicBlock *getFallThrough(bool JumpToFallThrough = false);
799+
MachineBasicBlock *getFallThrough(bool JumpToFallThrough = true);
800800

801801
/// Return the fallthrough block if the block can implicitly
802802
/// transfer control to it's successor, whether by a branch or
803803
/// a fallthrough. Non-null return is a conservative answer.
804-
MachineBasicBlock *getLogicalFallThrough() { return getFallThrough(true); }
804+
MachineBasicBlock *getLogicalFallThrough() { return getFallThrough(false); }
805805

806806
/// Return true if the block can implicitly transfer control to the
807807
/// block after it by falling off the end of it. This should return

llvm/lib/CodeGen/MachineBasicBlock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,8 @@ MachineBasicBlock *MachineBasicBlock::getFallThrough(bool JumpToFallThrough) {
975975

976976
// If there is some explicit branch to the fallthrough block, it can obviously
977977
// reach, even though the branch should get folded to fall through implicitly.
978-
if (!JumpToFallThrough && (MachineFunction::iterator(TBB) == Fallthrough ||
979-
MachineFunction::iterator(FBB) == Fallthrough))
978+
if (JumpToFallThrough && (MachineFunction::iterator(TBB) == Fallthrough ||
979+
MachineFunction::iterator(FBB) == Fallthrough))
980980
return &*Fallthrough;
981981

982982
// If it's an unconditional branch to some block not the fall through, it

0 commit comments

Comments
 (0)