[PATCH] D148139: [BranchRelaxation] Correct JumpToFT value
Anshil Gandhi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 09:59:39 PDT 2023
gandhi21299 updated this revision to Diff 512884.
gandhi21299 added a comment.
- Applied clang-format
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148139/new/
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,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
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.512884.patch
Type: text/x-patch
Size: 1849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230412/61097858/attachment.bin>
More information about the llvm-commits
mailing list