]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/Transforms/InstCombine/udiv-simplify-bug-1.ll
[canonicalize] Teach InstCombine to canonicalize loads which are only
[opencl/llvm.git] / test / Transforms / InstCombine / udiv-simplify-bug-1.ll
1 ; RUN: opt < %s -instcombine -S > %t1.ll
2 ; RUN: grep udiv %t1.ll | count 2
3 ; RUN: grep zext %t1.ll | count 2
4 ; PR2274
6 ; The udiv instructions shouldn't be optimized away, and the
7 ; sext instructions should be optimized to zext.
9 define i64 @bar(i32 %x, i32 %g) nounwind {
10   %y = lshr i32 %x, 30
11   %r = udiv i32 %y, %g
12   %z = sext i32 %r to i64
13   ret i64 %z
14 }
15 define i64 @qux(i32 %x, i32 %v) nounwind {
16   %y = lshr i32 %x, 31
17   %r = udiv i32 %y, %v
18   %z = sext i32 %r to i64
19   ret i64 %z
20 }