diff options
author | Eric Christopher <echristo@apple.com> | 2011-01-20 00:29:24 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-01-20 00:29:24 +0000 |
commit | 38a18261b97a0b7e0ed75b1c8edd81ec9bd01085 (patch) | |
tree | 7da904975935f6e364699b89d18c34aef5a56416 /test/CodeGen/ARM/umulo-32.ll | |
parent | e449d1f189e8ed719fa42d3ec2216a9d8adb9852 (diff) | |
download | llvm-38a18261b97a0b7e0ed75b1c8edd81ec9bd01085.tar.gz llvm-38a18261b97a0b7e0ed75b1c8edd81ec9bd01085.tar.bz2 llvm-38a18261b97a0b7e0ed75b1c8edd81ec9bd01085.tar.xz |
If we can, lower the multiply part of a umulo/smulo call to a libcall
with an invalid type then split the result and perform the overflow check
normally.
Fixes the 32-bit parts of rdar://8622122 and rdar://8774702.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/umulo-32.ll')
-rw-r--r-- | test/CodeGen/ARM/umulo-32.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/umulo-32.ll b/test/CodeGen/ARM/umulo-32.ll new file mode 100644 index 0000000000..aa7d28a623 --- /dev/null +++ b/test/CodeGen/ARM/umulo-32.ll @@ -0,0 +1,14 @@ +; RUN: llc < %s -mtriple=thumbv6-apple-darwin | FileCheck %s + +%umul.ty = type { i32, i1 } + +define i32 @func(i32 %a) nounwind { +; CHECK: func +; CHECK: muldi3 + %tmp0 = tail call %umul.ty @llvm.umul.with.overflow.i32(i32 %a, i32 37) + %tmp1 = extractvalue %umul.ty %tmp0, 0 + %tmp2 = select i1 undef, i32 -1, i32 %tmp1 + ret i32 %tmp2 +} + +declare %umul.ty @llvm.umul.with.overflow.i32(i32, i32) nounwind readnone |