brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.1 KiB · fc19b11 Raw
118 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -p instcombine -S %s | FileCheck %s3 4define <4 x i16> @ext_identity_mask_first_vector_first_half_4xi16(<8 x i8> %x) {5; CHECK-LABEL: define <4 x i16> @ext_identity_mask_first_vector_first_half_4xi16(6; CHECK-SAME: <8 x i8> [[X:%.*]]) {7; CHECK-NEXT:  [[ENTRY:.*:]]8; CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <8 x i8> [[X]], <8 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>9; CHECK-NEXT:    [[SHUFFLE:%.*]] = zext <4 x i8> [[TMP0]] to <4 x i16>10; CHECK-NEXT:    ret <4 x i16> [[SHUFFLE]]11;12entry:13  %e.1 = zext <8 x i8> %x to <8 x i16>14  %shuffle = shufflevector <8 x i16> %e.1, <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>15  ret <4 x i16> %shuffle16}17 18define <3 x i32> @ext_identity_mask_first_vector_first_half_3xi32(<4 x i16> %x) {19; CHECK-LABEL: define <3 x i32> @ext_identity_mask_first_vector_first_half_3xi32(20; CHECK-SAME: <4 x i16> [[X:%.*]]) {21; CHECK-NEXT:  [[ENTRY:.*:]]22; CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <4 x i16> [[X]], <4 x i16> poison, <3 x i32> <i32 0, i32 1, i32 2>23; CHECK-NEXT:    [[SHUFFLE:%.*]] = zext <3 x i16> [[TMP0]] to <3 x i32>24; CHECK-NEXT:    ret <3 x i32> [[SHUFFLE]]25;26entry:27  %e.1 = zext <4 x i16> %x to <4 x i32>28  %shuffle = shufflevector <4 x i32> %e.1, <4 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>29  ret <3 x i32> %shuffle30}31 32define <4 x i16> @ext_no_identity_mask1(<8 x i8> %in) {33; CHECK-LABEL: define <4 x i16> @ext_no_identity_mask1(34; CHECK-SAME: <8 x i8> [[IN:%.*]]) {35; CHECK-NEXT:  [[ENTRY:.*:]]36; CHECK-NEXT:    [[E_1:%.*]] = zext <8 x i8> [[IN]] to <8 x i16>37; CHECK-NEXT:    [[SHUFFLE:%.*]] = shufflevector <8 x i16> [[E_1]], <8 x i16> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 4>38; CHECK-NEXT:    ret <4 x i16> [[SHUFFLE]]39;40entry:41  %e.1 = zext <8 x i8> %in to <8 x i16>42  %shuffle = shufflevector <8 x i16> %e.1, <8 x i16> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 4>43  ret <4 x i16> %shuffle44}45 46define <4 x i16> @ext_no_identity_mask2(<8 x i8> %x, <8 x i16> %y) {47; CHECK-LABEL: define <4 x i16> @ext_no_identity_mask2(48; CHECK-SAME: <8 x i8> [[X:%.*]], <8 x i16> [[Y:%.*]]) {49; CHECK-NEXT:  [[ENTRY:.*:]]50; CHECK-NEXT:    [[E_1:%.*]] = zext <8 x i8> [[X]] to <8 x i16>51; CHECK-NEXT:    [[SHUFFLE:%.*]] = shufflevector <8 x i16> [[E_1]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>52; CHECK-NEXT:    ret <4 x i16> [[SHUFFLE]]53;54entry:55  %e.1 = zext <8 x i8> %x to <8 x i16>56  %shuffle = shufflevector <8 x i16> %e.1, <8 x i16> %y, <4 x i32> <i32 4, i32 5, i32 6, i32 7>57  ret <4 x i16> %shuffle58}59 60define <5 x i32> @ext_identity_mask_first_vector_first_half_5xi32(<4 x i16> %x) {61; CHECK-LABEL: define <5 x i32> @ext_identity_mask_first_vector_first_half_5xi32(62; CHECK-SAME: <4 x i16> [[X:%.*]]) {63; CHECK-NEXT:  [[ENTRY:.*:]]64; CHECK-NEXT:    [[E_1:%.*]] = zext <4 x i16> [[X]] to <4 x i32>65; CHECK-NEXT:    [[SHUFFLE:%.*]] = shufflevector <4 x i32> [[E_1]], <4 x i32> poison, <5 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0>66; CHECK-NEXT:    ret <5 x i32> [[SHUFFLE]]67;68entry:69  %e.1 = zext <4 x i16> %x to <4 x i32>70  %shuffle = shufflevector <4 x i32> %e.1, <4 x i32> %e.1, <5 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4>71  ret <5 x i32> %shuffle72}73 74define <4 x i16> @ext_no_identity_mask_first_vector_second_half(<8 x i8> %x, <8 x i16> %y) {75; CHECK-LABEL: define <4 x i16> @ext_no_identity_mask_first_vector_second_half(76; CHECK-SAME: <8 x i8> [[X:%.*]], <8 x i16> [[Y:%.*]]) {77; CHECK-NEXT:  [[ENTRY:.*:]]78; CHECK-NEXT:    [[E_1:%.*]] = zext <8 x i8> [[X]] to <8 x i16>79; CHECK-NEXT:    [[SHUFFLE:%.*]] = shufflevector <8 x i16> [[E_1]], <8 x i16> [[Y]], <4 x i32> <i32 0, i32 9, i32 1, i32 10>80; CHECK-NEXT:    ret <4 x i16> [[SHUFFLE]]81;82entry:83  %e.1 = zext <8 x i8> %x to <8 x i16>84  %shuffle = shufflevector <8 x i16> %e.1, <8 x i16> %y, <4 x i32> <i32 0, i32 9, i32 1, i32 10>85  ret <4 x i16> %shuffle86}87 88define <4 x i16> @select_second_op(<8 x i8> %x, <8 x i16> %y) {89; CHECK-LABEL: define <4 x i16> @select_second_op(90; CHECK-SAME: <8 x i8> [[X:%.*]], <8 x i16> [[Y:%.*]]) {91; CHECK-NEXT:  [[ENTRY:.*:]]92; CHECK-NEXT:    [[SHUFFLE:%.*]] = shufflevector <8 x i16> [[Y]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>93; CHECK-NEXT:    ret <4 x i16> [[SHUFFLE]]94;95entry:96  %e.1 = zext <8 x i8> %x to <8 x i16>97  %shuffle = shufflevector <8 x i16> %e.1, <8 x i16> %y, <4 x i32> <i32 8, i32 9, i32 10, i32 11>98  ret <4 x i16> %shuffle99}100 101define <4 x i32> @load_i32_zext_to_v4i32(ptr %di) {102; CHECK-LABEL: define <4 x i32> @load_i32_zext_to_v4i32(103; CHECK-SAME: ptr [[DI:%.*]]) {104; CHECK-NEXT:  [[ENTRY:.*:]]105; CHECK-NEXT:    [[L1:%.*]] = load <4 x i8>, ptr [[DI]], align 4106; CHECK-NEXT:    [[EXT_2:%.*]] = zext <4 x i8> [[L1]] to <4 x i32>107; CHECK-NEXT:    ret <4 x i32> [[EXT_2]]108;109entry:110  %l = load i32, ptr %di111  %vec.ins = insertelement <2 x i32> <i32 poison, i32 0>, i32 %l, i64 0112  %vec.bc = bitcast <2 x i32> %vec.ins to <8 x i8>113  %e.1 = zext <8 x i8> %vec.bc to <8 x i16>114  %vec.shuffle = shufflevector <8 x i16> %e.1, <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>115  %ext.2 = zext nneg <4 x i16> %vec.shuffle to <4 x i32>116  ret <4 x i32> %ext.2117}118