MVT MScalarTy = LT.second.getScalarType();
auto IsCheapPInsrPExtrInsertPS = [&]() {
+ // Assume pinsr/pextr XMM <-> GPR is relatively cheap on all targets.
+ // Also, assume insertps is relatively cheap on all >= SSE41 targets.
return (MScalarTy == MVT::i16 && ST->hasSSE2()) ||
(MScalarTy.isInteger() && ST->hasSSE41()) ||
(MScalarTy == MVT::f32 && ST->hasSSE41() &&
if (auto *Entry = CostTableLookup(SLMCostTbl, ISD, MScalarTy))
return Entry->Cost + RegisterFileMoveCost;
- // Assume pinsr/pextr XMM <-> GPR is relatively cheap on all targets.
- // Assume insertps is relatively cheap on all targets.
+ // Consider cheap cases.
if (IsCheapPInsrPExtrInsertPS())
return 1 + RegisterFileMoveCost;