summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SCCP.cpp
Commit message (Collapse)AuthorAgeFilesLines
* For PR950:Reid Spencer2006-12-231-0/+88
| | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
* handle undef values much more carefully: generalize the resolveundefbranchesChris Lattner2006-12-201-32/+172
| | | | | | | | code to handle instructions as well, so that we properly fold things like X & undef -> 0. This fixes Transforms/SCCP/2006-12-19-UndefBug.ll llvm-svn: 32715
* Switch over Transforms/Scalar to use the STATISTIC macro. For each statisticChris Lattner2006-12-191-10/+10
| | | | | | | converted, we lose a static initializer. This also allows GCC to emit warnings about unused statistics. llvm-svn: 32690
* Change inferred getCast into specific getCast. Passes all tests.Reid Spencer2006-12-121-1/+2
| | | | llvm-svn: 32469
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-071-3/+3
| | | | | | now cerr, cout, and NullStream resp. llvm-svn: 32298
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-6/+6
| | | | | | is 'unsigned'. llvm-svn: 32279
* SCCP does not handle Packed Type properly. Disable Packed Type handlingDevang Patel2006-12-041-1/+17
| | | | | | for now. llvm-svn: 32208
* Removed #include <iostream> and replaced with llvm_* streams.Bill Wendling2006-11-261-23/+22
| | | | llvm-svn: 31923
* For PR786:Reid Spencer2006-11-021-2/+2
| | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. llvm-svn: 31380
* Handle fallout from the recent branch-on-undef changes. This fixesChris Lattner2006-10-231-1/+24
| | | | | | Prolangs-C/agrep and SCCP/2006-10-23-IPSCCP-Crash.ll llvm-svn: 31132
* 3 Changes:Chris Lattner2006-10-221-24/+35
| | | | | | | | | | 1. Better document what is going on here. 2. Only hack on one branch per iteration, making the results less conservative. 3. Handle the problematic case by marking edges executable instead of by playing with value lattice states. This is far less pessimistic, and fixes SCCP/ipsccp-gvar.ll. llvm-svn: 31106
* Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cppChris Lattner2006-10-201-2/+3
| | | | llvm-svn: 31073
* Eliminate ConstantBool::True and ConstantBool::False. Instead, provideChris Lattner2006-09-281-9/+6
| | | | | | ConstantBool::getTrue() and ConstantBool::getFalse(). llvm-svn: 30665
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-2/+2
| | | | llvm-svn: 29925
* Add supprot for shufflevectorChris Lattner2006-04-081-0/+25
| | | | llvm-svn: 27513
* Implement some more interesting select sccp cases. This implements:Chris Lattner2006-02-081-15/+35
| | | | | | test/Regression/Transforms/SCCP/select.ll llvm-svn: 26049
* Make iostream #inclusion explicitChris Lattner2006-01-221-0/+1
| | | | llvm-svn: 25514
* Lowerpacked and SCCP support for the insertelement operation.Robert Bocchino2006-01-171-0/+21
| | | | llvm-svn: 25406
* Added lower packed support for the extractelement operation.Robert Bocchino2006-01-101-0/+12
| | | | llvm-svn: 25180
* Eliminate GetGEPGlobalInitializer in favor of the more powerfulChris Lattner2005-09-261-27/+1
| | | | | | ConstantFoldLoadThroughGEPConstantExpr function in the utils lib. llvm-svn: 23446
* Eliminate tabs and trailing spacesJeff Cohen2005-04-231-8/+8
| | | | llvm-svn: 21480
* Remove trailing whitespaceMisha Brukman2005-04-211-34/+34
| | | | llvm-svn: 21427
* Wrap some long lines.Chris Lattner2005-04-191-3/+9
| | | | | | | | Make IPSCCP strip off dead constant exprs that are using functions, making them appear as though their address is taken. This allows us to propagate some more pool descriptors, lowering the overhead of pool alloc. llvm-svn: 21363
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-151-5/+5
| | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! llvm-svn: 20597
* Silence warningsChris Lattner2005-01-081-2/+2
| | | | llvm-svn: 19379
* If one side of and/or is known to be 0/-1, it doesn't matterChris Lattner2004-12-111-0/+37
| | | | | | | | if the other side is overdefined. This allows us to fold conditions like: if (X < Y || Y > Z) in some cases. llvm-svn: 18807
* Two bug fixes:Chris Lattner2004-12-111-17/+27
| | | | | | | | | | | | | | | | | 1. Actually increment the Statistic for the GV elim optzn 2. When resolving undef branches, only resolve branches in executable blocks, avoiding marking a bunch of completely dead blocks live. This has a big impact on the quality of the generated code. With this patch, we positively rip up vortex, compiling Ut_MoveBytes to a single memcpy call. In vortex we get this: 12 ipsccp - Number of globals found to be constant 986 ipsccp - Number of arguments constant propagated 1378 ipsccp - Number of basic blocks unreachable 8919 ipsccp - Number of instructions removed llvm-svn: 18796
* Do not delete the entry block to a function.Chris Lattner2004-12-111-1/+5
| | | | llvm-svn: 18795
* Implement Transforms/SCCP/ipsccp-gvar.ll, by tracking values stored toChris Lattner2004-12-111-12/+85
| | | | | | non-address-taken global variables. llvm-svn: 18790
* Fix a bug where we could delete dead invoke instructions with uses.Chris Lattner2004-12-111-0/+26
| | | | | | | In functions where we fully constant prop the return value, replace all ret instructions with 'ret undef'. llvm-svn: 18786
* Implement SCCP/ipsccp-conditional.ll, by totally deleting dead blocks.Chris Lattner2004-12-101-2/+29
| | | | llvm-svn: 18781
* Fix SCCP/2004-12-10-UndefBranchBug.llChris Lattner2004-12-101-3/+51
| | | | llvm-svn: 18776
* This is the initial implementation of IPSCCP, as requested by Brian.Chris Lattner2004-12-101-63/+273
| | | | | | | | | This implements SCCP/ipsccp-basic.ll, rips apart Olden/mst (as described in PR415), and does other nice things. There is still more to come with this, but it's a start. llvm-svn: 18752
* Do not delete dead invoke instructions!Chris Lattner2004-11-161-2/+1
| | | | llvm-svn: 17897
* Minor cleanups. There is no reason for SCCP to derive from instvisitor anymore.Chris Lattner2004-11-151-21/+14
| | | | llvm-svn: 17825
* Count more accuratelyChris Lattner2004-11-151-0/+4
| | | | llvm-svn: 17824
* Two minor improvements:Chris Lattner2004-11-151-13/+37
| | | | | | | | | | | 1. Speedup getValueState by having it not consider Arguments. It's better to just add them before we start SCCP'ing. 2. SCCP can delete the contents of dead blocks. No really, it's ok! This reduces the size of the IR for subsequent passes, even though simplifycfg would do the same job. In practice, simplifycfg does not run until much later than sccp in gccas llvm-svn: 17820
* rename InstValue to LatticeValue, as it holds for more than instructions.Chris Lattner2004-11-151-35/+37
| | | | llvm-svn: 17818
* Substantially refactor the SCCP class into an SCCP pass and an SCCPSolverChris Lattner2004-11-151-167/+208
| | | | | | | | | | | | class. The only changes are minor: * Do not try to SCCP instructions that return void in the rewrite loop. This is silly and fool hardy, wasting a map lookup and adding an entry to the map which is never used. * If we decide something has an undefined value, rewrite it to undef, potentially leading to further simplications. llvm-svn: 17816
* Convert 'struct' to 'class' in various places to adhere to the coding standardsChris Lattner2004-10-271-1/+1
| | | | | | and work better with VC++. Patch contributed by Morten Ofstad! llvm-svn: 17281
* Handle undef values as undefined on the constant latticeChris Lattner2004-10-161-3/+6
| | | | | | ignore unreachable instructions llvm-svn: 17044
* Use DEBUG instead of DebugFlag directly, as DebugFlag does not respectChris Lattner2004-10-091-5/+3
| | | | | | -debug-only! llvm-svn: 16868
* Prototype these functions more accuratelyChris Lattner2004-09-201-1/+1
| | | | llvm-svn: 16432
* Convert code to compile with vc7.1.Reid Spencer2004-09-151-2/+3
| | | | | | Patch contributed by Paolo Invernizzi. Thanks Paolo! llvm-svn: 16368
* Changes For Bug 352Reid Spencer2004-09-011-4/+4
| | | | | | | | 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/. llvm-svn: 16137
* Stop using getValues().Alkis Evlogimenos2004-08-041-4/+4
| | | | llvm-svn: 15487
* Delete a redundant if branch.Reid Spencer2004-07-181-4/+1
| | | | llvm-svn: 14967
* bug 122:Reid Spencer2004-07-181-16/+11
| | | | | | | - Replace ConstantPointerRef usage with GlobalValue usage - Correct isa<Constant> for GlobalValue subclass llvm-svn: 14947
* This patch was contributed by Daniel Berlin!Chris Lattner2004-07-151-14/+48
| | | | | | | Speed up SCCP substantially by processing overdefined values quickly. This patch speeds up SCCP by about 30-40% on large testcases. llvm-svn: 14861
* Fixes working towards PR341Chris Lattner2004-07-151-3/+3
| | | | llvm-svn: 14839
OpenPOWER on IntegriCloud