Lines Matching refs:F
101 void AddOpt(LibFunc::Func F, LibCallOptimization* Opt);
105 bool runOnFunction(Function &F);
107 void setDoesNotAccessMemory(Function &F);
108 void setOnlyReadsMemory(Function &F);
109 void setDoesNotThrow(Function &F);
110 void setDoesNotCapture(Function &F, unsigned n);
111 void setDoesNotAlias(Function &F, unsigned n);
114 void inferPrototypeAttributes(Function &F);
134 void SimplifyLibCalls::AddOpt(LibFunc::Func F, LibCallOptimization* Opt) { in AddOpt() argument
135 if (TLI->has(F)) in AddOpt()
136 Optimizations[TLI->getName(F)] = Opt; in AddOpt()
153 bool SimplifyLibCalls::runOnFunction(Function &F) { in runOnFunction() argument
161 IRBuilder<> Builder(F.getContext()); in runOnFunction()
164 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { in runOnFunction()
213 void SimplifyLibCalls::setDoesNotAccessMemory(Function &F) { in setDoesNotAccessMemory() argument
214 if (!F.doesNotAccessMemory()) { in setDoesNotAccessMemory()
215 F.setDoesNotAccessMemory(); in setDoesNotAccessMemory()
220 void SimplifyLibCalls::setOnlyReadsMemory(Function &F) { in setOnlyReadsMemory() argument
221 if (!F.onlyReadsMemory()) { in setOnlyReadsMemory()
222 F.setOnlyReadsMemory(); in setOnlyReadsMemory()
227 void SimplifyLibCalls::setDoesNotThrow(Function &F) { in setDoesNotThrow() argument
228 if (!F.doesNotThrow()) { in setDoesNotThrow()
229 F.setDoesNotThrow(); in setDoesNotThrow()
234 void SimplifyLibCalls::setDoesNotCapture(Function &F, unsigned n) { in setDoesNotCapture() argument
235 if (!F.doesNotCapture(n)) { in setDoesNotCapture()
236 F.setDoesNotCapture(n); in setDoesNotCapture()
241 void SimplifyLibCalls::setDoesNotAlias(Function &F, unsigned n) { in setDoesNotAlias() argument
242 if (!F.doesNotAlias(n)) { in setDoesNotAlias()
243 F.setDoesNotAlias(n); in setDoesNotAlias()
250 void SimplifyLibCalls::inferPrototypeAttributes(Function &F) { in inferPrototypeAttributes() argument
251 FunctionType *FTy = F.getFunctionType(); in inferPrototypeAttributes()
253 StringRef Name = F.getName(); in inferPrototypeAttributes()
259 setOnlyReadsMemory(F); in inferPrototypeAttributes()
260 setDoesNotThrow(F); in inferPrototypeAttributes()
261 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
268 setOnlyReadsMemory(F); in inferPrototypeAttributes()
269 setDoesNotThrow(F); in inferPrototypeAttributes()
286 setDoesNotThrow(F); in inferPrototypeAttributes()
287 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
293 setDoesNotThrow(F); in inferPrototypeAttributes()
294 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
295 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
307 setOnlyReadsMemory(F); in inferPrototypeAttributes()
308 setDoesNotThrow(F); in inferPrototypeAttributes()
309 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
310 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
315 setOnlyReadsMemory(F); in inferPrototypeAttributes()
316 setDoesNotThrow(F); in inferPrototypeAttributes()
317 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
322 setDoesNotThrow(F); in inferPrototypeAttributes()
323 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
329 setDoesNotThrow(F); in inferPrototypeAttributes()
330 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
336 setDoesNotThrow(F); in inferPrototypeAttributes()
337 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
338 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
347 setDoesNotThrow(F); in inferPrototypeAttributes()
348 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
349 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
355 setDoesNotThrow(F); in inferPrototypeAttributes()
356 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
357 setDoesNotCapture(F, 3); in inferPrototypeAttributes()
363 setDoesNotThrow(F); in inferPrototypeAttributes()
364 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
365 setDoesNotCapture(F, 3); in inferPrototypeAttributes()
371 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
379 setDoesNotThrow(F); in inferPrototypeAttributes()
380 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
386 setOnlyReadsMemory(F); in inferPrototypeAttributes()
387 setDoesNotThrow(F); in inferPrototypeAttributes()
388 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
389 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
394 setOnlyReadsMemory(F); in inferPrototypeAttributes()
395 setDoesNotThrow(F); in inferPrototypeAttributes()
405 setDoesNotThrow(F); in inferPrototypeAttributes()
406 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
410 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
416 setDoesNotThrow(F); in inferPrototypeAttributes()
417 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
426 setDoesNotThrow(F); in inferPrototypeAttributes()
427 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
428 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
434 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
442 setDoesNotThrow(F); in inferPrototypeAttributes()
443 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
450 setDoesNotThrow(F); in inferPrototypeAttributes()
451 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
452 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
460 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
469 setDoesNotThrow(F); in inferPrototypeAttributes()
470 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
471 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
477 setDoesNotThrow(F); in inferPrototypeAttributes()
478 setOnlyReadsMemory(F); in inferPrototypeAttributes()
479 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
480 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
484 setDoesNotThrow(F); in inferPrototypeAttributes()
485 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
493 setDoesNotThrow(F); in inferPrototypeAttributes()
494 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
502 setDoesNotThrow(F); in inferPrototypeAttributes()
503 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
513 setDoesNotThrow(F); in inferPrototypeAttributes()
514 setOnlyReadsMemory(F); in inferPrototypeAttributes()
515 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
519 setDoesNotThrow(F); in inferPrototypeAttributes()
520 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
530 setDoesNotThrow(F); in inferPrototypeAttributes()
531 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
532 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
533 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
539 setDoesNotThrow(F); in inferPrototypeAttributes()
540 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
541 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
558 setDoesNotThrow(F); in inferPrototypeAttributes()
559 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
563 setDoesNotThrow(F); in inferPrototypeAttributes()
564 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
565 setOnlyReadsMemory(F); in inferPrototypeAttributes()
574 setDoesNotThrow(F); in inferPrototypeAttributes()
575 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
581 setDoesNotThrow(F); in inferPrototypeAttributes()
582 setDoesNotCapture(F, 3); in inferPrototypeAttributes()
589 setDoesNotThrow(F); in inferPrototypeAttributes()
590 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
591 setDoesNotCapture(F, 4); in inferPrototypeAttributes()
600 setDoesNotThrow(F); in inferPrototypeAttributes()
601 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
602 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
611 setDoesNotThrow(F); in inferPrototypeAttributes()
612 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
616 setDoesNotThrow(F); in inferPrototypeAttributes()
617 setOnlyReadsMemory(F); in inferPrototypeAttributes()
618 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
621 setDoesNotThrow(F); in inferPrototypeAttributes()
625 setDoesNotThrow(F); in inferPrototypeAttributes()
626 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
630 setDoesNotThrow(F); in inferPrototypeAttributes()
631 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
638 setDoesNotThrow(F); in inferPrototypeAttributes()
639 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
645 setDoesNotThrow(F); in inferPrototypeAttributes()
646 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
653 setDoesNotThrow(F); in inferPrototypeAttributes()
654 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
655 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
662 setDoesNotThrow(F); in inferPrototypeAttributes()
663 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
669 setDoesNotThrow(F); in inferPrototypeAttributes()
670 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
676 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
678 setDoesNotThrow(F); in inferPrototypeAttributes()
685 setDoesNotThrow(F); in inferPrototypeAttributes()
686 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
687 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
688 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
692 setDoesNotThrow(F); in inferPrototypeAttributes()
693 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
700 setDoesNotThrow(F); in inferPrototypeAttributes()
701 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
708 setDoesNotThrow(F); in inferPrototypeAttributes()
709 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
710 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
714 setDoesNotThrow(F); in inferPrototypeAttributes()
715 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
719 setDoesNotThrow(F); in inferPrototypeAttributes()
720 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
727 setDoesNotThrow(F); in inferPrototypeAttributes()
728 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
729 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
735 setDoesNotThrow(F); in inferPrototypeAttributes()
736 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
737 setDoesNotCapture(F, 3); in inferPrototypeAttributes()
745 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
751 setDoesNotThrow(F); in inferPrototypeAttributes()
752 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
753 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
760 setDoesNotThrow(F); in inferPrototypeAttributes()
761 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
765 setDoesNotThrow(F); in inferPrototypeAttributes()
766 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
772 setDoesNotThrow(F); in inferPrototypeAttributes()
773 setDoesNotAccessMemory(F); in inferPrototypeAttributes()
779 setDoesNotThrow(F); in inferPrototypeAttributes()
780 setDoesNotAccessMemory(F); in inferPrototypeAttributes()
789 setDoesNotThrow(F); in inferPrototypeAttributes()
790 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
791 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
795 setDoesNotThrow(F); in inferPrototypeAttributes()
796 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
804 setDoesNotCapture(F, 4); in inferPrototypeAttributes()
814 setDoesNotThrow(F); in inferPrototypeAttributes()
815 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
816 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
821 setDoesNotThrow(F); in inferPrototypeAttributes()
822 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
826 setDoesNotThrow(F); in inferPrototypeAttributes()
827 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
831 setDoesNotThrow(F); in inferPrototypeAttributes()
832 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
840 setDoesNotThrow(F); in inferPrototypeAttributes()
841 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
850 setDoesNotThrow(F); in inferPrototypeAttributes()
851 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
852 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
859 setDoesNotThrow(F); in inferPrototypeAttributes()
860 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
861 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
862 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
867 setDoesNotThrow(F); in inferPrototypeAttributes()
868 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
872 setDoesNotThrow(F); in inferPrototypeAttributes()
873 setDoesNotAlias(F, 0); in inferPrototypeAttributes()
878 setDoesNotThrow(F); in inferPrototypeAttributes()
879 setDoesNotCapture(F, 2); in inferPrototypeAttributes()
884 setDoesNotCapture(F, 1); in inferPrototypeAttributes()
895 Function &F = *I; in doInitialization() local
896 if (F.isDeclaration() && F.hasName()) in doInitialization()
897 inferPrototypeAttributes(F); in doInitialization()