[Patch] GVN fold conditional-branch on-the-fly

Shuxin Yang shuxin.llvm at gmail.com
Tue Sep 10 10:17:45 PDT 2013


On 9/10/13 7:56 AM, Nadav Rotem wrote:
> Hi Daniel,
>
> I reviewed the patch again and I realized that I was too optimistic. Yes, tryGetDomFrontier is very context specific and too complicated. I don’t understand why we need 4 of the 5 parameters.


> I think that shuxin should implement a simple generic function for finding Single-Entry-Single-Exit and use it. The code for finding SESE can be used elsewhere.
SESE for C, SEME for C++.
Why SEME? because exception handling.
Among all the exits of SEME, only one is normal exit, the rest is 
goto-landing-pad. That also why need to multiple parameter
in tryGetDomFrontier(), because we need to differentiate the the 
normal-exit and landing-pad show up in DF.

As you can see most of added code is to detect SESE/SEME, few is really 
about GVN.
It is not true to say it significantly complicate the existing code.



> The function eraseSubtree in Dominators.h should be rewritten and simplified.  The code for landing pads should be simplified or at least explained better. The function tryFoldCondBranch should be cleaned up.

> deleteDeadBlocks should be a static utility class, and simplified (DT should be an optional parameter to allow DT cleanup, etc).
Nope. Such dead block are quite special in that maintaining DT is quite 
simply,



More information about the llvm-commits mailing list