summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/IPConstantPropagation.cpp
Commit message (Collapse)AuthorAge
* 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
* Use a CallSite to find the nth argument of a call/invoke instruction instead ofMatthijs Kooijman2008-06-19
| | | | | | | | using getOperand() directly. This makes things work with invoke instructions as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52489 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r52397 (make IPConstProp promote returned arguments), but fixed thisMatthijs Kooijman2008-06-18
| | | | | | | | | time. Sorry for the trouble! This time, also add a testcase, which I should have done in the first place... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52455 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r52396, it was unrelated to the breakage (that was caused by r52397, myMatthijs Kooijman2008-06-18
| | | | | | | commit after this). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52453 91177308-0d34-0410-b5e6-96231b3b80d8
* revert recent patch which is causing widespread breakage.Chris Lattner2008-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52415 91177308-0d34-0410-b5e6-96231b3b80d8
* Learn IPConstProp to propagate arguments that are directly returned. StrictlyMatthijs Kooijman2008-06-17
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52397 91177308-0d34-0410-b5e6-96231b3b80d8
* Learn IPConstProp to look at individual return values and propagate themMatthijs Kooijman2008-06-17
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52396 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2411, where ip constant prop would propagate theChris Lattner2008-06-09
| | | | | | | result of a weak function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52137 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-13
| | | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify code for propagation of constant arguments into Chris Lattner2008-04-23
| | | | | | | callees. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50142 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,Chris Lattner2008-04-23
| | | | | | | fix read after free bug (PR2238). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50141 91177308-0d34-0410-b5e6-96231b3b80d8
* Incorporate feedback.Devang Patel2008-03-20
| | | | | | | | | | - Fix loop nest. - Use RetVals.size() - Check for null return value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48605 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle multiple ret values.Devang Patel2008-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48254 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Transforms to be 4.3 warnings-cleanAnton Korobeynikov2008-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47371 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in comment.Nick Lewycky2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-02
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes inReid Spencer2007-02-05
| | | | | | | | the Transforms library. This reduces debug library size by 132 KB, debug binary size by 376 KB, and reduces link time for llvm tools slightly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-30
| | | | | | | confusion with external linkage types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate static ctors due to Statistic objectsChris Lattner2006-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32693 91177308-0d34-0410-b5e6-96231b3b80d8
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-06
| | | | | | | is 'unsigned'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-15
| | | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
* Only cound if we actually made a change.Chris Lattner2004-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18800 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove note to selfChris Lattner2004-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17734 91177308-0d34-0410-b5e6-96231b3b80d8
* If a function always returns a constant, replace all calls sites with thatChris Lattner2004-11-14
| | | | | | | | | | | | constant value. This makes the return value dead and allows for simplification in the caller. This implements IPConstantProp/return-constant.ll This triggers several dozen times throughout SPEC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17730 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually, leave the check in. This prevents us from counting dead argumentsChris Lattner2004-11-11
| | | | | | | as IPCP opportunities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17680 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: IPConstantProp/deadarg.llChris Lattner2004-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17679 91177308-0d34-0410-b5e6-96231b3b80d8
* Make IP Constant prop more aggressive about handling self recursive calls.Chris Lattner2004-11-10
| | | | | | | This implements IPConstantProp/recursion.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17666 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not let dead constant expressions hanging off of functions prevent IPCP.Chris Lattner2004-11-09
| | | | | | | | This allows to elimination of a bunch of global pool descriptor args from programs being pool allocated (and is also generally useful!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17657 91177308-0d34-0410-b5e6-96231b3b80d8
* 'Pass' should now not be derived from by clients. Instead, they should deriveChris Lattner2004-09-20
| | | | | | | | from ModulePass. Instead of implementing Pass::run, then should implement ModulePass::runOnModule. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-01
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid an unnecessary isa<Constant>.Reid Spencer2004-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14963 91177308-0d34-0410-b5e6-96231b3b80d8
* bug 122:Reid Spencer2004-07-18
| | | | | | | - Minimize redundant isa<GlobalValue> usage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14948 91177308-0d34-0410-b5e6-96231b3b80d8
* Finegrainify namespacificationChris Lattner2003-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10138 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagating constants to arguments can make other arguments constant. For nowChris Lattner2003-10-27
| | | | | | | do something dumb, and inefficient, but more complete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9542 91177308-0d34-0410-b5e6-96231b3b80d8
* We might as well strip off any CPRs before propagationChris Lattner2003-10-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9437 91177308-0d34-0410-b5e6-96231b3b80d8
* Check in initial version of ipcpChris Lattner2003-10-23
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9423 91177308-0d34-0410-b5e6-96231b3b80d8