[llvm-commits] Edge dominance in the presence of multiple edges between two BB

Eli Friedman eli.friedman at gmail.com
Fri Aug 10 10:08:52 PDT 2012


On Fri, Aug 10, 2012 at 10:00 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> The point is that we don't need to share the logic with GVN; if we
>> reject this case in the verifier, the existing dominance code is
>> sufficient everywhere else.
>
> Unfortunately it is not. While no other value is created at edges in
> the LLVM IR, some facts are only true when dominated by and edge. For
> example, once we branch on cmp checking that a==42, we can replace a
> with 42 in any use dominated by the edge.
>
> Check my followup patch that makes GVN use these functions for some examples.

Oh, I see.  Could GVN avoid the issue by just merging dataflow facts
if a branch has multiple identical deistinations?

If we have to do this; I'd prefer the original patch; looping over all
the successors of a branch can get expensive in edge cases with swich
and/or indirectbr.

-Eli




More information about the llvm-commits mailing list