llvm.org GIT mirror llvm / bf352f5
[ORC] Make sure we linker-mangle symbol names in the SpeculationLayer. If mangling is not performed then speculative lookups will fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369219 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 2 months ago
2 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
104104 CompileLayer(*this->ES, ObjLayer,
105105 ConcurrentIRCompiler(std::move(JTMB))),
106106 S(Imps, *this->ES),
107 SpeculateLayer(*this->ES, CompileLayer, S, BlockFreqQuery()),
107 SpeculateLayer(*this->ES, CompileLayer, S, Mangle, BlockFreqQuery()),
108108 CODLayer(*this->ES, SpeculateLayer, *this->LCTMgr,
109109 std::move(ISMBuilder)) {
110110 this->ES->getMainJITDylib().addGenerator(
156156 using TargetAndLikelies = DenseMap;
157157
158158 IRSpeculationLayer(ExecutionSession &ES, IRCompileLayer &BaseLayer,
159 Speculator &Spec, ResultEval Interpreter)
160 : IRLayer(ES), NextLayer(BaseLayer), S(Spec), QueryAnalysis(Interpreter) {
159 Speculator &Spec, MangleAndInterner &Mangle,
160 ResultEval Interpreter)
161 : IRLayer(ES), NextLayer(BaseLayer), S(Spec), Mangle(Mangle),
162 QueryAnalysis(Interpreter) {
161163 PB.registerFunctionAnalyses(FAM);
162164 }
163165
169171 assert(!IRNames.empty() && "No IRNames received to Intern?");
170172 TargetAndLikelies InternedNames;
171173 DenseSet TargetJITNames;
172 ExecutionSession &Es = getExecutionSession();
173174 for (auto &NamePair : IRNames) {
174175 for (auto &TargetNames : NamePair.second)
175 TargetJITNames.insert(Es.intern(TargetNames));
176
177 InternedNames.insert(
178 {Es.intern(NamePair.first), std::move(TargetJITNames)});
176 TargetJITNames.insert(Mangle(TargetNames));
177
178 InternedNames[Mangle(NamePair.first)] = std::move(TargetJITNames);
179179 }
180180 return InternedNames;
181181 }
182182
183183 IRCompileLayer &NextLayer;
184184 Speculator &S;
185 MangleAndInterner &Mangle;
185186 PassBuilder PB;
186187 FunctionAnalysisManager FAM;
187188 ResultEval QueryAnalysis;