diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-15 07:28:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-15 07:28:58 +0000 |
commit | 9448184b99b2bbdb9a2107ef12bf4cbff86e684f (patch) | |
tree | 04ddbcd5719cb7cab08e91b563061d6c7bc11f3d | |
parent | 08859ffa6312f3bf7bd08fc98a81a6c86e1c9752 (diff) |
add another overflow idiom
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121854 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/README.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index e59c28697a..5c97b8984c 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 |