add another overflow idiom

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-12-15 07:28:58 +00:00
parent 08859ffa63
commit 9448184b99

View File

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