[LLVMbugs] [Bug 19853] New: Missed optimisation opportunity in collapsing simple switch BBs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 25 14:54:03 PDT 2014


            Bug ID: 19853
           Summary: Missed optimisation opportunity in collapsing simple
                    switch BBs
           Product: tools
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: opt
          Assignee: unassignedbugs at nondot.org
          Reporter: expipiplus1 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12564
  --> http://llvm.org/bugs/attachment.cgi?id=12564&action=edit
Function comparing two i32s in a limited range.

The attached function takes two i32 values (%0 and %1) in the range [0,6] and
compares equality by switching on the value of %0. In the switched to basic
block %1 is compared to a constant which is equal to %0. 

The branches to a phi and ret block could be replaced with ret instructions.

The blocks are also identical when replacing the constant with the value of %0,
and could be merged.

The function could be reduced to an icmp and a zext, instead it retains the
switch to a specialised block structure.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140525/634cb513/attachment.html>

More information about the llvm-bugs mailing list