[llvm] [FixIrreducible][UnifyLoopExits] Fix callbr multiedge splitting (PR #207598)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 12:07:57 PDT 2026


================
@@ -279,6 +279,7 @@ LLVM_ABI BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To,
 /// \param Succ           original successor block
 /// \param SuccIdx        index of the original successor in the callbr
 ///                       instruction
+/// \param CallBrTarget   optional \p BasicBlock to reuse for the split
----------------
ro-i wrote:

yeah, I think the idea would be that the return value contract stays the same. You just do the caching within SplitCallBrEdge.
Aka, if the cache is empty or there is no match -> create a CallBrTarget, insert it into the cache, and return it. If there already is a match -> return that.
Would that make sense to you?

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


More information about the llvm-commits mailing list