Lines Matching defs:M
109 static inline void clearModule(Module &M) { // TODO: simplify.
110 while (!M.functions().empty())
111 eraseFromModule(*M.begin());
112 while (!M.globals().empty())
113 eraseFromModule(*M.globals().begin());
114 while (!M.aliases().empty())
115 eraseFromModule(*M.aliases().begin());
116 while (!M.ifuncs().empty())
117 eraseFromModule(*M.ifuncs().begin());
120 static inline void maybeHandleGlobals(Module &M) {
121 unsigned GlobAS = M.getDataLayout().getDefaultGlobalsAddressSpace();
122 for (auto &&G : M.globals()) { // TODO: should we handle these in the FE?
124 return clearModule(M);
143 const SmallPtrSet<const Function *, N>& Reachable, Module &M) {
144 removeFromUsedLists(M, [&](Constant *C) {
152 copy_if(M, std::back_inserter(ToRemove), [&](auto &&F) {
192 HipStdParAcceleratorCodeSelectionPass::run(Module &M,
194 auto &CGA = MAM.getResult<CallGraphAnalysis>(M);
227 clearModule(M);
229 removeUnreachableFunctions(Reachable, M);
231 maybeHandleGlobals(M);
278 HipStdParAllocationInterpositionPass::run(Module &M, ModuleAnalysisManager&) {
282 for (auto &&F : M) {
288 if (auto R = M.getFunction(AllocReplacements[F.getName()])) {
304 if (auto F = M.getFunction("__hipstdpar_hidden_free")) {
305 auto LibcFree = M.getOrInsertFunction("__libc_free", F->getFunctionType(),