Given an LLVM Control-flow graph, how to get or traverse all possible paths between two nodes using LLVM?
As an example, from the graph above, between node %23 and node %30, I want to get these two paths: [[%23, %26, %30], [%23, %30]].
I have researched that LLVM has these two iterators for simple graph traversal:
However, the iterator just traversing in the depth-first and breadth-first manner (both are just walking from %23, %26 and then go directly to %30) and not having a direct feature to enumerate the paths between the node.
I have tried to combine the DFS/BFS with BasicBlock successors/predecessors iterator to enumerate paths from branch block, but I haven't got any intended results after some messy attempts.
I have also checked these two similar questions, unfortunately, there is still no suggestion for the solution there:
I am just wondering if there is already an API in LLVM that can handle this or any hints on which API combination that I can explore to get the intended result.