[PATCH] [Instcombine] Recognize test for overflow in integer multiplication.

Serge Pavlov sepavloff at gmail.com
Sun Feb 16 04:20:20 PST 2014


sepavloff added you to the CC list for the revision "[Instcombine] Recognize test for overflow in integer multiplication.".

If multiplication involves zero-extended arguments and the result is
compared as in the patterns:

    %mul32 = trunc i64 %mul64 to i32
    %zext = zext i32 %mul32 to i64
    %overflow = icmp ne i64 %mul64, %zext
or
    %overflow = icmp ugt i64 %mul64 , 0xffffffff

then the multiplication may be replaced by call to umul.with.overflow.
This change fixes PR4917 and PR4918.

http://llvm-reviews.chandlerc.com/D2814

Files:
  lib/Transforms/InstCombine/InstCombineCompares.cpp
  test/Transforms/InstCombine/overflow-mul.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2814.1.patch
Type: text/x-patch
Size: 13336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140216/550950ba/attachment.bin>


More information about the llvm-commits mailing list