NimishMishra wrote: Thank you @luporl for pointing this out. I think you are right in stating that a recursive solution would be better in this context. I'll work on this and send out a revision. https://github.com/llvm/llvm-project/pull/72510