[LLVMbugs] [Bug 3103] New: instcombine doesn't produce urem

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Nov 20 13:26:48 PST 2008


           Summary: instcombine doesn't produce urem
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: nicholas at mxc.ca, llvmbugs at cs.uiuc.edu

This function:

  define i8 @rem2(i8 %x, i8 %y) {
   %A = udiv i8 %x, %y
     %B = mul i8 %A, %y
    %C = sub i8 %B, %x
    ret i8 %C

is actually equivalent to:

  define i8 @rem1(i8 %x, i8 %y) {
    %A = urem i8 %x, %y
    %B = sub i8 0, %A
    ret i8 %B

nobody used to care because the above code is ridiculous, but now SCEV is
producing such crazy equations and we should probably simplify them whenever

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