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
This commit is contained in:
Chris Lattner
2011-02-06 21:44:57 +00:00
parent bd75021465
commit 35bda8914c
14 changed files with 110 additions and 32 deletions

View File

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