From: Chris Lattner Date: Wed, 15 Dec 2010 07:28:58 +0000 (+0000) Subject: add another overflow idiom X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9448184b99b2bbdb9a2107ef12bf4cbff86e684f;p=oota-llvm.git add another overflow idiom git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121854 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/README.txt b/lib/Target/README.txt index e59c28697a1..5c97b8984c1 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -93,6 +93,14 @@ when it would be better to generate: addq %rdi, %rbx jno LBB0_2 +Apparently some version of GCC knows this. Here is a multiply idiom: + +unsigned int mul(unsigned int a,unsigned int b) { + if ((unsigned long long)a*b>0xffffffff) + exit(0); + return a*b; +} + //===---------------------------------------------------------------------===// Get the C front-end to expand hypot(x,y) -> llvm.sqrt(x*x+y*y) when errno and