[PATCH] D148139: [BranchRelaxation] Correct JumpToFT value
Anshil Gandhi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 08:59:09 PDT 2023
gandhi21299 created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
gandhi21299 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Toggle true/false values of the JumpToFallThrough
parameter to simplify code and make it consistent
based on the documentation for the getFallThrough(..)
method.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D148139
Files:
llvm/include/llvm/CodeGen/MachineBasicBlock.h
llvm/lib/CodeGen/MachineBasicBlock.cpp
Index: llvm/lib/CodeGen/MachineBasicBlock.cpp
===================================================================
--- llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -975,7 +975,7 @@
// 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 ||
+ if (JumpToFallThrough && (MachineFunction::iterator(TBB) == Fallthrough ||
MachineFunction::iterator(FBB) == Fallthrough))
return &*Fallthrough;
Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
===================================================================
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h
+++ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148139.512862.patch
Type: text/x-patch
Size: 1695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230412/76a548d6/attachment.bin>
More information about the llvm-commits
mailing list