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

Hal Finkel hfinkel at anl.gov
Sat Sep 7 12:48:46 PDT 2013


----- Original Message -----
> 
> 
> 
> 
> On Sat, Sep 7, 2013 at 11:48 AM, Hal Finkel < hfinkel at anl.gov >
> wrote:
> 
> 
> I think that we should evaluate this change just like any other:
> using a cost-benefit analysis of performance vs. compile-time impact
> averaged over the test suite (and any other code bases we care
> about). As a practical matter, we should not hold all GVN-related
> improvements hostage to competition of a GVN rewrite on which no one
> is actively working.
> I don't think Danny was suggesting this.
> 
> 
> There is a difference between holding all improvements hostage, and
> arguing against growing the complexity of a pass which is in serious
> need of refactoring/updating until that occurs. Especially when the
> reworking proposed is likely to achieve the same concrete goal is
> the added complexity.
> 
> 
> I do think that GVN has likely reached the point where adding new
> layers of complexity to it significantly grow both the cost of
> maintenance of GVN and the cost of doing a deep reworking of it.
> I've watched folks try to do deep improvements to our GVN
> infrastructure, and they have to spend more time trying to replicate
> all of the current tweaks, hacks, and complexity in it than they do
> improving the fundamentals of the pass.

I think that this is not quite the right way to think about it, especially in the context of a nearly-complete rewrite. First, we need to answer the question: Is this fundamentally something that we need GVN to do? If it is, then it should be evaluated as I said. If not, then we need to figure out where (if anywhere) is a better place.

Ideally, we should really start to review Danny's GVN rewrite (even though it may, as he says, need a rewrite itself), so that we can at least all get on the same page regarding what the new version does, how it does it, and what functional improvements will be necessary prior to the start of more-extensive testing.

Maintenance of the current GVN is obviously a concern, but if we block improvements to GVN now because GVN needs to be redone, we loose the ability of the current GVN to serve as the best possible reference implementation to which we should compare the new GVN. The lost productivity from failing to do that (failing to capture the work put into isolating performance problems, mitigating them, and building up the corresponding test cases, and then building on those improvements) is likely to be greater than the extra maintenance burden (IMHO).

In any case, if the new version essentially does everything that the current version does, then we should get it into trunk. Future improvements can be made to both versions in parallel (and, importantly, new test cases can be added to both versions in parallel), and we can improve the new version until it can replace the old.

 -Hal

> 
> 
> That doesn't mean we can't possibly improve it as is, but I think
> there should be a *really* significant need in the immediate future,
> and some plan or path toward a principled and more maintainable
> solution. It essentially places a very large scaling factor on the
> cost side of the cost-benefit analysis because we need to prioritize
> the long-term needs of the project.

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list