File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4672,8 +4672,8 @@ class TypePromotionHelper {
4672
4672
static void addPromotedInst (InstrToOrigTy &PromotedInsts,
4673
4673
Instruction *ExtOpnd, bool IsSExt) {
4674
4674
ExtType ExtTy = IsSExt ? SignExtension : ZeroExtension;
4675
- InstrToOrigTy::iterator It = PromotedInsts.find (ExtOpnd);
4676
- if (It != PromotedInsts. end () ) {
4675
+ auto [It, Inserted] = PromotedInsts.try_emplace (ExtOpnd);
4676
+ if (!Inserted ) {
4677
4677
// If the new extension is same as original, the information in
4678
4678
// PromotedInsts[ExtOpnd] is still correct.
4679
4679
if (It->second .getInt () == ExtTy)
@@ -4684,7 +4684,7 @@ class TypePromotionHelper {
4684
4684
// BothExtension.
4685
4685
ExtTy = BothExtension;
4686
4686
}
4687
- PromotedInsts[ExtOpnd] = TypeIsSExt (ExtOpnd->getType (), ExtTy);
4687
+ It-> second = TypeIsSExt (ExtOpnd->getType (), ExtTy);
4688
4688
}
4689
4689
4690
4690
// / Utility function to query the original type of instruction \p Opnd
You can’t perform that action at this time.
0 commit comments