[LLVMbugs] [Bug 4918] New: Optimize mul and equality test to mul-with-overflow

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Sep 7 12:52:00 PDT 2009


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

           Summary: Optimize mul and equality test to mul-with-overflow
           Product: libraries
           Version: trunk
          Platform: PC
               URL: http://codepad.org/ugwQ37sh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rjmccall at apple.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3468)
 --> (http://llvm.org/bugs/attachment.cgi?id=3468)
Pastebin

This is a forwarded complaint by "bearophile" on LLVM IRC, who unfortunately
never files bugs.  

The following should be optimized to a mul-with-overflow:

%L_ext = zext i32 %L to i64
%R_ext = zext i32 %R to i64
%mul64 = mul i64 %L_ext, %R_ext    # no uses except the following:
%trunc = trunc i64 %mul64 to i32
%zext = zext i32 %trunc to i64
%overflow = icmp eq i64 %mul64, %zext

This pattern should create either a smul-with-overflow or a umul-with-overflow
depending on whether a sext or a zext is used.


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