summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* Restore DeadArgElim back to 52570. It's breaking 447.dealII.Evan Cheng2008-06-251-527/+374
| | | | llvm-svn: 52736
* Pacify gcc-4.3.Duncan Sands2008-06-251-1/+1
| | | | llvm-svn: 52723
* Fix a (false) warning on darwin.Matthijs Kooijman2008-06-251-1/+3
| | | | llvm-svn: 52705
* Fix some cosmetics in comments.Matthijs Kooijman2008-06-251-6/+6
| | | | llvm-svn: 52704
* Commit the new DeadArgElim pass again, this time with the gcc bootstrap ↵Matthijs Kooijman2008-06-241-374/+525
| | | | | | | | failures fixed. Also add a testcase to reproduce the gcc bootstrap failure in very much reduced form. llvm-svn: 52677
* Rename a few variables to be more consistent.Matthijs Kooijman2008-06-241-3/+3
| | | | llvm-svn: 52672
* Use Instruction::eraseFromParent().Dan Gohman2008-06-212-4/+4
| | | | llvm-svn: 52606
* Back out Matthijs' DAE patches. It's miscompiling gcc driver.Evan Cheng2008-06-211-518/+367
| | | | llvm-svn: 52570
* 80 column and trailing whitespace fixes.Matthijs Kooijman2008-06-201-49/+72
| | | | llvm-svn: 52539
* Don't let DeadArgumentElimination attempt to update callers when the returnMatthijs Kooijman2008-06-201-9/+12
| | | | | | type wasn't changed. llvm-svn: 52538
* Don't let DeadArgElimination change the return type ({} into void and {T}Matthijs Kooijman2008-06-201-7/+13
| | | | | | into T) when no return values are actually dead. llvm-svn: 52537
* Explicitely track if any arguments or return values were removed inMatthijs Kooijman2008-06-201-1/+10
| | | | | | | | DeadArgumentElimination and assert that the function type does not change if nothing was changed. This should catch subtle changes in function type that are not intended. llvm-svn: 52536
* Remove debug output.Matthijs Kooijman2008-06-201-4/+0
| | | | llvm-svn: 52535
* Recommit r52459, rewriting of the dead argument elimination pass.Matthijs Kooijman2008-06-201-369/+483
| | | | | | | | | | | | This is a fixed version that no longer uses multimap::equal_range, which resulted in a pointer invalidation problem. Also, DAE::InspectedFunctions was not really necessary, so it got removed. Lastly, this version no longer applies the extra arg hack on functions who did not have any arguments to start with. llvm-svn: 52532
* Use the common API for adding instructions to basic blocks instead ofDan Gohman2008-06-191-11/+6
| | | | | | using BasicBlock::getInstList. llvm-svn: 52500
* Use a CallSite to find the nth argument of a call/invoke instruction instead ofMatthijs Kooijman2008-06-191-11/+11
| | | | | | | using getOperand() directly. This makes things work with invoke instructions as well. llvm-svn: 52489
* Revert r52459, which was causing an infinite loop or massive slowdown on ↵Owen Anderson2008-06-181-469/+369
| | | | | | | | MultiSource/Applications/SPASS, and possibly others as well. Please reapply once this is fixed. llvm-svn: 52465
* Rewrite the DeadArgumentElimination pass, to use a more explicit tracking ofMatthijs Kooijman2008-06-181-369/+469
| | | | | | | | | | | | | dependencies between return values and/or arguments. Also make the handling of arguments and return values the same. The pass now looks properly inside returned structs, but only at the first level (ie, not inside nested structs). Also add a testcase for testing various variations of (multiple) dead rerturn values. llvm-svn: 52459
* Reapply r52397 (make IPConstProp promote returned arguments), but fixed thisMatthijs Kooijman2008-06-181-3/+18
| | | | | | | | time. Sorry for the trouble! This time, also add a testcase, which I should have done in the first place... llvm-svn: 52455
* Reapply r52396, it was unrelated to the breakage (that was caused by r52397, myMatthijs Kooijman2008-06-181-53/+76
| | | | | | commit after this). llvm-svn: 52453
* revert recent patch which is causing widespread breakage.Chris Lattner2008-06-171-85/+53
| | | | llvm-svn: 52415
* Learn IPConstProp to propagate arguments that are directly returned. StrictlyMatthijs Kooijman2008-06-171-2/+11
| | | | | | | | speaking these are not constant values. However, when a function always returns one of its arguments, then from the point of view of each caller the return value is constant (or at least a known value) and can be replaced. llvm-svn: 52397
* Learn IPConstProp to look at individual return values and propagate themMatthijs Kooijman2008-06-171-53/+76
| | | | | | | | | | | individually. Also learn IPConstProp how returning first class aggregates work, in addition to old style multiple return instructions. Modify the return-constants testscase to confirm this behaviour. llvm-svn: 52396
* Fix PR2411, where ip constant prop would propagate theChris Lattner2008-06-091-0/+5
| | | | | | result of a weak function. llvm-svn: 52137
* Let StructRetPromotion check if all if its users are really calls or invokesn,Matthijs Kooijman2008-06-051-0/+4
| | | | | | not other instructions. This fixes a crash with the added testcase. llvm-svn: 51992
* Let StructRetPromotion check if it's users are really calling it and notMatthijs Kooijman2008-06-051-0/+4
| | | | | | passing its pointer. Fixes test with added testcase. llvm-svn: 51991
* Use use_iterator::getOperandNo instead of CallSite::hasArgument to check if aMatthijs Kooijman2008-06-051-7/+6
| | | | | | | function is passed as an argument instead of called. Also do this check a bit earlier. llvm-svn: 51990
* Replace two manual loops with calls to CallSite::hasArguments (no functional ↵Matthijs Kooijman2008-06-041-7/+5
| | | | | | changes). llvm-svn: 51947
* Use eraseFromParent() instead of doing that manually in two places.Matthijs Kooijman2008-05-301-2/+2
| | | | llvm-svn: 51770
* convert more operand loops to iterator formulationGabor Greif2008-05-292-23/+29
| | | | llvm-svn: 51663
* Fix some constructs that gcc-4.4 warns about.Duncan Sands2008-05-271-1/+2
| | | | llvm-svn: 51591
* Factor code to copy global value attributes likeDuncan Sands2008-05-264-16/+6
| | | | | | | | | | | | | | | the section or the visibility from one global value to another: copyAttributesFrom. This is particularly useful for duplicating functions: previously this was done by explicitly copying each attribute in turn at each place where a new function was created out of an old one, with the result that obscure attributes were regularly forgotten (like the collector or the section). Hopefully now everything is uniform and nothing is forgotten. llvm-svn: 51567
* Indent fix.Matthijs Kooijman2008-05-231-2/+2
| | | | llvm-svn: 51477
* Use isSingleValueType instead of isFirstClassType toDan Gohman2008-05-232-5/+5
| | | | | | exclude struct and array types. llvm-svn: 51459
* Use isSingleValueType instead of isFirstClassType toDan Gohman2008-05-231-1/+1
| | | | | | exclude struct and array types. llvm-svn: 51456
* Less conservative verison of previous patch,Dale Johannesen2008-05-161-2/+2
| | | | | | suggested by Duncan. llvm-svn: 51211
* Weak functions not declared non-throwing might beDale Johannesen2008-05-161-1/+3
| | | | | | | | | replaced at linktime with a body that throws, even if the body in this file does not. Make PruneEH be more conservative in this case. g++.dg/eh/weak1.C llvm-svn: 51207
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-163-4/+4
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) llvm-svn: 51200
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-1/+2
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Simplify internalize pass. Add test case.Devang Patel2008-05-141-19/+21
| | | | | | Patch by Matthijs Kooijman! llvm-svn: 51114
* 80 col / tabs fixesNate Begeman2008-05-131-4/+5
| | | | llvm-svn: 51021
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-1318-83/+100
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Fix a type and formatting.Duncan Sands2008-05-091-2/+2
| | | | llvm-svn: 50900
* Improve pass documentation and comments.Gordon Henriksen2008-05-082-4/+15
| | | | | | Patch by Matthijs Kooijman! llvm-svn: 50861
* Check linkage.Devang Patel2008-05-081-1/+1
| | | | llvm-svn: 50851
* Make several variable declarations static.Dan Gohman2008-05-063-4/+4
| | | | llvm-svn: 50696
* Delete the IPO simplify-libcalls and completely reimplement it asChris Lattner2008-05-011-2214/+0
| | | | | | | | a FunctionPass. This makes it simpler, fixes dozens of bugs, adds a couple of minor features, and shrinks is considerably: from 2214 to 1437 lines. llvm-svn: 50520
* use string length computation to generalize several xforms.Chris Lattner2008-04-301-36/+39
| | | | llvm-svn: 50464
* Implement more aggressive support for analyzing string length. ThisChris Lattner2008-04-291-10/+136
| | | | | | | | | | generalizes the previous code to handle the case when the string is not an immediate to the strlen call (for example, crazy stuff like strlen(c ? "foo" : "bart"+1) -> 3). This implements gcc.c-torture/execute/builtins/strlen-2.c. I will generalize other cases in simplifylibcalls to use the same routine later. llvm-svn: 50408
* When SRoA'ing a global variable, make sure the new globals get the Chris Lattner2008-04-261-5/+32
| | | | | | | | | appropriate alignment. This fixes a miscompilation of 252.eon on x86-64 (rdar://5891920). Bill, please pull this into Tak. llvm-svn: 50308
OpenPOWER on IntegriCloud