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 *
103103RegisterBankInfo::getMinimalPhysRegClass (Register Reg,
104104 const TargetRegisterInfo &TRI) const {
105105 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 ;
112110}
113111
114112const RegisterBank *RegisterBankInfo::getRegBankFromConstraints (
You can’t perform that action at this time.
0 commit comments