[llvm-dev] Dataflow analysis regression in 3.7
Davide Italiano via llvm-dev
llvm-dev at lists.llvm.org
Sun Jul 9 13:53:29 PDT 2017
On Jul 9, 2017 10:24 AM, "Daniel Berlin" <dberlin at dberlin.org> wrote:
>> Matt Simpson and I briefly discussed this transformation. One of his
> suggestions was to add a pass in the pipeline where the dominator tree was
> available (note my patch used a poor man's version of domination) and to
> add range meta-data to values (or replace values if we know the exact
> value) based on dominating conditions.
This is a pretty trivial variant of what the predicateinfo utility does :)
(it just happens to process branches, assumes, etc. But you could trivially
modify it to change the name anywhere the range is different, to ensure the
invariant that anything with the same ssa name has the same range)
I thought it was pretty interesting idea, but I'm not very familiar with
> how range metadata is generated and used.
GCC pretty much does what i said above:
It generates assert_expr's, which rename values, where the ranges change
(this is equivalent to what predicateinfo does), then solves a lattice over
the resulting IR.
We have a related bug open, you opened, it seems :)
>From what I can tell the difference is that gcc solves the problem eagerly
(and not lazily). Actually, they catch this case as part of VRP, which is
run not very early in the pipeline but still the cfg is in a shape decent
enough to get this case right (maybe we could consider reordering passes,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev