diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h --- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h @@ -796,12 +796,12 @@ /// it. If an explicit branch to the fallthrough block is not allowed, /// set JumpToFallThrough to be false. Non-null return is a conservative /// answer. - MachineBasicBlock *getFallThrough(bool JumpToFallThrough = false); + MachineBasicBlock *getFallThrough(bool JumpToFallThrough = true); /// Return the fallthrough block if the block can implicitly /// transfer control to it's successor, whether by a branch or /// a fallthrough. Non-null return is a conservative answer. - MachineBasicBlock *getLogicalFallThrough() { return getFallThrough(true); } + MachineBasicBlock *getLogicalFallThrough() { return getFallThrough(false); } /// Return true if the block can implicitly transfer control to the /// block after it by falling off the end of it. This should return diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -975,8 +975,8 @@ // If there is some explicit branch to the fallthrough block, it can obviously // reach, even though the branch should get folded to fall through implicitly. - if (!JumpToFallThrough && (MachineFunction::iterator(TBB) == Fallthrough || - MachineFunction::iterator(FBB) == Fallthrough)) + if (JumpToFallThrough && (MachineFunction::iterator(TBB) == Fallthrough || + MachineFunction::iterator(FBB) == Fallthrough)) return &*Fallthrough; // If it's an unconditional branch to some block not the fall through, it