EVT SelCondTy = TLI->getValueType(CondTy);
EVT SelValTy = TLI->getValueType(ValTy);
- int Idx = ConvertCostTableLookup<MVT>(NEONVectorSelectTbl,
- array_lengthof(NEONVectorSelectTbl),
- ISD, SelCondTy.getSimpleVT(),
- SelValTy.getSimpleVT());
- if (Idx != -1)
- return NEONVectorSelectTbl[Idx].Cost;
+ if (SelCondTy.isSimple() && SelValTy.isSimple()) {
+ int Idx = ConvertCostTableLookup<MVT>(NEONVectorSelectTbl,
+ array_lengthof(NEONVectorSelectTbl),
+ ISD, SelCondTy.getSimpleVT(),
+ SelValTy.getSimpleVT());
+ if (Idx != -1)
+ return NEONVectorSelectTbl[Idx].Cost;
+ }
std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(ValTy);
return LT.first;
; CHECK: cost of 1 {{.*}} select
%v19 = select <2 x i1> undef, <2 x double> undef, <2 x double> undef
+ ; odd vectors get legalized and should have similar costs
+ ; CHECK: cost of 1 {{.*}} select
+ %v20 = select <1 x i1> undef, <1 x i32> undef, <1 x i32> undef
+ ; CHECK: cost of 1 {{.*}} select
+ %v21 = select <3 x i1> undef, <3 x float> undef, <3 x float> undef
+ ; CHECK: cost of 4 {{.*}} select
+ %v22 = select <5 x i1> undef, <5 x double> undef, <5 x double> undef
+
ret void
}