[llvm-commits] [llvm] r50628 - in /llvm/trunk: include/llvm/Analysis/DominatorInternals.h include/llvm/Analysis/Dominators.h test/Analysis/PostDominators/ test/Analysis/PostDominators/dg.exp test/Analysis/PostDominators/pr1098.ll

Dan Gohman gohman at apple.com
Sun May 4 18:17:34 PDT 2008


On Sun, May 4, 2008 2:07 pm, Owen Anderson wrote:
> Author: resistor
> Date: Sun May  4 16:07:35 2008
> New Revision: 50628
>
> URL: http://llvm.org/viewvc/llvm-project?rev=50628&view=rev
> Log:
> Fix PR1098 by correcting the postdominators analysis.
>
> Patch by Florian Brandner.

Cool, thanks for working on this!

> --- llvm/trunk/test/Analysis/PostDominators/pr1098.ll (added)
> +++ llvm/trunk/test/Analysis/PostDominators/pr1098.ll Sun May  4 16:07:35
> 2008
> @@ -0,0 +1,14 @@
> +; RUN: llvm-as < %s | opt -postdomtree -analyze | grep entry
> +; PR932

This seems to be the wrong PR number.

> +
> +define void @foo(i1 %x) {
> +entry:
> +        br i1 %x, label %bb1, label %bb0
> +bb0:            ; preds = %entry, bb0
> +        br label %bb0
> +bb1:            ; preds = %entry
> +        br label %bb2
> +bb2:            ; preds = %bb1
> +        ret void
> +}

This testcase is subtly different from the one in PR1098.
bb0 is an infinite loop instead of being a return block.
Was that intended?

The output for the original testcase appears correct after
this commit. However, the output for this pr1098.ll
testcase is

Inorder PostDominator Tree:
  [1]  <<exit node>> {4294967295,4294967295}
    [2]  %bb2 {4294967295,4294967295}
      [3]  %bb1 {4294967295,4294967295}
    [2]  %entry {4294967295,4294967295}

This seems inconsistent, since %entry is listed as being
post-dominated by the exit node, while %bb0 is not listed
at all.

Dan





More information about the llvm-commits mailing list