summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
Commit message (Collapse)AuthorAge
* Initial support for the CMake build system.Oscar Fuentes2008-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement review feedback from Devang: make useDuncan Sands2008-09-20
| | | | | | | of mayReadFromMemory and mayWriteToMemory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56387 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new pass AddReadAttrs which works out which functionsDuncan Sands2008-09-19
| | | | | | | | | | can get the readnone/readonly attributes, and gives them it. The plan is to remove markmodref (which did the same thing by querying GlobalsModRef) and delete the analogous functionality from GlobalsModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56341 91177308-0d34-0410-b5e6-96231b3b80d8
* Make safer variant of alias resolution routine to be defaultAnton Korobeynikov2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56005 91177308-0d34-0410-b5e6-96231b3b80d8
* Resolve aliases, when possibleAnton Korobeynikov2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56001 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the callgraph correctly.Duncan Sands2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55896 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the callgraph correctly in ArgumentPromotion.Duncan Sands2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55895 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply 55859. This doesn't change anything asDuncan Sands2008-09-08
| | | | | | | | long as the callgraph is correct. It checks for wrong callgraphs more strictly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55894 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct a comment and strip trailing whitespace.Duncan Sands2008-09-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55883 91177308-0d34-0410-b5e6-96231b3b80d8
* fix crash when the malloc/free function is defined or is a declaration with ↵Nuno Lopes2008-09-06
| | | | | | | | 0 parameters. this pass doesnt seem to be used, but still it's now a little more correct git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55873 91177308-0d34-0410-b5e6-96231b3b80d8
* When PruneEH turned an invoke into an ordinaryDuncan Sands2008-09-06
| | | | | | | | | | | | | call (thus changing the call site) it didn't inform the callgraph about this. But the call site does matter - as shown by the testcase, the callgraph become invalid after the inliner ran (with an edge between two functions simply missing), resulting in wrong deductions by GlobalsModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55872 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r55859. This is breaking the build in the abscence of its companion ↵Owen Anderson2008-09-05
| | | | | | commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete the removeCallEdgeTo callgraph method,Duncan Sands2008-09-05
| | | | | | | | | | | | | | | | because it does not maintain a correct list of callsites. I discovered (see following commit) that the inliner will create a wrong callgraph if it is fed a callgraph with correct edges but incorrect callsites. These were created by Prune-EH, and while it wasn't done via removeCallEdgeTo, it could have been done via removeCallEdgeTo, which is an accident waiting to happen. Use removeCallEdgeFor instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55859 91177308-0d34-0410-b5e6-96231b3b80d8
* Use removeAllCalledFunctions rather than removingDuncan Sands2008-09-05
| | | | | | | edges one by one by hand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55836 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this pass return that it made a change ifDuncan Sands2008-09-05
| | | | | | | it modifies a functions attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55831 91177308-0d34-0410-b5e6-96231b3b80d8
* try to seperate the mechanism into something others can useAndrew Lenharth2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55785 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* cleanup as per Duncan's reviewAndrew Lenharth2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55766 91177308-0d34-0410-b5e6-96231b3b80d8
* Update inline threshold for current function if the notes say, optimize for ↵Devang Patel2008-09-03
| | | | | | size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55745 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial version of a Partial Specialization IPO pass. It triggers a couple ↵Andrew Lenharth2008-09-03
| | | | | | hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55734 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in a comment.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55720 91177308-0d34-0410-b5e6-96231b3b80d8
* Add parentheses to make code more readable.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55717 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comments.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55716 91177308-0d34-0410-b5e6-96231b3b80d8
* Add custom inliner that handles only functions that are marked as always_inline.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55713 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle "always inline" note during inline cost analysis.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55712 91177308-0d34-0410-b5e6-96231b3b80d8
* Check noinline note and ignore other notes.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55711 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle "noinline" note inside the simple inliner.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55708 91177308-0d34-0410-b5e6-96231b3b80d8
* s/FP_AlwaysInline/FN_NOTE_AlwaysInline/gDevang Patel2008-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55676 91177308-0d34-0410-b5e6-96231b3b80d8
* respect inline=never and inline=always notes.Devang Patel2008-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55673 91177308-0d34-0410-b5e6-96231b3b80d8
* Use empty() instead of begin() == end().Dan Gohman2008-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54780 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace two for loops with while(!X->use_empty()) loops. This preventsMatthijs Kooijman2008-08-14
| | | | | | | | | | invalidating the iterator by deleting the current use. This fixes a segfault on 64 bit linux reported in PR2675. Also remove an unneeded if. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54778 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs.Bill Wendling2008-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54707 91177308-0d34-0410-b5e6-96231b3b80d8
* Let SRETPromotion properly preserve the function name instead of (implicitly)Matthijs Kooijman2008-08-07
| | | | | | | postfixing it with a number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54468 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SRETPromotion, it was generating functions without returns statements sinceMatthijs Kooijman2008-08-07
| | | | | | | | r53941 (but this was not noticed due to the lack of a basic test for SRETPromotion). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54467 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some debug output to SRETPromotion.Matthijs Kooijman2008-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54464 91177308-0d34-0410-b5e6-96231b3b80d8
* Restructure ArgumentPromotion a bit. Instead of just having a single booleanMatthijs Kooijman2008-07-29
| | | | | | | | | | | | | | | that says "unconditional loads from this argument are safe", we now keep track of the safety per set of indices from which loads happen. This prevents ArgPromotion from promoting loads that aren't really valid. As an added effect, this will now disregard the the type of the indices passed to a GEP, so "load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument, not two. This fixes PR2598, for which a testcase has been added as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54159 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable first-class aggregates support.Dan Gohman2008-07-23
| | | | | | | | | | | | | Remove the GetResultInst instruction. It is still accepted in LLVM assembly and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove support for return instructions with multiple values. These are auto-upgraded to use InsertValueInst instructions. The IRBuilder still accepts multiple-value returns, and auto-upgrades them to InsertValueInst instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.Matthijs Kooijman2008-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53716 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow deadargelim to change return types even though now values were dead. ThisMatthijs Kooijman2008-07-15
| | | | | | | again canonicalizes {i32} into i32 and {} into void. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53610 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r53606. It turns out that explicitely tracking the liveness of theMatthijs Kooijman2008-07-15
| | | | | | | | | | | | return value as a whole in deadargelim is really not needed now that we simply rebuild the old return value and actually prevents some canonicalization from taking place. This revert stops deadargelim from changing {i32} into i32 for now, but I'll fix that next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53609 91177308-0d34-0410-b5e6-96231b3b80d8
* Make deadargelim a bit less smart, so it doesn't choke on nested structs asMatthijs Kooijman2008-07-15
| | | | | | | | | | | | | return values that are still (partially) live. Instead of updating all uses of a call instruction after removing some elements, it now just rebuilds the original struct (With undef gaps where the unused values were) and leaves it to instcombine to clean this up. The added testcase still fails currently, but this is due to instcombine which isn't good enough yet. I will fix that part next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53608 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use isa when we can reuse a previous dyn_cast.Matthijs Kooijman2008-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53607 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DeadArgElim keep liveness of the return value as a whole in addition toMatthijs Kooijman2008-07-15
| | | | | | | | | | | | only the liveness of partial return values (for functions returning a struct). This is more explicit to prevent unwanted changes in the return value. In particular, deadargelim now canonicalizes a function returning {i32} to returning i32 and {} to void, if the struct returned is not used in its entirety, but only the single element is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53606 91177308-0d34-0410-b5e6-96231b3b80d8
* Let DAE keep a list of live functions, instead of simply marking all argumentsMatthijs Kooijman2008-07-15
| | | | | | | | and return values live for those functions. This doesn't change anything yet, but prepares for the coming commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53601 91177308-0d34-0410-b5e6-96231b3b80d8
* Split DAE::MarkLive into MarkLive and PropagateLiveness.Matthijs Kooijman2008-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53600 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass around const RetOrArg references instead of copying values. Also, markMatthijs Kooijman2008-07-15
| | | | | | | RetOrArg::getDescription() as const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53599 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify debug code by using RetOrArg::getDescription().Matthijs Kooijman2008-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53598 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix indentation (intentionally left out of the previous commit).Matthijs Kooijman2008-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53592 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the deadargelim code for intrinsically alive functions into its ownMatthijs Kooijman2008-07-15
| | | | | | | method, to slightly simplify control flow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53591 91177308-0d34-0410-b5e6-96231b3b80d8
* Use find instead of lower_bound.Dan Gohman2008-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8