[llvm-dev] [RFC] Interprocedural MIR-level outlining pass
Daniel Berlin via llvm-dev
llvm-dev at lists.llvm.org
Tue Aug 30 09:28:13 PDT 2016
On Tue, Aug 30, 2016 at 3:28 AM, Andrey Bokhanko <andreybokhanko at gmail.com>
wrote:
> Daniel,
>
> OK, I see your point.
>
> My understanding was that VNDAG is an internal representation, not meant
> to be used by VN's customers (that should really care for classes of
> congruency, nothing more).
>
Depends on the customers?
You provide what your customers want, not decide what they want :)
> Also, I thought that VN's results are available for a single function at a
> time. It seems that NewGVN provides access to VNDAGs computed for the whole
> program -- which enables its usage in Jessica's pass.
>
It does not currently, this would be trivial to do, however.
You are going very very far into the implementation details which very much
do not matter from an algorithm design perspective.
>
> Still, some issues remain. I wonder what leaf nodes for reads of "a" and
> "b" values contain? If they have VN numbers (as the "Efficient SSA" paper
> says) and VNDAG comparator compares them (for leafs), then the best one can
> do is this:
>
> int outlined(int arg1, int arg2)
> {
> return arg1 + arg2;
> }
>
> int foo() {
> arg1 = a;
> arg2 = b;
> return outlined(arg1, arg2);
> }
>
> int bar() {
> arg1 = a;
> arg2 = b;
> return outlined(arg1, arg2);
> }
>
> that hardly helps.
>
>
See above. Again, you are going really far into implementation details for
no reason i can see. We can do pretty much whatever we want.
Remember also, you outlined a single statement function, that is the best
you can do in pretty much any legal case.
> If, on the other hand, VNDAG's comparator compares variable names and
> doesn't pick classes of congruency at all, how this relates to Value
> Numbering? SSA can be used for this purpose just as well.
>
> I tend to agree with Hal -- value numbering computes equivalent *values*,
>
Sorry, but this is just flat out wrong
"A Global Value Numbering(GVN) algorithm is considered to be complete (or
precise), if it can detect all Herbrand equivalences among expressions in a
program.
Two expressions are said to be Herbrand equivalent (or transparent
equivalent ), if they are computed by the same operator applied to
equivalent operands "
This is, AFAIK, precisely what you want.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160830/f8c6aaa8/attachment.html>
More information about the llvm-dev
mailing list