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

            Bug ID: 27794
           Summary: missing optimization of multiply overflow check
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: reg...@cs.utah.edu
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

This is a portable, UB-free idiom for seeing if a multiply is going to
overflow:

  int f(unsigned a, unsigned b) { return a > (UINT_MAX / b); }

we should turn this into a multiply with condition code and then also CSE it
with the multiply itself which will surely be nearby.

Request for this optimization comes from Rich Felker, author of Musl libc:

  http://wiki.musl-libc.org/wiki/Projects_using_musl

This should be done in CodeGenPrepare, Sanjoy Das says.

-- 
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