blob: 68eb1ef90eb29c01f9d5d6ddd0f12bdc87da5577 [file] [log] [blame]
Teresa Johnson2d5487c2016-04-11 13:58:45 +00001//===- ModuleSummaryAnalysis.cpp - Module summary index builder -----------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Teresa Johnson2d5487c2016-04-11 13:58:45 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This pass builds a ModuleSummaryIndex object for the module, to be written
10// to bitcode or LLVM assembly.
11//
12//===----------------------------------------------------------------------===//
13
14#include "llvm/Analysis/ModuleSummaryAnalysis.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000015#include "llvm/ADT/ArrayRef.h"
16#include "llvm/ADT/DenseSet.h"
Peter Collingbourne0c30f082016-12-20 21:12:28 +000017#include "llvm/ADT/MapVector.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000018#include "llvm/ADT/STLExtras.h"
Peter Collingbourne0c30f082016-12-20 21:12:28 +000019#include "llvm/ADT/SetVector.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000020#include "llvm/ADT/SmallPtrSet.h"
21#include "llvm/ADT/SmallVector.h"
22#include "llvm/ADT/StringRef.h"
Teresa Johnson2d5487c2016-04-11 13:58:45 +000023#include "llvm/Analysis/BlockFrequencyInfo.h"
Teresa Johnson2d5487c2016-04-11 13:58:45 +000024#include "llvm/Analysis/BranchProbabilityInfo.h"
Teresa Johnsoncd21a642016-07-17 14:47:01 +000025#include "llvm/Analysis/IndirectCallPromotionAnalysis.h"
Teresa Johnson2d5487c2016-04-11 13:58:45 +000026#include "llvm/Analysis/LoopInfo.h"
Piotr Padlewskid9830eb2016-09-26 20:37:32 +000027#include "llvm/Analysis/ProfileSummaryInfo.h"
Peter Collingbourne1b4137a72016-12-21 23:03:45 +000028#include "llvm/Analysis/TypeMetadataUtils.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000029#include "llvm/IR/Attributes.h"
30#include "llvm/IR/BasicBlock.h"
Teresa Johnson2d5487c2016-04-11 13:58:45 +000031#include "llvm/IR/CallSite.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000032#include "llvm/IR/Constant.h"
33#include "llvm/IR/Constants.h"
Teresa Johnson2d5487c2016-04-11 13:58:45 +000034#include "llvm/IR/Dominators.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000035#include "llvm/IR/Function.h"
36#include "llvm/IR/GlobalAlias.h"
37#include "llvm/IR/GlobalValue.h"
38#include "llvm/IR/GlobalVariable.h"
39#include "llvm/IR/Instructions.h"
Teresa Johnson2d5487c2016-04-11 13:58:45 +000040#include "llvm/IR/IntrinsicInst.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000041#include "llvm/IR/Intrinsics.h"
42#include "llvm/IR/Metadata.h"
43#include "llvm/IR/Module.h"
44#include "llvm/IR/ModuleSummaryIndex.h"
45#include "llvm/IR/Use.h"
46#include "llvm/IR/User.h"
Peter Collingbourne61781ac2017-03-31 00:08:24 +000047#include "llvm/Object/ModuleSymbolTable.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000048#include "llvm/Object/SymbolicFile.h"
Teresa Johnson2d5487c2016-04-11 13:58:45 +000049#include "llvm/Pass.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000050#include "llvm/Support/Casting.h"
Teresa Johnsondb83ace2018-03-31 00:18:08 +000051#include "llvm/Support/CommandLine.h"
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +000052#include <algorithm>
53#include <cassert>
54#include <cstdint>
55#include <vector>
56
Teresa Johnson2d5487c2016-04-11 13:58:45 +000057using namespace llvm;
58
59#define DEBUG_TYPE "module-summary-analysis"
60
Teresa Johnsondb83ace2018-03-31 00:18:08 +000061// Option to force edges cold which will block importing when the
62// -import-cold-multiplier is set to 0. Useful for debugging.
63FunctionSummary::ForceSummaryHotnessType ForceSummaryEdgesCold =
64 FunctionSummary::FSHT_None;
65cl::opt<FunctionSummary::ForceSummaryHotnessType, true> FSEC(
66 "force-summary-edges-cold", cl::Hidden, cl::location(ForceSummaryEdgesCold),
67 cl::desc("Force all edges in the function summary to cold"),
68 cl::values(clEnumValN(FunctionSummary::FSHT_None, "none", "None."),
69 clEnumValN(FunctionSummary::FSHT_AllNonCritical,
70 "all-non-critical", "All non-critical edges."),
71 clEnumValN(FunctionSummary::FSHT_All, "all", "All edges.")));
72
Teresa Johnson2f616e42019-01-28 23:43:26 +000073cl::opt<std::string> ModuleSummaryDotFile(
74 "module-summary-dot-file", cl::init(""), cl::Hidden,
75 cl::value_desc("filename"),
76 cl::desc("File to emit dot graph of new summary into."));
77
Teresa Johnson2d5487c2016-04-11 13:58:45 +000078// Walk through the operands of a given User via worklist iteration and populate
79// the set of GlobalValue references encountered. Invoked either on an
80// Instruction or a GlobalVariable (which walks its initializer).
Eugene Levianteddf6b52018-10-12 07:24:02 +000081// Return true if any of the operands contains blockaddress. This is important
82// to know when computing summary for global var, because if global variable
83// references basic block address we can't import it separately from function
84// containing that basic block. For simplicity we currently don't import such
85// global vars at all. When importing function we aren't interested if any
86// instruction in it takes an address of any basic block, because instruction
87// can only take an address of basic block located in the same function.
88static bool findRefEdges(ModuleSummaryIndex &Index, const User *CurUser,
Peter Collingbourne9667b912017-05-04 18:03:25 +000089 SetVector<ValueInfo> &RefEdges,
Teresa Johnson2d5487c2016-04-11 13:58:45 +000090 SmallPtrSet<const User *, 8> &Visited) {
Eugene Levianteddf6b52018-10-12 07:24:02 +000091 bool HasBlockAddress = false;
Teresa Johnson2d5487c2016-04-11 13:58:45 +000092 SmallVector<const User *, 32> Worklist;
93 Worklist.push_back(CurUser);
94
95 while (!Worklist.empty()) {
96 const User *U = Worklist.pop_back_val();
97
98 if (!Visited.insert(U).second)
99 continue;
100
101 ImmutableCallSite CS(U);
102
103 for (const auto &OI : U->operands()) {
104 const User *Operand = dyn_cast<User>(OI);
105 if (!Operand)
106 continue;
Eugene Levianteddf6b52018-10-12 07:24:02 +0000107 if (isa<BlockAddress>(Operand)) {
108 HasBlockAddress = true;
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000109 continue;
Eugene Levianteddf6b52018-10-12 07:24:02 +0000110 }
Peter Collingbourne0c30f082016-12-20 21:12:28 +0000111 if (auto *GV = dyn_cast<GlobalValue>(Operand)) {
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000112 // We have a reference to a global value. This should be added to
113 // the reference set unless it is a callee. Callees are handled
114 // specially by WriteFunction and are added to a separate list.
115 if (!(CS && CS.isCallee(&OI)))
Peter Collingbourne9667b912017-05-04 18:03:25 +0000116 RefEdges.insert(Index.getOrInsertValueInfo(GV));
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000117 continue;
118 }
119 Worklist.push_back(Operand);
120 }
121 }
Eugene Levianteddf6b52018-10-12 07:24:02 +0000122 return HasBlockAddress;
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000123}
124
Piotr Padlewskid9830eb2016-09-26 20:37:32 +0000125static CalleeInfo::HotnessType getHotness(uint64_t ProfileCount,
126 ProfileSummaryInfo *PSI) {
127 if (!PSI)
128 return CalleeInfo::HotnessType::Unknown;
129 if (PSI->isHotCount(ProfileCount))
130 return CalleeInfo::HotnessType::Hot;
131 if (PSI->isColdCount(ProfileCount))
132 return CalleeInfo::HotnessType::Cold;
133 return CalleeInfo::HotnessType::None;
134}
135
Teresa Johnson519465b2017-01-05 14:32:16 +0000136static bool isNonRenamableLocal(const GlobalValue &GV) {
137 return GV.hasSection() && GV.hasLocalLinkage();
138}
139
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000140/// Determine whether this call has all constant integer arguments (excluding
141/// "this") and summarize it to VCalls or ConstVCalls as appropriate.
142static void addVCallToSet(DevirtCallSite Call, GlobalValue::GUID Guid,
143 SetVector<FunctionSummary::VFuncId> &VCalls,
144 SetVector<FunctionSummary::ConstVCall> &ConstVCalls) {
145 std::vector<uint64_t> Args;
146 // Start from the second argument to skip the "this" pointer.
147 for (auto &Arg : make_range(Call.CS.arg_begin() + 1, Call.CS.arg_end())) {
148 auto *CI = dyn_cast<ConstantInt>(Arg);
149 if (!CI || CI->getBitWidth() > 64) {
150 VCalls.insert({Guid, Call.Offset});
151 return;
152 }
153 Args.push_back(CI->getZExtValue());
154 }
155 ConstVCalls.insert({{Guid, Call.Offset}, std::move(Args)});
156}
157
158/// If this intrinsic call requires that we add information to the function
159/// summary, do so via the non-constant reference arguments.
160static void addIntrinsicToSummary(
161 const CallInst *CI, SetVector<GlobalValue::GUID> &TypeTests,
162 SetVector<FunctionSummary::VFuncId> &TypeTestAssumeVCalls,
163 SetVector<FunctionSummary::VFuncId> &TypeCheckedLoadVCalls,
164 SetVector<FunctionSummary::ConstVCall> &TypeTestAssumeConstVCalls,
Teresa Johnsonf24136f2018-09-27 14:55:32 +0000165 SetVector<FunctionSummary::ConstVCall> &TypeCheckedLoadConstVCalls,
166 DominatorTree &DT) {
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000167 switch (CI->getCalledFunction()->getIntrinsicID()) {
168 case Intrinsic::type_test: {
169 auto *TypeMDVal = cast<MetadataAsValue>(CI->getArgOperand(1));
170 auto *TypeId = dyn_cast<MDString>(TypeMDVal->getMetadata());
171 if (!TypeId)
172 break;
173 GlobalValue::GUID Guid = GlobalValue::getGUID(TypeId->getString());
174
175 // Produce a summary from type.test intrinsics. We only summarize type.test
176 // intrinsics that are used other than by an llvm.assume intrinsic.
177 // Intrinsics that are assumed are relevant only to the devirtualization
178 // pass, not the type test lowering pass.
179 bool HasNonAssumeUses = llvm::any_of(CI->uses(), [](const Use &CIU) {
180 auto *AssumeCI = dyn_cast<CallInst>(CIU.getUser());
181 if (!AssumeCI)
182 return true;
183 Function *F = AssumeCI->getCalledFunction();
184 return !F || F->getIntrinsicID() != Intrinsic::assume;
185 });
186 if (HasNonAssumeUses)
187 TypeTests.insert(Guid);
188
189 SmallVector<DevirtCallSite, 4> DevirtCalls;
190 SmallVector<CallInst *, 4> Assumes;
Teresa Johnsonf24136f2018-09-27 14:55:32 +0000191 findDevirtualizableCallsForTypeTest(DevirtCalls, Assumes, CI, DT);
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000192 for (auto &Call : DevirtCalls)
193 addVCallToSet(Call, Guid, TypeTestAssumeVCalls,
194 TypeTestAssumeConstVCalls);
195
196 break;
197 }
198
199 case Intrinsic::type_checked_load: {
200 auto *TypeMDVal = cast<MetadataAsValue>(CI->getArgOperand(2));
201 auto *TypeId = dyn_cast<MDString>(TypeMDVal->getMetadata());
202 if (!TypeId)
203 break;
204 GlobalValue::GUID Guid = GlobalValue::getGUID(TypeId->getString());
205
206 SmallVector<DevirtCallSite, 4> DevirtCalls;
207 SmallVector<Instruction *, 4> LoadedPtrs;
208 SmallVector<Instruction *, 4> Preds;
209 bool HasNonCallUses = false;
210 findDevirtualizableCallsForTypeCheckedLoad(DevirtCalls, LoadedPtrs, Preds,
Teresa Johnsonf24136f2018-09-27 14:55:32 +0000211 HasNonCallUses, CI, DT);
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000212 // Any non-call uses of the result of llvm.type.checked.load will
213 // prevent us from optimizing away the llvm.type.test.
214 if (HasNonCallUses)
215 TypeTests.insert(Guid);
216 for (auto &Call : DevirtCalls)
217 addVCallToSet(Call, Guid, TypeCheckedLoadVCalls,
218 TypeCheckedLoadConstVCalls);
219
220 break;
221 }
222 default:
223 break;
224 }
225}
226
Eugene Leviantbf46e742018-11-16 07:08:00 +0000227static bool isNonVolatileLoad(const Instruction *I) {
228 if (const auto *LI = dyn_cast<LoadInst>(I))
229 return !LI->isVolatile();
230
231 return false;
232}
233
234static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
235 const Function &F, BlockFrequencyInfo *BFI,
236 ProfileSummaryInfo *PSI, DominatorTree &DT,
237 bool HasLocalsInUsedOrAsm,
238 DenseSet<GlobalValue::GUID> &CantBePromoted,
239 bool IsThinLTO) {
Teresa Johnson02563cd2016-10-28 02:39:38 +0000240 // Summary not currently supported for anonymous functions, they should
241 // have been named.
242 assert(F.hasName());
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000243
244 unsigned NumInsts = 0;
245 // Map from callee ValueId to profile count. Used to accumulate profile
246 // counts for all static calls to a given callee.
Peter Collingbourne0c30f082016-12-20 21:12:28 +0000247 MapVector<ValueInfo, CalleeInfo> CallGraphEdges;
248 SetVector<ValueInfo> RefEdges;
Peter Collingbourne1b4137a72016-12-21 23:03:45 +0000249 SetVector<GlobalValue::GUID> TypeTests;
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000250 SetVector<FunctionSummary::VFuncId> TypeTestAssumeVCalls,
251 TypeCheckedLoadVCalls;
252 SetVector<FunctionSummary::ConstVCall> TypeTestAssumeConstVCalls,
253 TypeCheckedLoadConstVCalls;
Teresa Johnsoncd21a642016-07-17 14:47:01 +0000254 ICallPromotionAnalysis ICallAnalysis;
Peter Collingbourne681fbb62017-09-07 05:35:35 +0000255 SmallPtrSet<const User *, 8> Visited;
256
257 // Add personality function, prefix data and prologue data to function's ref
258 // list.
259 findRefEdges(Index, &F, RefEdges, Visited);
Eugene Leviantbf46e742018-11-16 07:08:00 +0000260 std::vector<const Instruction *> NonVolatileLoads;
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000261
Teresa Johnsond5033a42016-11-14 16:40:19 +0000262 bool HasInlineAsmMaybeReferencingInternal = false;
Benjamin Krameraa209152016-06-26 17:27:42 +0000263 for (const BasicBlock &BB : F)
264 for (const Instruction &I : BB) {
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000265 if (isa<DbgInfoIntrinsic>(I))
266 continue;
267 ++NumInsts;
Eugene Leviantbf46e742018-11-16 07:08:00 +0000268 if (isNonVolatileLoad(&I)) {
269 // Postpone processing of non-volatile load instructions
270 // See comments below
271 Visited.insert(&I);
272 NonVolatileLoads.push_back(&I);
273 continue;
274 }
Peter Collingbourne9667b912017-05-04 18:03:25 +0000275 findRefEdges(Index, &I, RefEdges, Visited);
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000276 auto CS = ImmutableCallSite(&I);
277 if (!CS)
278 continue;
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000279
280 const auto *CI = dyn_cast<CallInst>(&I);
281 // Since we don't know exactly which local values are referenced in inline
Teresa Johnsond5033a42016-11-14 16:40:19 +0000282 // assembly, conservatively mark the function as possibly referencing
283 // a local value from inline assembly to ensure we don't export a
284 // reference (which would require renaming and promotion of the
285 // referenced value).
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000286 if (HasLocalsInUsedOrAsm && CI && CI->isInlineAsm())
Teresa Johnsond5033a42016-11-14 16:40:19 +0000287 HasInlineAsmMaybeReferencingInternal = true;
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000288
Teresa Johnson897bab92016-10-08 16:11:42 +0000289 auto *CalledValue = CS.getCalledValue();
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000290 auto *CalledFunction = CS.getCalledFunction();
Volodymyr Sapsaia7396022017-11-10 00:47:47 +0000291 if (CalledValue && !CalledFunction) {
292 CalledValue = CalledValue->stripPointerCastsNoFollowAliases();
293 // Stripping pointer casts can reveal a called function.
294 CalledFunction = dyn_cast<Function>(CalledValue);
295 }
Teresa Johnson897bab92016-10-08 16:11:42 +0000296 // Check if this is an alias to a function. If so, get the
297 // called aliasee for the checks below.
298 if (auto *GA = dyn_cast<GlobalAlias>(CalledValue)) {
299 assert(!CalledFunction && "Expected null called function in callsite for alias");
300 CalledFunction = dyn_cast<Function>(GA->getBaseObject());
301 }
Peter Collingbourne1b4137a72016-12-21 23:03:45 +0000302 // Check if this is a direct call to a known function or a known
303 // intrinsic, or an indirect call with profile data.
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000304 if (CalledFunction) {
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000305 if (CI && CalledFunction->isIntrinsic()) {
306 addIntrinsicToSummary(
307 CI, TypeTests, TypeTestAssumeVCalls, TypeCheckedLoadVCalls,
Teresa Johnsonf24136f2018-09-27 14:55:32 +0000308 TypeTestAssumeConstVCalls, TypeCheckedLoadConstVCalls, DT);
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000309 continue;
Peter Collingbourne1b4137a72016-12-21 23:03:45 +0000310 }
Teresa Johnson02563cd2016-10-28 02:39:38 +0000311 // We should have named any anonymous globals
312 assert(CalledFunction->hasName());
Easwaran Ramanf5f91602017-05-09 23:21:10 +0000313 auto ScaledCount = PSI->getProfileCount(&I, BFI);
Peter Collingbourne0c30f082016-12-20 21:12:28 +0000314 auto Hotness = ScaledCount ? getHotness(ScaledCount.getValue(), PSI)
315 : CalleeInfo::HotnessType::Unknown;
Teresa Johnsondb83ace2018-03-31 00:18:08 +0000316 if (ForceSummaryEdgesCold != FunctionSummary::FSHT_None)
317 Hotness = CalleeInfo::HotnessType::Cold;
Peter Collingbourne0c30f082016-12-20 21:12:28 +0000318
Teresa Johnson897bab92016-10-08 16:11:42 +0000319 // Use the original CalledValue, in case it was an alias. We want
320 // to record the call edge to the alias in that case. Eventually
321 // an alias summary will be created to associate the alias and
322 // aliasee.
Easwaran Ramanc73cec82018-01-25 19:27:17 +0000323 auto &ValueInfo = CallGraphEdges[Index.getOrInsertValueInfo(
324 cast<GlobalValue>(CalledValue))];
325 ValueInfo.updateHotness(Hotness);
326 // Add the relative block frequency to CalleeInfo if there is no profile
327 // information.
328 if (BFI != nullptr && Hotness == CalleeInfo::HotnessType::Unknown) {
Easwaran Raman385d8ea2018-02-22 19:44:08 +0000329 uint64_t BBFreq = BFI->getBlockFreq(&BB).getFrequency();
330 uint64_t EntryFreq = BFI->getEntryFreq();
331 ValueInfo.updateRelBlockFreq(BBFreq, EntryFreq);
Easwaran Ramanc73cec82018-01-25 19:27:17 +0000332 }
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000333 } else {
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000334 // Skip inline assembly calls.
335 if (CI && CI->isInlineAsm())
336 continue;
Volodymyr Sapsai8b46ff12017-11-17 18:28:05 +0000337 // Skip direct calls.
338 if (!CalledValue || isa<Constant>(CalledValue))
339 continue;
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000340
Taewook Oh7646e772018-03-13 04:26:58 +0000341 // Check if the instruction has a callees metadata. If so, add callees
342 // to CallGraphEdges to reflect the references from the metadata, and
343 // to enable importing for subsequent indirect call promotion and
344 // inlining.
345 if (auto *MD = I.getMetadata(LLVMContext::MD_callees)) {
346 for (auto &Op : MD->operands()) {
347 Function *Callee = mdconst::extract_or_null<Function>(Op);
348 if (Callee)
349 CallGraphEdges[Index.getOrInsertValueInfo(Callee)];
350 }
351 }
352
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000353 uint32_t NumVals, NumCandidates;
354 uint64_t TotalCount;
355 auto CandidateProfileData =
356 ICallAnalysis.getPromotionCandidatesForInstruction(
357 &I, NumVals, TotalCount, NumCandidates);
358 for (auto &Candidate : CandidateProfileData)
Peter Collingbourne9667b912017-05-04 18:03:25 +0000359 CallGraphEdges[Index.getOrInsertValueInfo(Candidate.Value)]
360 .updateHotness(getHotness(Candidate.Count, PSI));
Piotr Padlewski442d38c2016-08-30 00:46:26 +0000361 }
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000362 }
363
Eugene Leviantbf46e742018-11-16 07:08:00 +0000364 // By now we processed all instructions in a function, except
365 // non-volatile loads. All new refs we add in a loop below
366 // are obviously constant. All constant refs are grouped in the
367 // end of RefEdges vector, so we can use a single integer value
368 // to identify them.
369 unsigned RefCnt = RefEdges.size();
370 for (const Instruction *I : NonVolatileLoads) {
371 Visited.erase(I);
372 findRefEdges(Index, I, RefEdges, Visited);
373 }
374 std::vector<ValueInfo> Refs = RefEdges.takeVector();
375 // Regular LTO module doesn't participate in ThinLTO import,
376 // so no reference from it can be readonly, since this would
377 // require importing variable as local copy
378 if (IsThinLTO)
379 for (; RefCnt < Refs.size(); ++RefCnt)
380 Refs[RefCnt].setReadOnly();
381
Dehao Chena60cdd32017-02-28 18:09:44 +0000382 // Explicit add hot edges to enforce importing for designated GUIDs for
383 // sample PGO, to enable the same inlines as the profiled optimized binary.
384 for (auto &I : F.getImportGUIDs())
Peter Collingbourne9667b912017-05-04 18:03:25 +0000385 CallGraphEdges[Index.getOrInsertValueInfo(I)].updateHotness(
Teresa Johnsondb83ace2018-03-31 00:18:08 +0000386 ForceSummaryEdgesCold == FunctionSummary::FSHT_All
387 ? CalleeInfo::HotnessType::Cold
388 : CalleeInfo::HotnessType::Critical);
Dehao Chena60cdd32017-02-28 18:09:44 +0000389
Teresa Johnson519465b2017-01-05 14:32:16 +0000390 bool NonRenamableLocal = isNonRenamableLocal(F);
391 bool NotEligibleForImport =
Teresa Johnsoncb397462018-11-06 19:41:35 +0000392 NonRenamableLocal || HasInlineAsmMaybeReferencingInternal;
Teresa Johnson6c475a72017-01-05 21:34:18 +0000393 GlobalValueSummary::GVFlags Flags(F.getLinkage(), NotEligibleForImport,
Sean Fertile4595a912017-11-04 17:04:39 +0000394 /* Live = */ false, F.isDSOLocal());
Charles Saternos75da10d2017-08-04 16:00:58 +0000395 FunctionSummary::FFlags FunFlags{
396 F.hasFnAttribute(Attribute::ReadNone),
397 F.hasFnAttribute(Attribute::ReadOnly),
Teresa Johnsoncb397462018-11-06 19:41:35 +0000398 F.hasFnAttribute(Attribute::NoRecurse), F.returnDoesNotAlias(),
Teresa Johnsoncb397462018-11-06 19:41:35 +0000399 // FIXME: refactor this to use the same code that inliner is using.
Teresa Johnson5b8ff372018-12-01 05:11:46 +0000400 // Don't try to import functions with noinline attribute.
401 F.getAttributes().hasFnAttribute(Attribute::NoInline)};
Peter Collingbourne0c30f082016-12-20 21:12:28 +0000402 auto FuncSummary = llvm::make_unique<FunctionSummary>(
Easwaran Raman5a7056f2018-12-13 19:54:27 +0000403 Flags, NumInsts, FunFlags, /*EntryCount=*/0, std::move(Refs),
404 CallGraphEdges.takeVector(), TypeTests.takeVector(),
405 TypeTestAssumeVCalls.takeVector(), TypeCheckedLoadVCalls.takeVector(),
Peter Collingbournebe9ffaa2017-02-10 22:29:38 +0000406 TypeTestAssumeConstVCalls.takeVector(),
407 TypeCheckedLoadConstVCalls.takeVector());
Teresa Johnson519465b2017-01-05 14:32:16 +0000408 if (NonRenamableLocal)
409 CantBePromoted.insert(F.getGUID());
Teresa Johnson7bea1aa2018-06-26 00:20:49 +0000410 Index.addGlobalValueSummary(F, std::move(FuncSummary));
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000411}
412
Teresa Johnson8d86f1b2019-01-17 16:05:04 +0000413static void
414computeVariableSummary(ModuleSummaryIndex &Index, const GlobalVariable &V,
415 DenseSet<GlobalValue::GUID> &CantBePromoted) {
Peter Collingbourne0c30f082016-12-20 21:12:28 +0000416 SetVector<ValueInfo> RefEdges;
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000417 SmallPtrSet<const User *, 8> Visited;
Eugene Levianteddf6b52018-10-12 07:24:02 +0000418 bool HasBlockAddress = findRefEdges(Index, &V, RefEdges, Visited);
Teresa Johnson519465b2017-01-05 14:32:16 +0000419 bool NonRenamableLocal = isNonRenamableLocal(V);
Teresa Johnson6c475a72017-01-05 21:34:18 +0000420 GlobalValueSummary::GVFlags Flags(V.getLinkage(), NonRenamableLocal,
Sean Fertile4595a912017-11-04 17:04:39 +0000421 /* Live = */ false, V.isDSOLocal());
Eugene Leviantbf46e742018-11-16 07:08:00 +0000422
423 // Don't mark variables we won't be able to internalize as read-only.
424 GlobalVarSummary::GVarFlags VarFlags(
425 !V.hasComdat() && !V.hasAppendingLinkage() && !V.isInterposable() &&
426 !V.hasAvailableExternallyLinkage() && !V.hasDLLExportStorageClass());
427 auto GVarSummary = llvm::make_unique<GlobalVarSummary>(Flags, VarFlags,
428 RefEdges.takeVector());
Teresa Johnson519465b2017-01-05 14:32:16 +0000429 if (NonRenamableLocal)
430 CantBePromoted.insert(V.getGUID());
Eugene Levianteddf6b52018-10-12 07:24:02 +0000431 if (HasBlockAddress)
432 GVarSummary->setNotEligibleToImport();
Teresa Johnson7bea1aa2018-06-26 00:20:49 +0000433 Index.addGlobalValueSummary(V, std::move(GVarSummary));
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000434}
435
Teresa Johnson519465b2017-01-05 14:32:16 +0000436static void
437computeAliasSummary(ModuleSummaryIndex &Index, const GlobalAlias &A,
Teresa Johnsone27b0582017-01-05 14:59:56 +0000438 DenseSet<GlobalValue::GUID> &CantBePromoted) {
Teresa Johnson519465b2017-01-05 14:32:16 +0000439 bool NonRenamableLocal = isNonRenamableLocal(A);
Teresa Johnson6c475a72017-01-05 21:34:18 +0000440 GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal,
Sean Fertile4595a912017-11-04 17:04:39 +0000441 /* Live = */ false, A.isDSOLocal());
Teresa Johnsoncbdc5ff2017-09-13 17:10:24 +0000442 auto AS = llvm::make_unique<AliasSummary>(Flags);
Teresa Johnson02563cd2016-10-28 02:39:38 +0000443 auto *Aliasee = A.getBaseObject();
Teresa Johnson70ec64c2019-03-15 15:11:38 +0000444 auto AliaseeVI = Index.getValueInfo(Aliasee->getGUID());
445 assert(AliaseeVI && "Alias expects aliasee summary to be available");
446 assert(AliaseeVI.getSummaryList().size() == 1 &&
447 "Expected a single entry per aliasee in per-module index");
448 AS->setAliasee(AliaseeVI, AliaseeVI.getSummaryList()[0].get());
Teresa Johnson519465b2017-01-05 14:32:16 +0000449 if (NonRenamableLocal)
450 CantBePromoted.insert(A.getGUID());
Teresa Johnson7bea1aa2018-06-26 00:20:49 +0000451 Index.addGlobalValueSummary(A, std::move(AS));
Teresa Johnson02563cd2016-10-28 02:39:38 +0000452}
453
Teresa Johnson6c475a72017-01-05 21:34:18 +0000454// Set LiveRoot flag on entries matching the given value name.
455static void setLiveRoot(ModuleSummaryIndex &Index, StringRef Name) {
Peter Collingbourne9667b912017-05-04 18:03:25 +0000456 if (ValueInfo VI = Index.getValueInfo(GlobalValue::getGUID(Name)))
457 for (auto &Summary : VI.getSummaryList())
Evgeniy Stepanov56584bb2017-06-01 20:30:06 +0000458 Summary->setLive(true);
Teresa Johnson6c475a72017-01-05 21:34:18 +0000459}
460
Chandler Carruthb7be5b62016-08-19 07:49:19 +0000461ModuleSummaryIndex llvm::buildModuleSummaryIndex(
462 const Module &M,
Piotr Padlewskid9830eb2016-09-26 20:37:32 +0000463 std::function<BlockFrequencyInfo *(const Function &F)> GetBFICallback,
464 ProfileSummaryInfo *PSI) {
Teresa Johnson94624ac2017-05-10 18:52:16 +0000465 assert(PSI);
Teresa Johnson290a8392019-01-11 18:31:57 +0000466 bool EnableSplitLTOUnit = false;
467 if (auto *MD = mdconst::extract_or_null<ConstantInt>(
468 M.getModuleFlag("EnableSplitLTOUnit")))
469 EnableSplitLTOUnit = MD->getZExtValue();
470 ModuleSummaryIndex Index(/*HaveGVs=*/true, EnableSplitLTOUnit);
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000471
Teresa Johnsona0811452016-11-10 16:57:32 +0000472 // Identify the local values in the llvm.used and llvm.compiler.used sets,
473 // which should not be exported as they would then require renaming and
474 // promotion, but we may have opaque uses e.g. in inline asm. We collect them
475 // here because we use this information to mark functions containing inline
476 // assembly calls as not importable.
Mehdi Aminib6a11a72016-11-09 01:45:13 +0000477 SmallPtrSet<GlobalValue *, 8> LocalsUsed;
Teresa Johnsona0811452016-11-10 16:57:32 +0000478 SmallPtrSet<GlobalValue *, 8> Used;
479 // First collect those in the llvm.used set.
480 collectUsedGlobalVariables(M, Used, /*CompilerUsed*/ false);
Teresa Johnsona0811452016-11-10 16:57:32 +0000481 // Next collect those in the llvm.compiler.used set.
482 collectUsedGlobalVariables(M, Used, /*CompilerUsed*/ true);
Teresa Johnsone27b0582017-01-05 14:59:56 +0000483 DenseSet<GlobalValue::GUID> CantBePromoted;
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000484 for (auto *V : Used) {
Teresa Johnson519465b2017-01-05 14:32:16 +0000485 if (V->hasLocalLinkage()) {
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000486 LocalsUsed.insert(V);
Teresa Johnson519465b2017-01-05 14:32:16 +0000487 CantBePromoted.insert(V->getGUID());
488 }
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000489 }
Teresa Johnsonb35cc692016-04-20 14:39:45 +0000490
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000491 bool HasLocalInlineAsmSymbol = false;
492 if (!M.getModuleInlineAsm().empty()) {
493 // Collect the local values defined by module level asm, and set up
494 // summaries for these symbols so that they can be marked as NoRename,
495 // to prevent export of any use of them in regular IR that would require
496 // renaming within the module level asm. Note we don't need to create a
497 // summary for weak or global defs, as they don't need to be flagged as
498 // NoRename, and defs in module level asm can't be imported anyway.
499 // Also, any values used but not defined within module level asm should
500 // be listed on the llvm.used or llvm.compiler.used global and marked as
501 // referenced from there.
502 ModuleSymbolTable::CollectAsmSymbols(
503 M, [&](StringRef Name, object::BasicSymbolRef::Flags Flags) {
504 // Symbols not marked as Weak or Global are local definitions.
505 if (Flags & (object::BasicSymbolRef::SF_Weak |
506 object::BasicSymbolRef::SF_Global))
507 return;
508 HasLocalInlineAsmSymbol = true;
509 GlobalValue *GV = M.getNamedValue(Name);
510 if (!GV)
511 return;
512 assert(GV->isDeclaration() && "Def in module asm already has definition");
513 GlobalValueSummary::GVFlags GVFlags(GlobalValue::InternalLinkage,
514 /* NotEligibleToImport = */ true,
Sean Fertile4595a912017-11-04 17:04:39 +0000515 /* Live = */ true,
516 /* Local */ GV->isDSOLocal());
Teresa Johnson7bea1aa2018-06-26 00:20:49 +0000517 CantBePromoted.insert(GV->getGUID());
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000518 // Create the appropriate summary type.
519 if (Function *F = dyn_cast<Function>(GV)) {
520 std::unique_ptr<FunctionSummary> Summary =
521 llvm::make_unique<FunctionSummary>(
Easwaran Raman5a7056f2018-12-13 19:54:27 +0000522 GVFlags, /*InstCount=*/0,
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000523 FunctionSummary::FFlags{
524 F->hasFnAttribute(Attribute::ReadNone),
525 F->hasFnAttribute(Attribute::ReadOnly),
526 F->hasFnAttribute(Attribute::NoRecurse),
Teresa Johnsoncb397462018-11-06 19:41:35 +0000527 F->returnDoesNotAlias(),
528 /* NoInline = */ false},
Easwaran Raman5a7056f2018-12-13 19:54:27 +0000529 /*EntryCount=*/0, ArrayRef<ValueInfo>{},
530 ArrayRef<FunctionSummary::EdgeTy>{},
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000531 ArrayRef<GlobalValue::GUID>{},
532 ArrayRef<FunctionSummary::VFuncId>{},
533 ArrayRef<FunctionSummary::VFuncId>{},
534 ArrayRef<FunctionSummary::ConstVCall>{},
535 ArrayRef<FunctionSummary::ConstVCall>{});
Teresa Johnson7bea1aa2018-06-26 00:20:49 +0000536 Index.addGlobalValueSummary(*GV, std::move(Summary));
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000537 } else {
538 std::unique_ptr<GlobalVarSummary> Summary =
Eugene Leviantbf46e742018-11-16 07:08:00 +0000539 llvm::make_unique<GlobalVarSummary>(
540 GVFlags, GlobalVarSummary::GVarFlags(),
541 ArrayRef<ValueInfo>{});
Teresa Johnson7bea1aa2018-06-26 00:20:49 +0000542 Index.addGlobalValueSummary(*GV, std::move(Summary));
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000543 }
544 });
545 }
546
Eugene Leviantbf46e742018-11-16 07:08:00 +0000547 bool IsThinLTO = true;
548 if (auto *MD =
549 mdconst::extract_or_null<ConstantInt>(M.getModuleFlag("ThinLTO")))
550 IsThinLTO = MD->getZExtValue();
551
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000552 // Compute summaries for all functions defined in module, and save in the
553 // index.
Chandler Carruthb7be5b62016-08-19 07:49:19 +0000554 for (auto &F : M) {
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000555 if (F.isDeclaration())
556 continue;
557
Teresa Johnsonf24136f2018-09-27 14:55:32 +0000558 DominatorTree DT(const_cast<Function &>(F));
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000559 BlockFrequencyInfo *BFI = nullptr;
560 std::unique_ptr<BlockFrequencyInfo> BFIPtr;
Chandler Carruthb7be5b62016-08-19 07:49:19 +0000561 if (GetBFICallback)
562 BFI = GetBFICallback(F);
Easwaran Ramana17f2202017-12-22 01:33:52 +0000563 else if (F.hasProfileData()) {
Teresa Johnsonf24136f2018-09-27 14:55:32 +0000564 LoopInfo LI{DT};
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000565 BranchProbabilityInfo BPI{F, LI};
566 BFIPtr = llvm::make_unique<BlockFrequencyInfo>(F, BPI, LI);
567 BFI = BFIPtr.get();
568 }
569
Teresa Johnsonf24136f2018-09-27 14:55:32 +0000570 computeFunctionSummary(Index, M, F, BFI, PSI, DT,
Peter Collingbourne5e8b94c12017-09-01 16:24:02 +0000571 !LocalsUsed.empty() || HasLocalInlineAsmSymbol,
Eugene Leviantbf46e742018-11-16 07:08:00 +0000572 CantBePromoted, IsThinLTO);
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000573 }
574
575 // Compute summaries for all variables defined in module, and save in the
576 // index.
Chandler Carruthb7be5b62016-08-19 07:49:19 +0000577 for (const GlobalVariable &G : M.globals()) {
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000578 if (G.isDeclaration())
579 continue;
Teresa Johnson8d86f1b2019-01-17 16:05:04 +0000580 computeVariableSummary(Index, G, CantBePromoted);
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000581 }
Teresa Johnson02563cd2016-10-28 02:39:38 +0000582
583 // Compute summaries for all aliases defined in module, and save in the
584 // index.
585 for (const GlobalAlias &A : M.aliases())
Teresa Johnson519465b2017-01-05 14:32:16 +0000586 computeAliasSummary(Index, A, CantBePromoted);
Teresa Johnson02563cd2016-10-28 02:39:38 +0000587
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000588 for (auto *V : LocalsUsed) {
589 auto *Summary = Index.getGlobalValueSummary(*V);
590 assert(Summary && "Missing summary for global value");
Teresa Johnson519465b2017-01-05 14:32:16 +0000591 Summary->setNotEligibleToImport();
Teresa Johnsonbf28c8f2016-10-30 05:40:44 +0000592 }
593
Teresa Johnson6c475a72017-01-05 21:34:18 +0000594 // The linker doesn't know about these LLVM produced values, so we need
595 // to flag them as live in the index to ensure index-based dead value
596 // analysis treats them as live roots of the analysis.
597 setLiveRoot(Index, "llvm.used");
598 setLiveRoot(Index, "llvm.compiler.used");
599 setLiveRoot(Index, "llvm.global_ctors");
600 setLiveRoot(Index, "llvm.global_dtors");
601 setLiveRoot(Index, "llvm.global.annotations");
602
Teresa Johnson519465b2017-01-05 14:32:16 +0000603 for (auto &GlobalList : Index) {
Peter Collingbourne9667b912017-05-04 18:03:25 +0000604 // Ignore entries for references that are undefined in the current module.
605 if (GlobalList.second.SummaryList.empty())
606 continue;
607
608 assert(GlobalList.second.SummaryList.size() == 1 &&
Teresa Johnson519465b2017-01-05 14:32:16 +0000609 "Expected module's index to have one summary per GUID");
Peter Collingbourne9667b912017-05-04 18:03:25 +0000610 auto &Summary = GlobalList.second.SummaryList[0];
Peter Collingbournee357fbd2017-06-08 23:01:49 +0000611 if (!IsThinLTO) {
612 Summary->setNotEligibleToImport();
613 continue;
614 }
615
Teresa Johnson519465b2017-01-05 14:32:16 +0000616 bool AllRefsCanBeExternallyReferenced =
617 llvm::all_of(Summary->refs(), [&](const ValueInfo &VI) {
Peter Collingbourne9667b912017-05-04 18:03:25 +0000618 return !CantBePromoted.count(VI.getGUID());
Teresa Johnson519465b2017-01-05 14:32:16 +0000619 });
620 if (!AllRefsCanBeExternallyReferenced) {
621 Summary->setNotEligibleToImport();
622 continue;
623 }
624
625 if (auto *FuncSummary = dyn_cast<FunctionSummary>(Summary.get())) {
626 bool AllCallsCanBeExternallyReferenced = llvm::all_of(
627 FuncSummary->calls(), [&](const FunctionSummary::EdgeTy &Edge) {
Peter Collingbourne9667b912017-05-04 18:03:25 +0000628 return !CantBePromoted.count(Edge.first.getGUID());
Teresa Johnson519465b2017-01-05 14:32:16 +0000629 });
630 if (!AllCallsCanBeExternallyReferenced)
631 Summary->setNotEligibleToImport();
632 }
633 }
634
Teresa Johnson2f616e42019-01-28 23:43:26 +0000635 if (!ModuleSummaryDotFile.empty()) {
636 std::error_code EC;
637 raw_fd_ostream OSDot(ModuleSummaryDotFile, EC, sys::fs::OpenFlags::F_None);
638 if (EC)
639 report_fatal_error(Twine("Failed to open dot file ") +
640 ModuleSummaryDotFile + ": " + EC.message() + "\n");
641 Index.exportToDot(OSDot);
642 }
643
Chandler Carruthb7be5b62016-08-19 07:49:19 +0000644 return Index;
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000645}
646
Chandler Carruthdab4eae2016-11-23 17:53:26 +0000647AnalysisKey ModuleSummaryIndexAnalysis::Key;
Teresa Johnsonf93b2462016-08-12 13:53:02 +0000648
Chandler Carruthb7be5b62016-08-19 07:49:19 +0000649ModuleSummaryIndex
Teresa Johnsonf93b2462016-08-12 13:53:02 +0000650ModuleSummaryIndexAnalysis::run(Module &M, ModuleAnalysisManager &AM) {
Piotr Padlewskid9830eb2016-09-26 20:37:32 +0000651 ProfileSummaryInfo &PSI = AM.getResult<ProfileSummaryAnalysis>(M);
Teresa Johnsonf93b2462016-08-12 13:53:02 +0000652 auto &FAM = AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
Piotr Padlewskid9830eb2016-09-26 20:37:32 +0000653 return buildModuleSummaryIndex(
654 M,
655 [&FAM](const Function &F) {
656 return &FAM.getResult<BlockFrequencyAnalysis>(
657 *const_cast<Function *>(&F));
658 },
659 &PSI);
Teresa Johnsonf93b2462016-08-12 13:53:02 +0000660}
661
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000662char ModuleSummaryIndexWrapperPass::ID = 0;
Eugene Zelenkobb1b2d02017-08-16 22:07:40 +0000663
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000664INITIALIZE_PASS_BEGIN(ModuleSummaryIndexWrapperPass, "module-summary-analysis",
665 "Module Summary Analysis", false, true)
666INITIALIZE_PASS_DEPENDENCY(BlockFrequencyInfoWrapperPass)
Mehdi Amini89029482017-01-21 06:01:22 +0000667INITIALIZE_PASS_DEPENDENCY(ProfileSummaryInfoWrapperPass)
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000668INITIALIZE_PASS_END(ModuleSummaryIndexWrapperPass, "module-summary-analysis",
669 "Module Summary Analysis", false, true)
670
671ModulePass *llvm::createModuleSummaryIndexWrapperPass() {
672 return new ModuleSummaryIndexWrapperPass();
673}
674
675ModuleSummaryIndexWrapperPass::ModuleSummaryIndexWrapperPass()
676 : ModulePass(ID) {
677 initializeModuleSummaryIndexWrapperPassPass(*PassRegistry::getPassRegistry());
678}
679
680bool ModuleSummaryIndexWrapperPass::runOnModule(Module &M) {
Vedant Kumare7b789b2018-11-19 05:23:16 +0000681 auto *PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
Teresa Johnson51905532018-06-26 02:29:08 +0000682 Index.emplace(buildModuleSummaryIndex(
Piotr Padlewskid9830eb2016-09-26 20:37:32 +0000683 M,
684 [this](const Function &F) {
685 return &(this->getAnalysis<BlockFrequencyInfoWrapperPass>(
686 *const_cast<Function *>(&F))
687 .getBFI());
688 },
Vedant Kumare7b789b2018-11-19 05:23:16 +0000689 PSI));
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000690 return false;
691}
692
693bool ModuleSummaryIndexWrapperPass::doFinalization(Module &M) {
Chandler Carruthb7be5b62016-08-19 07:49:19 +0000694 Index.reset();
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000695 return false;
696}
697
698void ModuleSummaryIndexWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
699 AU.setPreservesAll();
700 AU.addRequired<BlockFrequencyInfoWrapperPass>();
Piotr Padlewskid9830eb2016-09-26 20:37:32 +0000701 AU.addRequired<ProfileSummaryInfoWrapperPass>();
Teresa Johnson2d5487c2016-04-11 13:58:45 +0000702}