diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll index ea0954c02b4e6..18aac5ac44b0f 100644 --- a/llvm/test/Transforms/InstCombine/shift.ll +++ b/llvm/test/Transforms/InstCombine/shift.ll @@ -603,6 +603,37 @@ define i32 @test38(i32 %x) nounwind readnone { ret i32 %shl } +define <2 x i32> @test38_uniform(<2 x i32> %x) nounwind readnone { +; CHECK-LABEL: @test38_uniform( +; CHECK-NEXT: [[REM1:%.*]] = and <2 x i32> [[X:%.*]], +; CHECK-NEXT: [[SHL:%.*]] = shl <2 x i32> , [[REM1]] +; CHECK-NEXT: ret <2 x i32> [[SHL]] +; + %rem = srem <2 x i32> %x, + %shl = shl <2 x i32> , %rem + ret <2 x i32> %shl +} + +define <3 x i32> @test38_nonuniform(<3 x i32> %x) nounwind readnone { +; CHECK-LABEL: @test38_nonuniform( +; CHECK-NEXT: [[REM:%.*]] = srem <3 x i32> [[X:%.*]], +; CHECK-NEXT: [[SHL:%.*]] = shl <3 x i32> , [[REM]] +; CHECK-NEXT: ret <3 x i32> [[SHL]] +; + %rem = srem <3 x i32> %x, + %shl = shl <3 x i32> , %rem + ret <3 x i32> %shl +} + +define <2 x i32> @test38_undef(<2 x i32> %x) nounwind readnone { +; CHECK-LABEL: @test38_undef( +; CHECK-NEXT: ret <2 x i32> undef +; + %rem = srem <2 x i32> %x, + %shl = shl <2 x i32> , %rem + ret <2 x i32> %shl +} + ; define i8 @test39(i32 %a0) { ; CHECK-LABEL: @test39(