1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -instsimplify -S | FileCheck %s
3
4; This tests checks optimization consistency for scalar and vector code.
5; If m_Zero() is able to match a vector undef, but not a scalar undef,
6; the two cases will simplify differently.
7
8define i32 @test_scalar(i32 %a, i1 %b) {
9; CHECK-LABEL: @test_scalar(
10; CHECK-NEXT:    ret i32 undef
11;
12  %c = sext i1 %b to i32
13  %d = ashr i32 undef, %c
14  ret i32 %d
15}
16
17define <2 x i32> @test_vector(<2 x i32> %a, <2 x i1> %b) {
18; CHECK-LABEL: @test_vector(
19; CHECK-NEXT:    ret <2 x i32> undef
20;
21  %c = sext <2 x i1> %b to <2 x i32>
22  %d = ashr <2 x i32> undef, %c
23  ret <2 x i32> %d
24}
25
26