[llvm-dev] RFC: first steps toward CFG-level IR manipulation

Brian M. Rzycki via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 27 08:44:05 PDT 2017


Hello everyone,

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:

<goog_558917248>
https://reviews.llvm.org/D37575

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.

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.

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.

Thank you,
-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170927/fb56c6dc/attachment.html>


More information about the llvm-dev mailing list