@@ -1080,7 +1080,7 @@ class LoopVectorizationCostModel {
1080
1080
void setWideningDecision (Instruction *I, ElementCount VF, InstWidening W,
1081
1081
InstructionCost Cost) {
1082
1082
assert (VF.isVector () && " Expected VF >=2" );
1083
- WideningDecisions[std::make_pair ( I, VF) ] = std::make_pair ( W, Cost) ;
1083
+ WideningDecisions[{ I, VF} ] = { W, Cost} ;
1084
1084
}
1085
1085
1086
1086
// / Save vectorization decision \p W and \p Cost taken by the cost model for
@@ -1102,11 +1102,9 @@ class LoopVectorizationCostModel {
1102
1102
for (unsigned Idx = 0 ; Idx < Grp->getFactor (); ++Idx) {
1103
1103
if (auto *I = Grp->getMember (Idx)) {
1104
1104
if (Grp->getInsertPos () == I)
1105
- WideningDecisions[std::make_pair (I, VF)] =
1106
- std::make_pair (W, InsertPosCost);
1105
+ WideningDecisions[{I, VF}] = {W, InsertPosCost};
1107
1106
else
1108
- WideningDecisions[std::make_pair (I, VF)] =
1109
- std::make_pair (W, OtherMemberCost);
1107
+ WideningDecisions[{I, VF}] = {W, OtherMemberCost};
1110
1108
}
1111
1109
}
1112
1110
}
@@ -1120,7 +1118,7 @@ class LoopVectorizationCostModel {
1120
1118
TheLoop->isInnermost () &&
1121
1119
" cost-model should not be used for outer loops (in VPlan-native path)" );
1122
1120
1123
- std::pair<Instruction *, ElementCount> InstOnVF = std::make_pair (I, VF);
1121
+ std::pair<Instruction *, ElementCount> InstOnVF (I, VF);
1124
1122
auto Itr = WideningDecisions.find (InstOnVF);
1125
1123
if (Itr == WideningDecisions.end ())
1126
1124
return CM_Unknown;
@@ -1131,7 +1129,7 @@ class LoopVectorizationCostModel {
1131
1129
// / width \p VF.
1132
1130
InstructionCost getWideningCost (Instruction *I, ElementCount VF) {
1133
1131
assert (VF.isVector () && " Expected VF >=2" );
1134
- std::pair<Instruction *, ElementCount> InstOnVF = std::make_pair (I, VF);
1132
+ std::pair<Instruction *, ElementCount> InstOnVF (I, VF);
1135
1133
assert (WideningDecisions.contains (InstOnVF) &&
1136
1134
" The cost is not calculated" );
1137
1135
return WideningDecisions[InstOnVF].second ;
@@ -1150,8 +1148,7 @@ class LoopVectorizationCostModel {
1150
1148
std::optional<unsigned > MaskPos,
1151
1149
InstructionCost Cost) {
1152
1150
assert (!VF.isScalar () && " Expected vector VF" );
1153
- CallWideningDecisions[std::make_pair (CI, VF)] = {Kind, Variant, IID,
1154
- MaskPos, Cost};
1151
+ CallWideningDecisions[{CI, VF}] = {Kind, Variant, IID, MaskPos, Cost};
1155
1152
}
1156
1153
1157
1154
CallWideningDecision getCallWideningDecision (CallInst *CI,
@@ -1348,21 +1345,20 @@ class LoopVectorizationCostModel {
1348
1345
void setTailFoldingStyles (bool IsScalableVF, unsigned UserIC) {
1349
1346
assert (!ChosenTailFoldingStyle && " Tail folding must not be selected yet." );
1350
1347
if (!Legal->canFoldTailByMasking ()) {
1351
- ChosenTailFoldingStyle =
1352
- std::make_pair (TailFoldingStyle::None, TailFoldingStyle::None);
1348
+ ChosenTailFoldingStyle = {TailFoldingStyle::None, TailFoldingStyle::None};
1353
1349
return ;
1354
1350
}
1355
1351
1356
1352
if (!ForceTailFoldingStyle.getNumOccurrences ()) {
1357
- ChosenTailFoldingStyle = std::make_pair (
1353
+ ChosenTailFoldingStyle = {
1358
1354
TTI.getPreferredTailFoldingStyle (/* IVUpdateMayOverflow=*/ true ),
1359
- TTI.getPreferredTailFoldingStyle (/* IVUpdateMayOverflow=*/ false )) ;
1355
+ TTI.getPreferredTailFoldingStyle (/* IVUpdateMayOverflow=*/ false )} ;
1360
1356
return ;
1361
1357
}
1362
1358
1363
1359
// Set styles when forced.
1364
- ChosenTailFoldingStyle = std::make_pair ( ForceTailFoldingStyle.getValue (),
1365
- ForceTailFoldingStyle.getValue ()) ;
1360
+ ChosenTailFoldingStyle = { ForceTailFoldingStyle.getValue (),
1361
+ ForceTailFoldingStyle.getValue ()} ;
1366
1362
if (ForceTailFoldingStyle != TailFoldingStyle::DataWithEVL)
1367
1363
return ;
1368
1364
// Override forced styles if needed.
@@ -1375,9 +1371,8 @@ class LoopVectorizationCostModel {
1375
1371
// If for some reason EVL mode is unsupported, fallback to
1376
1372
// DataWithoutLaneMask to try to vectorize the loop with folded tail
1377
1373
// in a generic way.
1378
- ChosenTailFoldingStyle =
1379
- std::make_pair (TailFoldingStyle::DataWithoutLaneMask,
1380
- TailFoldingStyle::DataWithoutLaneMask);
1374
+ ChosenTailFoldingStyle = {TailFoldingStyle::DataWithoutLaneMask,
1375
+ TailFoldingStyle::DataWithoutLaneMask};
1381
1376
LLVM_DEBUG (
1382
1377
dbgs ()
1383
1378
<< " LV: Preference for VP intrinsics indicated. Will "
@@ -8135,7 +8130,7 @@ void VPRecipeBuilder::collectScaledReductions(VFRange &Range) {
8135
8130
PartialReductionChain Chain = Pair.first ;
8136
8131
if (ExtendIsOnlyUsedByPartialReductions (Chain.ExtendA ) &&
8137
8132
ExtendIsOnlyUsedByPartialReductions (Chain.ExtendB ))
8138
- ScaledReductionMap.insert ( std::make_pair ( Chain.Reduction , Pair.second ) );
8133
+ ScaledReductionMap.emplace_or_assign ( Chain.Reduction , Pair.second );
8139
8134
}
8140
8135
}
8141
8136
@@ -8207,12 +8202,11 @@ bool VPRecipeBuilder::getScaledReductions(
8207
8202
[&](ElementCount VF) {
8208
8203
InstructionCost Cost = TTI->getPartialReductionCost (
8209
8204
Update->getOpcode (), A->getType (), B->getType (), PHI->getType (),
8210
- VF, OpAExtend, OpBExtend,
8211
- std::make_optional (BinOp->getOpcode ()));
8205
+ VF, OpAExtend, OpBExtend, BinOp->getOpcode ());
8212
8206
return Cost.isValid ();
8213
8207
},
8214
8208
Range)) {
8215
- Chains.push_back ( std::make_pair ( Chain, TargetScaleFactor) );
8209
+ Chains.emplace_back ( Chain, TargetScaleFactor);
8216
8210
return true ;
8217
8211
}
8218
8212
@@ -10105,9 +10099,9 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10105
10099
bool VectorizeLoop = true , InterleaveLoop = true ;
10106
10100
if (VF.Width .isScalar ()) {
10107
10101
LLVM_DEBUG (dbgs () << " LV: Vectorization is possible but not beneficial.\n " );
10108
- VecDiagMsg = std::make_pair (
10102
+ VecDiagMsg = {
10109
10103
" VectorizationNotBeneficial" ,
10110
- " the cost-model indicates that vectorization is not beneficial" ) ;
10104
+ " the cost-model indicates that vectorization is not beneficial" } ;
10111
10105
VectorizeLoop = false ;
10112
10106
}
10113
10107
@@ -10116,16 +10110,15 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10116
10110
// requested.
10117
10111
LLVM_DEBUG (dbgs () << " LV: Ignoring UserIC, because vectorization and "
10118
10112
" interleaving should be avoided up front\n " );
10119
- IntDiagMsg = std::make_pair (
10120
- " InterleavingAvoided" ,
10121
- " Ignoring UserIC, because interleaving was avoided up front" );
10113
+ IntDiagMsg = {" InterleavingAvoided" ,
10114
+ " Ignoring UserIC, because interleaving was avoided up front" };
10122
10115
InterleaveLoop = false ;
10123
10116
} else if (IC == 1 && UserIC <= 1 ) {
10124
10117
// Tell the user interleaving is not beneficial.
10125
10118
LLVM_DEBUG (dbgs () << " LV: Interleaving is not beneficial.\n " );
10126
- IntDiagMsg = std::make_pair (
10119
+ IntDiagMsg = {
10127
10120
" InterleavingNotBeneficial" ,
10128
- " the cost-model indicates that interleaving is not beneficial" ) ;
10121
+ " the cost-model indicates that interleaving is not beneficial" } ;
10129
10122
InterleaveLoop = false ;
10130
10123
if (UserIC == 1 ) {
10131
10124
IntDiagMsg.first = " InterleavingNotBeneficialAndDisabled" ;
@@ -10136,10 +10129,9 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10136
10129
// Tell the user interleaving is beneficial, but it explicitly disabled.
10137
10130
LLVM_DEBUG (
10138
10131
dbgs () << " LV: Interleaving is beneficial but is explicitly disabled." );
10139
- IntDiagMsg = std::make_pair (
10140
- " InterleavingBeneficialButDisabled" ,
10141
- " the cost-model indicates that interleaving is beneficial "
10142
- " but is explicitly disabled or interleave count is set to 1" );
10132
+ IntDiagMsg = {" InterleavingBeneficialButDisabled" ,
10133
+ " the cost-model indicates that interleaving is beneficial "
10134
+ " but is explicitly disabled or interleave count is set to 1" };
10143
10135
InterleaveLoop = false ;
10144
10136
}
10145
10137
@@ -10149,10 +10141,10 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10149
10141
if (!VectorizeLoop && InterleaveLoop && LVL.hasHistograms ()) {
10150
10142
LLVM_DEBUG (dbgs () << " LV: Not interleaving without vectorization due "
10151
10143
<< " to histogram operations.\n " );
10152
- IntDiagMsg = std::make_pair (
10144
+ IntDiagMsg = {
10153
10145
" HistogramPreventsScalarInterleaving" ,
10154
10146
" Unable to interleave without vectorization due to constraints on "
10155
- " the order of histogram operations" ) ;
10147
+ " the order of histogram operations" } ;
10156
10148
InterleaveLoop = false ;
10157
10149
}
10158
10150
0 commit comments