[LLVMbugs] [Bug 1683] New: wrong predsimplify simplification

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Sep 19 06:22:49 PDT 2007


http://llvm.org/bugs/show_bug.cgi?id=1683

           Summary: wrong predsimplify simplification
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=1133)
 --> (http://llvm.org/bugs/attachment.cgi?id=1133)
testcase .ll

Running
  opt -predsimplify t.bc
on the following testcase shows the following wrong change:

<       br label %bb99
---
>       unreachable

To see that it is wrong, note that @report__ident_int
returns its argument (it is the identity function).  Thus
  %tmp4 = 6
So %tmp6 = 0 and invcont branches to bb9.
Then %tmp51 = 12, %tmp56 = 0 and bb9 branches to bb9.bb61_crit_edge,
which branches to bb61.  Thus %J4b.0 = 6 and %tmp70 = 0, causing
a branch to bb73, so %tmp75 = 7.  Going around the loop, finally
%J4b.0 = 12 and %tmp70 = 1, causing a branch to bb61.bb76_crit_edge,
so to bb76.

In bb76 we get
  %tmp78 = 0
  %tmp81 = 12
  %tmp8182 = 12
  %tmp8384 = 6
  %tmp85 = 6
  %tmp86 = 0
  %tmp90 = 0
and thus branch to bb76.bb99_crit_edge.

Now bb76.bb99_crit_edge branches to bb99, but predsimplify
replaces this with unreachable, which is wrong since as you
just saw it is perfectly reachable.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list