110 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes='instcombine' -S %s | FileCheck %s3 4 5define <4 x double> @shuffle_op0_freeze_poison(<2 x double> %a) {6; CHECK-LABEL: @shuffle_op0_freeze_poison(7; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison8; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[B]], <2 x double> [[A:%.*]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>9; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]10;11 %b = freeze <2 x double> poison12 %shuffle = shufflevector <2 x double> %b, <2 x double> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>13 ret <4 x double> %shuffle14}15 16define <4 x double> @shuffle_op1_freeze_poison(<2 x double> %a) {17; CHECK-LABEL: @shuffle_op1_freeze_poison(18; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison19; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>20; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]21;22 %b = freeze <2 x double> poison23 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>24 ret <4 x double> %shuffle25}26 27define <4 x double> @shuffle_op0_freeze_poison_use(<2 x double> %a) {28; CHECK-LABEL: @shuffle_op0_freeze_poison_use(29; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison30; CHECK-NEXT: call void @use(<2 x double> [[B]])31; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[B]], <2 x double> [[A:%.*]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>32; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]33;34 %b = freeze <2 x double> poison35 call void @use(<2 x double> %b)36 %shuffle = shufflevector <2 x double> %b, <2 x double> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>37 ret <4 x double> %shuffle38}39 40define <4 x double> @shuffle_op1_freeze_poison_use(<2 x double> %a) {41; CHECK-LABEL: @shuffle_op1_freeze_poison_use(42; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison43; CHECK-NEXT: call void @use(<2 x double> [[B]])44; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>45; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]46;47 %b = freeze <2 x double> poison48 call void @use(<2 x double> %b)49 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>50 ret <4 x double> %shuffle51}52 53define <4 x double> @shuffle_op0_freeze_undef(<2 x double> %a) {54; CHECK-LABEL: @shuffle_op0_freeze_undef(55; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> undef56; CHECK-NEXT: call void @use(<2 x double> [[B]])57; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[B]], <2 x double> [[A:%.*]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>58; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]59;60 %b = freeze <2 x double> undef61 call void @use(<2 x double> %b)62 %shuffle = shufflevector <2 x double> %b, <2 x double> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>63 ret <4 x double> %shuffle64}65 66define <4 x double> @shuffle_op1_freeze_undef(<2 x double> %a) {67; CHECK-LABEL: @shuffle_op1_freeze_undef(68; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> undef69; CHECK-NEXT: call void @use(<2 x double> [[B]])70; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>71; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]72;73 %b = freeze <2 x double> undef74 call void @use(<2 x double> %b)75 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>76 ret <4 x double> %shuffle77}78 79define <4 x double> @shuffle_bc1(<2 x double> %a) {80; CHECK-LABEL: @shuffle_bc1(81; CHECK-NEXT: [[B:%.*]] = freeze <4 x float> poison82; CHECK-NEXT: [[B1:%.*]] = bitcast <4 x float> [[B]] to <2 x double>83; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B1]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>84; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]85;86 %b = freeze <4 x float> poison87 %b1 = bitcast <4 x float> %b to <2 x double>88 %shuffle = shufflevector <2 x double> %a, <2 x double> %b1, <4 x i32> <i32 0, i32 1, i32 2, i32 3>89 ret <4 x double> %shuffle90}91 92define <8 x float> @shuffle_bc2(<4 x float> %a) {93; CHECK-LABEL: @shuffle_bc2(94; CHECK-NEXT: [[B:%.*]] = freeze <4 x float> poison95; CHECK-NEXT: [[B1:%.*]] = bitcast <4 x float> [[B]] to <2 x double>96; CHECK-NEXT: call void @use(<2 x double> [[B1]])97; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> [[B]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>98; CHECK-NEXT: ret <8 x float> [[SHUFFLE]]99;100 %b = freeze <4 x float> poison101 %b1 = bitcast <4 x float> %b to <2 x double>102 call void @use(<2 x double> %b1)103 %b2 = bitcast <2 x double> %b1 to <4 x float>104 %shuffle = shufflevector <4 x float> %a, <4 x float> %b2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>105 ret <8 x float> %shuffle106}107 108declare void @use(<2 x double>)109 110