File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,10 @@ const TargetRegisterClass *
103
103
RegisterBankInfo::getMinimalPhysRegClass (Register Reg,
104
104
const TargetRegisterInfo &TRI) const {
105
105
assert (Reg.isPhysical () && " Reg must be a physreg" );
106
- const auto &RegRCIt = PhysRegMinimalRCs.find (Reg);
107
- if (RegRCIt != PhysRegMinimalRCs.end ())
108
- return RegRCIt->second ;
109
- const TargetRegisterClass *PhysRC = TRI.getMinimalPhysRegClassLLT (Reg, LLT ());
110
- PhysRegMinimalRCs[Reg] = PhysRC;
111
- return PhysRC;
106
+ const auto [RegRCIt, Inserted] = PhysRegMinimalRCs.try_emplace (Reg);
107
+ if (Inserted)
108
+ RegRCIt->second = TRI.getMinimalPhysRegClassLLT (Reg, LLT ());
109
+ return RegRCIt->second ;
112
110
}
113
111
114
112
const RegisterBank *RegisterBankInfo::getRegBankFromConstraints (
You can’t perform that action at this time.
0 commit comments