1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
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.
8 define i32 @test_scalar(i32 %a, i1 %b) {
9 ; CHECK-LABEL: @test_scalar(
10 ; CHECK-NEXT: ret i32 undef
12 %c = sext i1 %b to i32
13 %d = ashr i32 undef, %c
17 define <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
21 %c = sext <2 x i1> %b to <2 x i32>
22 %d = ashr <2 x i32> undef, %c