summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SCCP.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add SCCP support for constant folding calls, implementing:Chris Lattner2004-04-131-1/+33
| | | | | | test/Regression/Transforms/SCCP/calltest.ll llvm-svn: 12921
* Support getelementptr instructions which use uint's to index into structureChris Lattner2004-04-051-1/+1
| | | | | | | types and can have arbitrary 32- and 64-bit integer types indexing into sequential types. llvm-svn: 12653
* Do not try to optimize PHI nodes with incredibly high degree. This reduces SCCPChris Lattner2004-03-161-0/+7
| | | | | | | time from 615s to 1.49s on a large testcase that has a gigantic switch statement that all of the blocks in the function go to (an intepreter). llvm-svn: 12442
* Add sccp support for select instructionsChris Lattner2004-03-121-0/+23
| | | | llvm-svn: 12318
* Since 'load null' is undefined, we can make it do whatever we want. ReturningChris Lattner2004-03-071-0/+6
| | | | | | a zero value is the most likely way to cause further simplification, so we do it. llvm-svn: 12197
* Adjustments to support the new ConstantAggregateZero classChris Lattner2004-02-151-3/+5
| | | | llvm-svn: 11474
* Don't use ConstantExpr::getShift anymoreChris Lattner2004-01-121-23/+6
| | | | llvm-svn: 10791
* Use constantexprs for casts. Eliminate use of the ConstantHandling interfacesChris Lattner2004-01-121-11/+5
| | | | llvm-svn: 10779
* Fix fairly severe bug in my last checking where we treated all unfoldableChris Lattner2004-01-121-3/+12
| | | | | | | | constants as being "true" when evaluating branches. This was introduced because we now create constantexprs for the constants instead of failing the fold. llvm-svn: 10778
* * Implement minor performance optimization for the getelementptr caseChris Lattner2004-01-121-3/+69
| | | | | | | | * Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll This allows us to fold expressions like "foo"[2], even if the pointer is only a conditional constant. llvm-svn: 10767
* Implement SCCP/phitest.llChris Lattner2004-01-121-14/+115
| | | | llvm-svn: 10763
* Finegrainify namespacificationChris Lattner2004-01-091-4/+2
| | | | llvm-svn: 10725
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-1/+4
| | | | llvm-svn: 9903
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | Header files will be on the way. llvm-svn: 9298
* ADd support for the new varargs instructionsChris Lattner2003-10-181-1/+2
| | | | llvm-svn: 9225
* Fix spelling.Misha Brukman2003-10-101-1/+1
| | | | llvm-svn: 9027
* Update commentChris Lattner2003-10-081-2/+2
| | | | llvm-svn: 8965
* Use a set to keep track of which edges have been noticed as executable alreadyChris Lattner2003-10-081-15/+27
| | | | | | | to avoid reprocessing PHI nodes needlessly. This speeds up the big bad PHI testcase 43%: from 104.9826 to 73.5157s llvm-svn: 8964
* Minor fixes here and thereChris Lattner2003-10-081-22/+21
| | | | llvm-svn: 8963
OpenPOWER on IntegriCloud