diff options
author | Chris Lattner <sabre@nondot.org> | 2010-10-14 00:05:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-10-14 00:05:07 +0000 |
commit | eafc5cb80d58cb9447623a557be4d4f55f42fbc3 (patch) | |
tree | 56190b2247d2cd228717675daad96d9864deee39 /test/Transforms/ConstProp | |
parent | 08e90f5646e61c3be0eebfa172ec73a8b56abee8 (diff) | |
download | external_llvm-eafc5cb80d58cb9447623a557be4d4f55f42fbc3.zip external_llvm-eafc5cb80d58cb9447623a557be4d4f55f42fbc3.tar.gz external_llvm-eafc5cb80d58cb9447623a557be4d4f55f42fbc3.tar.bz2 |
add uadd_ov/usub_ov to apint, consolidate constant folding
logic to use the new APInt methods. Among other things this
implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold
which comes from "clang -ftrapv", originally brought to my attention from PR8221.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ConstProp')
-rw-r--r-- | test/Transforms/ConstProp/overflow-ops.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Transforms/ConstProp/overflow-ops.ll b/test/Transforms/ConstProp/overflow-ops.ll index 1547a4d..5587e9b 100644 --- a/test/Transforms/ConstProp/overflow-ops.ll +++ b/test/Transforms/ConstProp/overflow-ops.ll @@ -170,3 +170,14 @@ declare {i8, i1} @llvm.usub.with.overflow.i8(i8, i8) declare {i8, i1} @llvm.sadd.with.overflow.i8(i8, i8) declare {i8, i1} @llvm.ssub.with.overflow.i8(i8, i8) +declare {i8, i1} @llvm.smul.with.overflow.i8(i8, i8) + +; rdar://8501501 +define {i8, i1} @smul_1() nounwind { +entry: + %t = call {i8, i1} @llvm.smul.with.overflow.i8(i8 -20, i8 -10) + ret {i8, i1} %t + +; CHECK: @smul_1 +; CHECK: ret %i8i1 { i8 -56, i1 true } +} |