diff --git a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h index e6b8a381b7180..c7f846b8e9bcc 100644 --- a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h +++ b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h @@ -176,8 +176,9 @@ struct ModuleAnalysisInfo { RegisterAliasTable[MF][Reg] = AliasReg; } Register getRegisterAlias(const MachineFunction *MF, Register Reg) { - auto RI = RegisterAliasTable[MF].find(Reg); - if (RI == RegisterAliasTable[MF].end()) { + auto &RegTable = RegisterAliasTable[MF]; + auto RI = RegTable.find(Reg); + if (RI == RegTable.end()) { return Register(0); } return RI->second;