@@ -1809,12 +1809,11 @@ Intrinsic::DagEmitter::emitDagSaveTemp(const DagInit *DI) {
1809
1809
assert_with_loc (!N.empty (),
1810
1810
" save_temp() expects a name as the first argument" );
1811
1811
1812
- assert_with_loc (Intr. Variables . find (N) == Intr. Variables . end (),
1813
- " Variable already defined! " );
1814
- Intr. Variables [N] = Variable (A. first , N + Intr. VariablePostfix );
1812
+ auto [It, Inserted] =
1813
+ Intr. Variables . try_emplace (N, A. first , N + Intr. VariablePostfix );
1814
+ assert_with_loc (Inserted, " Variable already defined! " );
1815
1815
1816
- std::string S =
1817
- A.first .str () + " " + Intr.Variables [N].getName () + " = " + A.second ;
1816
+ std::string S = A.first .str () + " " + It->second .getName () + " = " + A.second ;
1818
1817
1819
1818
return std::make_pair (Type::getVoid (), S);
1820
1819
}
@@ -2246,9 +2245,9 @@ void NeonEmitter::genIntrinsicRangeCheckCode(
2246
2245
// Sorted by immediate argument index
2247
2246
ArrayRef<ImmCheck> Checks = Def->getImmChecks ();
2248
2247
2249
- const auto it = Emitted.find (Def->getMangledName ());
2250
- if (it != Emitted. end () ) {
2251
- assert (areRangeChecksCompatible (Checks, it ->second ) &&
2248
+ auto [It, Inserted] = Emitted.try_emplace (Def->getMangledName (), Checks );
2249
+ if (!Inserted ) {
2250
+ assert (areRangeChecksCompatible (Checks, It ->second ) &&
2252
2251
" Neon intrinsics with incompatible immediate range checks cannot "
2253
2252
" share a builtin." );
2254
2253
continue ; // Ensure this is emitted only once
@@ -2262,7 +2261,6 @@ void NeonEmitter::genIntrinsicRangeCheckCode(
2262
2261
<< Check.getVecSizeInBits () << " );\n "
2263
2262
<< " break;\n " ;
2264
2263
}
2265
- Emitted[Def->getMangledName ()] = Checks;
2266
2264
}
2267
2265
2268
2266
OS << " #endif\n\n " ;
0 commit comments