<div dir="ltr"><div>Hello everyone,</div><div><br></div><div>I've been having discussions with Jakub Kuderski about the merits of having routines to think more about the shape of the CFG instead of dealing with the details of the IR. I have one such patch posted and would like to know what the larger community thinks of the idea.  The patch is here:</div><div><a href="goog_558917248"><br></a></div><div><a href="https://reviews.llvm.org/D37575">https://reviews.llvm.org/D37575<br></a></div><div><br></div><div>This patch adds a routine deleteEdge() to the BasicBlock class with the intent of always removing the edge between two blocks (From, To). Under the covers the routine changes the terminator instruction in From. It does not touch PHIs or uses. I chose this approach as a first-step towards a larger way of thinking less about the IR and more about CFG-level manipulations.</div><div><br></div><div>The intent of such a patch is to give users, mostly in the middle end, the ability to think about CFG-level changes instead of focusing on the details of producing correct IR. The goal is to also reduce code complexity in passes to reduce bugs and simplify coverage testing.</div><div><br></div><div>This is a non-trivial undertaking and is probably best approached in stages. I think LLVM would benefit in the long-run from such a move and I'd appreciate feedback and suggestions from those in the community with more experience working on LLVM.</div><div><br></div><div>Thank you,</div><div>-Brian</div></div>