https://bugs.llvm.org/show_bug.cgi?id=35846

            Bug ID: 35846
           Summary: [InstCombine] Compare known true or false was not
                    folded
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedb...@nondot.org
          Reporter: llvm-...@redking.me.uk
                CC: craig.top...@gmail.com, david.majne...@gmail.com,
                    dav...@freebsd.org, djas...@google.com,
                    llvm-bugs@lists.llvm.org, spatel+l...@rotateright.com

Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4718

opt -instcombine

define i32 @bar4(i32 %a, i32 %b) {
  %and1 = and i32 %b, 3
  %B1 = ashr i32 %and1, %and1
  %B3 = shl i32 %and1, %B1
  %cmp = icmp eq i32 %B3, 1
  tail call void @llvm.assume(i1 %cmp)
  %cmp2 = icmp eq i32 %B1, %B3
  tail call void @llvm.assume(i1 %cmp2)
  ret i32 %and1
}
declare void @llvm.assume(i1)

Assertion failed: C.ashr(*ShiftAmt).shl(*ShiftAmt) == C && "Compare known true
or false was not folded", file
C:\LLVM\llvm\lib\Transforms\InstCombine\InstCombineCompares.cpp, line 1900

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to