[LLVMbugs] [Bug 8108] New: Missed optimization opportunity with duplicated conditional (JumpThreading?)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 7 15:35:30 PDT 2010


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

           Summary: Missed optimization opportunity with duplicated
                    conditional (JumpThreading?)
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: resistor at mac.com
                CC: llvmbugs at cs.uiuc.edu


See the attached .ll files.  In particular, note this snippet:

lor.rhs.i:
  %cmp9.i = icmp eq i32 %tmp2, 16
  br label %_Z16sparc_floating_pPK4type.exit

_Z16sparc_floating_pPK4type.exit:
  %call19 = phi i1 [ true, %sw.bb.i ], [ %cmp9.i, %lor.rhs.i ], [ true,
%sw.bb.i ]
  %cmp = icmp eq i32 %tmp2, 16
  %or.cond = and i1 %call19, %cmp
  br i1 %or.cond, label %if.end18, label %sw.bb.i24

Notice that the comparison of %tmp2 with 16 is repeated.  If this edge were to
be threaded by JumpThreading, GVN would pick up the duplication and get rid of
it.  However, because we can't actually determine a *value* for the comparison
JumpThreading does not currently choose to thread this edge.

-- 
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