1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instsimplify -S | FileCheck %s
4 define i32 @sub_self(i32 %A) {
5 ; CHECK-LABEL: @sub_self(
6 ; CHECK-NEXT: ret i32 0
12 define <2 x i32> @sub_self_vec(<2 x i32> %A) {
13 ; CHECK-LABEL: @sub_self_vec(
14 ; CHECK-NEXT: ret <2 x i32> zeroinitializer
16 %B = sub <2 x i32> %A, %A
20 define i32 @sub_zero(i32 %A) {
21 ; CHECK-LABEL: @sub_zero(
22 ; CHECK-NEXT: ret i32 [[A:%.*]]
28 define <2 x i32> @sub_zero_vec(<2 x i32> %A) {
29 ; CHECK-LABEL: @sub_zero_vec(
30 ; CHECK-NEXT: ret <2 x i32> [[A:%.*]]
32 %B = sub <2 x i32> %A, <i32 0, i32 undef>
36 define i32 @neg_neg(i32 %A) {
37 ; CHECK-LABEL: @neg_neg(
38 ; CHECK-NEXT: ret i32 [[A:%.*]]
45 define <2 x i32> @neg_neg_vec(<2 x i32> %A) {
46 ; CHECK-LABEL: @neg_neg_vec(
47 ; CHECK-NEXT: ret <2 x i32> [[A:%.*]]
49 %B = sub <2 x i32> <i32 0, i32 undef>, %A
50 %C = sub <2 x i32> <i32 0, i32 undef>, %B