[llvm] [SimplifyCFG] Removed the conditional branch (PR #146445)

David Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 07:12:28 PDT 2025


davidzhengyes wrote:

Thanks for the reply!

I don't know if JumpThreading handles this, but I think it is a good idea to remove this conditional branch if we know it is not truly conditional, so that we do not need SimplifyCFG to rely on JumpThreading to run after and clean this up; reducing dependency between passes. I view this as an extension of current functionality, if we are already threading control in this pass, we might as well simplify the CFG even more by removing the branch especially if we know the value coming from the predecessor. We only need a little check to see if the value was also defined in that predecessor, which seems like a common case.

https://github.com/llvm/llvm-project/pull/146445


More information about the llvm-commits mailing list