[PATCH] D140790: [MachineBasicBlock] Explicit FT branching param
Anshil Gandhi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 08:32:01 PDT 2023
gandhi21299 added a comment.
In D140790#4257115 <https://reviews.llvm.org/D140790#4257115>, @dhoekwater wrote:
> /// Return the fallthrough block if the block can implicitly
> /// transfer control to the block after it by falling off the end of
> /// 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);
>
> The documentation for this function seems at odds with the behavior.
>
> The documentation suggests that, if `JumpToFallThrough` is false, then `getFallThrough` will return a `nullptr` if the basic block ends with an explicit branch to the fallthrough block.
>
> However, the opposite is true. For a block that ends in an unconditional jump to the fallthrough block, if `JumpToFallThrough == true`, then the function will return `nullptr`. If `JumpToFallThrough == false`, then it will return the address of the fallthrough block.
>
> Is this the intended behavior?
You're right! I will revert this patch and re-merge it with the corrected documentation.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140790/new/
https://reviews.llvm.org/D140790
More information about the llvm-commits
mailing list