diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-06 21:44:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-06 21:44:57 +0000 |
commit | 35bda8914c0d1c02a6f90f42e7810c83150737e1 (patch) | |
tree | b210ccd009a7ac5331c76c6393b5b45d141d12d0 /test/Assembler | |
parent | bd75021465e7f8c81785e692cfd3ce559764e46f (diff) |
enhance vmcore to know that udiv's can be exact, and add a trivial
instcombine xform to exercise this.
Nothing forms exact udivs yet though. This is progress on PR8862
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler')
-rw-r--r-- | test/Assembler/flags.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Assembler/flags.ll b/test/Assembler/flags.ll index 3241909059..82b35b5c21 100644 --- a/test/Assembler/flags.ll +++ b/test/Assembler/flags.ll @@ -104,6 +104,19 @@ define i64 @sdiv_plain(i64 %x, i64 %y) { ret i64 %z } +define i64 @udiv_exact(i64 %x, i64 %y) { +; CHECK: %z = udiv exact i64 %x, %y + %z = udiv exact i64 %x, %y + ret i64 %z +} + +define i64 @udiv_plain(i64 %x, i64 %y) { +; CHECK: %z = udiv i64 %x, %y + %z = udiv i64 %x, %y + ret i64 %z +} + + define i64* @gep_nw(i64* %p, i64 %x) { ; CHECK: %z = getelementptr inbounds i64* %p, i64 %x %z = getelementptr inbounds i64* %p, i64 %x @@ -136,6 +149,11 @@ define i64 @sdiv_exact_ce() { ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91) } +define i64 @udiv_exact_ce() { +; CHECK: ret i64 udiv exact (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 udiv exact (i64 ptrtoint (i64* @addr to i64), i64 91) +} + define i64* @gep_nw_ce() { ; CHECK: ret i64* getelementptr inbounds (i64* @addr, i64 171) ret i64* getelementptr inbounds (i64* @addr, i64 171) @@ -210,3 +228,4 @@ define i64 @mul_unsigned_ce() { ; CHECK: ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91) ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91) } + |