Lines Matching refs:F
46 static bool setDoesNotAccessMemory(Function &F) { in setDoesNotAccessMemory() argument
47 if (F.doesNotAccessMemory()) in setDoesNotAccessMemory()
49 F.setDoesNotAccessMemory(); in setDoesNotAccessMemory()
54 static bool setOnlyReadsMemory(Function &F) { in setOnlyReadsMemory() argument
55 if (F.onlyReadsMemory()) in setOnlyReadsMemory()
57 F.setOnlyReadsMemory(); in setOnlyReadsMemory()
62 static bool setOnlyAccessesArgMemory(Function &F) { in setOnlyAccessesArgMemory() argument
63 if (F.onlyAccessesArgMemory()) in setOnlyAccessesArgMemory()
65 F.setOnlyAccessesArgMemory(); in setOnlyAccessesArgMemory()
70 static bool setDoesNotThrow(Function &F) { in setDoesNotThrow() argument
71 if (F.doesNotThrow()) in setDoesNotThrow()
73 F.setDoesNotThrow(); in setDoesNotThrow()
78 static bool setRetDoesNotAlias(Function &F) { in setRetDoesNotAlias() argument
79 if (F.hasAttribute(AttributeList::ReturnIndex, Attribute::NoAlias)) in setRetDoesNotAlias()
81 F.addAttribute(AttributeList::ReturnIndex, Attribute::NoAlias); in setRetDoesNotAlias()
86 static bool setDoesNotCapture(Function &F, unsigned ArgNo) { in setDoesNotCapture() argument
87 if (F.hasParamAttribute(ArgNo, Attribute::NoCapture)) in setDoesNotCapture()
89 F.addParamAttr(ArgNo, Attribute::NoCapture); in setDoesNotCapture()
94 static bool setDoesNotAlias(Function &F, unsigned ArgNo) { in setDoesNotAlias() argument
95 if (F.hasParamAttribute(ArgNo, Attribute::NoAlias)) in setDoesNotAlias()
97 F.addParamAttr(ArgNo, Attribute::NoAlias); in setDoesNotAlias()
102 static bool setOnlyReadsMemory(Function &F, unsigned ArgNo) { in setOnlyReadsMemory() argument
103 if (F.hasParamAttribute(ArgNo, Attribute::ReadOnly)) in setOnlyReadsMemory()
105 F.addParamAttr(ArgNo, Attribute::ReadOnly); in setOnlyReadsMemory()
110 static bool setOnlyWritesMemory(Function &F, unsigned ArgNo) { in setOnlyWritesMemory() argument
111 if (F.hasParamAttribute(ArgNo, Attribute::WriteOnly)) in setOnlyWritesMemory()
113 F.addParamAttr(ArgNo, Attribute::WriteOnly); in setOnlyWritesMemory()
118 static bool setSignExtendedArg(Function &F, unsigned ArgNo) { in setSignExtendedArg() argument
119 if (F.hasParamAttribute(ArgNo, Attribute::SExt)) in setSignExtendedArg()
121 F.addParamAttr(ArgNo, Attribute::SExt); in setSignExtendedArg()
126 static bool setRetNoUndef(Function &F) { in setRetNoUndef() argument
127 if (!F.getReturnType()->isVoidTy() && in setRetNoUndef()
128 !F.hasAttribute(AttributeList::ReturnIndex, Attribute::NoUndef)) { in setRetNoUndef()
129 F.addAttribute(AttributeList::ReturnIndex, Attribute::NoUndef); in setRetNoUndef()
136 static bool setArgsNoUndef(Function &F) { in setArgsNoUndef() argument
138 for (unsigned ArgNo = 0; ArgNo < F.arg_size(); ++ArgNo) { in setArgsNoUndef()
139 if (!F.hasParamAttribute(ArgNo, Attribute::NoUndef)) { in setArgsNoUndef()
140 F.addParamAttr(ArgNo, Attribute::NoUndef); in setArgsNoUndef()
148 static bool setRetAndArgsNoUndef(Function &F) { in setRetAndArgsNoUndef() argument
149 return setRetNoUndef(F) | setArgsNoUndef(F); in setRetAndArgsNoUndef()
152 static bool setRetNonNull(Function &F) { in setRetNonNull() argument
153 assert(F.getReturnType()->isPointerTy() && in setRetNonNull()
155 if (F.hasAttribute(AttributeList::ReturnIndex, Attribute::NonNull)) in setRetNonNull()
157 F.addAttribute(AttributeList::ReturnIndex, Attribute::NonNull); in setRetNonNull()
162 static bool setReturnedArg(Function &F, unsigned ArgNo) { in setReturnedArg() argument
163 if (F.hasParamAttribute(ArgNo, Attribute::Returned)) in setReturnedArg()
165 F.addParamAttr(ArgNo, Attribute::Returned); in setReturnedArg()
170 static bool setNonLazyBind(Function &F) { in setNonLazyBind() argument
171 if (F.hasFnAttribute(Attribute::NonLazyBind)) in setNonLazyBind()
173 F.addFnAttr(Attribute::NonLazyBind); in setNonLazyBind()
177 static bool setDoesNotFreeMemory(Function &F) { in setDoesNotFreeMemory() argument
178 if (F.hasFnAttribute(Attribute::NoFree)) in setDoesNotFreeMemory()
180 F.addFnAttr(Attribute::NoFree); in setDoesNotFreeMemory()
186 Function *F = M->getFunction(Name); in inferLibFuncAttributes() local
187 if (!F) in inferLibFuncAttributes()
189 return inferLibFuncAttributes(*F, TLI); in inferLibFuncAttributes()
192 bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) { in inferLibFuncAttributes() argument
194 if (!(TLI.getLibFunc(F, TheLibFunc) && TLI.has(TheLibFunc))) in inferLibFuncAttributes()
199 if(!isLibFreeFunction(&F, TheLibFunc) && !isReallocLikeFn(&F, &TLI)) in inferLibFuncAttributes()
200 Changed |= setDoesNotFreeMemory(F); in inferLibFuncAttributes()
202 if (F.getParent() != nullptr && F.getParent()->getRtLibUseGOT()) in inferLibFuncAttributes()
203 Changed |= setNonLazyBind(F); in inferLibFuncAttributes()
208 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
209 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
210 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
211 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
215 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
216 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
217 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
226 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
227 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
228 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
234 Changed |= setReturnedArg(F, 0); in inferLibFuncAttributes()
238 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
239 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
240 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
241 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
242 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
243 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
244 Changed |= setDoesNotAlias(F, 1); in inferLibFuncAttributes()
247 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
248 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
249 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
250 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
256 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
257 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
258 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
259 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
260 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
267 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
268 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
269 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
270 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
274 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
275 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
276 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
277 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
281 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
282 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
283 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
286 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
287 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
288 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
289 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
293 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
294 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
295 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
299 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
300 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
301 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
302 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
306 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
307 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
308 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
309 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
310 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
313 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
314 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
315 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
316 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
317 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
318 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
321 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
322 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
323 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
324 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
325 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
326 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
327 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
330 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
331 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
332 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
333 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
334 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
335 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
336 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
339 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
340 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
341 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
342 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
343 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
347 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
348 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
349 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
352 Changed |= setRetNoUndef(F); in inferLibFuncAttributes()
353 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
354 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
357 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
358 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
359 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
360 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
361 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
365 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
366 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
367 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
372 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
373 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
376 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
377 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
378 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
379 Changed |= setReturnedArg(F, 0); in inferLibFuncAttributes()
380 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
381 Changed |= setDoesNotAlias(F, 1); in inferLibFuncAttributes()
382 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
383 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
386 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
387 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
388 Changed |= setReturnedArg(F, 0); in inferLibFuncAttributes()
389 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
390 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
391 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
395 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
396 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
397 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
398 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
399 Changed |= setDoesNotAlias(F, 1); in inferLibFuncAttributes()
400 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
401 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
404 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
407 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
410 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
411 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
412 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
413 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
416 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
417 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
418 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
421 Changed |= setRetNoUndef(F); in inferLibFuncAttributes()
422 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
423 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
424 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
427 Changed |= setRetNoUndef(F); in inferLibFuncAttributes()
431 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
432 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
435 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
436 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
437 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
442 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
443 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
444 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
445 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
448 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
449 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
450 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
451 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
452 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
453 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
456 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
457 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
458 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
459 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
460 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
464 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
465 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
466 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
469 Changed |= setRetNoUndef(F); in inferLibFuncAttributes()
470 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
471 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
474 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
475 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
476 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
477 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
478 Changed |= setOnlyWritesMemory(F, 1); in inferLibFuncAttributes()
479 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
482 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
483 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
484 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
485 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
486 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
489 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
490 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
491 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
492 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
495 Changed |= setRetNoUndef(F); in inferLibFuncAttributes()
496 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
497 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
501 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
502 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
503 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
504 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
509 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
510 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
511 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
517 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
518 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
519 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
522 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
523 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
524 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
525 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
528 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
529 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
530 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
531 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
532 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
533 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
534 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
537 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
538 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
539 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
540 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
541 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
544 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
545 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
546 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
549 Changed |= setArgsNoUndef(F); in inferLibFuncAttributes()
550 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
551 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
566 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
567 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
568 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
571 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
572 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
573 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
574 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
579 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
580 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
581 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
586 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
587 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
590 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
591 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
592 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
596 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
597 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
598 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
602 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
603 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
604 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
605 Changed |= setDoesNotCapture(F, 3); in inferLibFuncAttributes()
609 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
610 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
611 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
612 Changed |= setDoesNotCapture(F, 3); in inferLibFuncAttributes()
617 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
618 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
619 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
620 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
621 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
625 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
626 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
627 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
628 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
629 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
632 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
633 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
634 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
635 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
638 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
639 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
640 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
643 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
644 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
645 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
648 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
649 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
650 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
653 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
654 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
655 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
656 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
661 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
662 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
665 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
666 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
667 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
670 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
671 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
672 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
673 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
676 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
677 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
678 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
681 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
682 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
683 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
686 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
687 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
688 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
689 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
692 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
693 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
694 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
695 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
699 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
700 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
701 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
702 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
703 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
704 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
708 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
709 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
710 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
715 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
716 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
717 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
718 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
722 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
723 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
727 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
728 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
729 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
733 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
734 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
737 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
738 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
739 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
740 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
741 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
742 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
743 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
746 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
747 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
748 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
751 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
752 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
753 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
754 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
757 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
758 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
759 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
760 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
761 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
762 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
765 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
766 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
767 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
768 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
769 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
772 Changed |= setRetNoUndef(F); in inferLibFuncAttributes()
773 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
774 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
777 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
778 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
779 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
780 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
784 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
785 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
786 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
787 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
788 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
791 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
792 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
793 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
794 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
795 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
799 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
800 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
801 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
804 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
805 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
806 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
807 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
808 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
811 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
812 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
813 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
816 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
817 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
818 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
824 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
825 Changed |= setDoesNotAccessMemory(F); in inferLibFuncAttributes()
828 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
829 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
830 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
831 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
832 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
835 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
836 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
837 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
838 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
843 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
844 Changed |= setDoesNotCapture(F, 3); in inferLibFuncAttributes()
848 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
849 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
850 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
851 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
854 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
855 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
856 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
859 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
860 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
861 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
864 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
865 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
866 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
869 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
870 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
871 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
872 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
877 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
878 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
879 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
880 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
881 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
884 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
885 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
886 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
887 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
888 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
889 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
892 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
893 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
894 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
895 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
896 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
897 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
898 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
902 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
903 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
904 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
907 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
908 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
909 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
913 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
914 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
915 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
919 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
920 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
921 Changed |= setOnlyReadsMemory(F, 0); in inferLibFuncAttributes()
927 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
928 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
929 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
930 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
941 Changed |= setRetNoUndef(F); in inferLibFuncAttributes()
942 Changed |= setRetNonNull(F); in inferLibFuncAttributes()
943 Changed |= setRetDoesNotAlias(F); in inferLibFuncAttributes()
949 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
950 Changed |= setDoesNotCapture(F, 0); in inferLibFuncAttributes()
951 Changed |= setOnlyWritesMemory(F, 0); in inferLibFuncAttributes()
952 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
953 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
957 Changed |= setRetAndArgsNoUndef(F); in inferLibFuncAttributes()
958 Changed |= setDoesNotAccessMemory(F); in inferLibFuncAttributes()
959 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
964 Changed |= setSignExtendedArg(F, 1); in inferLibFuncAttributes()
1026 if (const Function *F = in emitLibCall() local
1028 CI->setCallingConv(F->getCallingConv()); in emitLibCall()
1108 if (const Function *F = in emitMemCpyChk() local
1110 CI->setCallingConv(F->getCallingConv()); in emitMemCpyChk()
1252 if (const Function *F = in emitUnaryFloatFnCallHelper() local
1254 CI->setCallingConv(F->getCallingConv()); in emitUnaryFloatFnCallHelper()
1297 if (const Function *F = in emitBinaryFloatFnCallHelper() local
1299 CI->setCallingConv(F->getCallingConv()); in emitBinaryFloatFnCallHelper()
1344 if (const Function *F = in emitPutChar() local
1346 CI->setCallingConv(F->getCallingConv()); in emitPutChar()
1361 if (const Function *F = in emitPutS() local
1363 CI->setCallingConv(F->getCallingConv()); in emitPutS()
1374 FunctionCallee F = M->getOrInsertFunction(FPutcName, B.getInt32Ty(), in emitFPutC() local
1380 CallInst *CI = B.CreateCall(F, {Char, File}, FPutcName); in emitFPutC()
1383 dyn_cast<Function>(F.getCallee()->stripPointerCasts())) in emitFPutC()
1395 FunctionCallee F = M->getOrInsertFunction(FPutsName, B.getInt32Ty(), in emitFPutS() local
1399 CallInst *CI = B.CreateCall(F, {castToCStr(Str, B), File}, FPutsName); in emitFPutS()
1402 dyn_cast<Function>(F.getCallee()->stripPointerCasts())) in emitFPutS()
1415 FunctionCallee F = M->getOrInsertFunction( in emitFWrite() local
1422 B.CreateCall(F, {castToCStr(Ptr, B), Size, in emitFWrite()
1426 dyn_cast<Function>(F.getCallee()->stripPointerCasts())) in emitFWrite()
1444 if (const Function *F = in emitMalloc() local
1446 CI->setCallingConv(F->getCallingConv()); in emitMalloc()
1465 if (const auto *F = in emitCalloc() local
1467 CI->setCallingConv(F->getCallingConv()); in emitCalloc()