diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-05-20 22:08:16 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-05-20 22:08:16 +0000 |
commit | 312c9afd905da72d9a11d8fee5d3c5117584a0b1 (patch) | |
tree | 0e09705bca65d6efe788db052d83edcd18403af0 /llvm | |
parent | dc8af06b279cd884ece51d82190a006838dff836 (diff) | |
download | bcm5719-llvm-312c9afd905da72d9a11d8fee5d3c5117584a0b1.tar.gz bcm5719-llvm-312c9afd905da72d9a11d8fee5d3c5117584a0b1.zip |
add test for vector shift
llvm-svn: 270284
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/test/Transforms/InstCombine/shift.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll index 175c628f11f..e4dd377952a 100644 --- a/llvm/test/Transforms/InstCombine/shift.ll +++ b/llvm/test/Transforms/InstCombine/shift.ll @@ -700,6 +700,19 @@ define i32 @test42(i32 %a, i32 %b) nounwind { ret i32 %div2 } +; FIXME: Vector lshr should be treated the same as scalar. + +define <2 x i32> @test42vec(<2 x i32> %a, <2 x i32> %b) { +; CHECK-LABEL: @test42vec( +; CHECK-NEXT: [[DIV:%.*]] = lshr <2 x i32> <i32 4096, i32 4096>, %b +; CHECK-NEXT: [[DIV2:%.*]] = udiv <2 x i32> %a, [[DIV]] +; CHECK-NEXT: ret <2 x i32> [[DIV2]] +; + %div = lshr <2 x i32> <i32 4096, i32 4096>, %b ; must be exact otherwise we'd divide by zero + %div2 = udiv <2 x i32> %a, %div + ret <2 x i32> %div2 +} + define i32 @test43(i32 %a, i32 %b) nounwind { ; CHECK-LABEL: @test43( ; CHECK-NEXT: [[TMP1:%.*]] = add i32 %b, 12 |