[LLVMbugs] [Bug 20814] New: InstCombine transform missing associativity of boolean and operator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 29 16:45:41 PDT 2014


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

            Bug ID: 20814
           Summary: InstCombine transform missing associativity of boolean
                    and operator
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: listmail at philipreames.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12964
  --> http://llvm.org/bugs/attachment.cgi?id=12964&action=edit
Failing test case for InstCombine

InstCombine appears to be missing a transform based on the fact that it doesn't
recognize boolean and is associative.  Without the extra 'b' variable, this
example nicely gets folded into a single equality check, but this optimization
is inhibited in this case.

define i1 @test1(i32 %i, i1 %b) {
; CHECK: icmp eq i32 %i, 0
; CHECK-NOT: slt
; todo: check and, return
entry:
  %0 = icmp slt i32 %i, 1
  %1 = icmp sgt i32 %i, -1
  %and1 = and i1 %0, %b
  %and2 = and i1 %and1, %1
  ret i1 %and2
}

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


More information about the llvm-bugs mailing list