[LLVMbugs] [Bug 19852] New: Missed optimisation opportunity in boolean function taking i32 values

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 25 14:46:26 PDT 2014


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

            Bug ID: 19852
           Summary: Missed optimisation opportunity in boolean function
                    taking i32 values
           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 12563
  --> http://llvm.org/bugs/attachment.cgi?id=12563&action=edit
example functionk

The attached function takes two i32 values in the range [0,1] and compares
equality. 

opt -O3 doesn't change the body of the function to an icmp and zext. It instead
creates the following:

define i32 @sameBool_r8(i32, i32) #0 {
entry2:
  %cond = icmp eq i32 %0, 1
  %2 = icmp eq i32 %1, 0
  %3 = icmp eq i32 %1, 1
  %.sink = select i1 %cond, i1 %3, i1 %2
  %4 = zext i1 %.sink to i32
  ret i32 %4
}

-- 
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/ada1df29/attachment.html>


More information about the llvm-bugs mailing list