summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GVN.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert a few more things to use raw_ostream.Dan Gohman2009-07-251-14/+14
| | | | llvm-svn: 77039
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-4/+5
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-6/+6
| | | | llvm-svn: 76702
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-211-2/+2
| | | | llvm-svn: 76598
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-4/+4
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-4/+5
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-1/+1
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* Remove the vicmp and vfcmp instructions. Because we never had a release withNick Lewycky2009-07-081-20/+20
| | | | | | | these instructions, no autoupgrade or backwards compatibility support is provided. llvm-svn: 74991
* Convert the first batch of passes to use LLVMContext.Owen Anderson2009-07-031-5/+6
| | | | llvm-svn: 74748
* This fixes a bug introduced in 72661, which canDale Johannesen2009-06-171-1/+18
| | | | | | | | | | | | | | | move loads back past a check that the load address is valid, see new testcase. The test that went in with 72661 has exactly this case, except that the conditional it's moving past is checking something else; I've settled for changing that test to reference a global, not a pointer. It may be possible to scan all the tests you pass and make sure none of them are checking any component of the address, but it's not trivial and I'm not trying to do that here. llvm-svn: 73632
* Add debug message about non-local loads being clobbered.Torok Edwin2009-06-171-1/+7
| | | | llvm-svn: 73625
* Make the EnableLoadPRE variable static.Dan Gohman2009-06-151-1/+1
| | | | llvm-svn: 73398
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-041-1/+5
| | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt llvm-svn: 72897
* Be more aggressive in doing LoadPRE by tracing backwards when a block only hasOwen Anderson2009-05-311-4/+39
| | | | | | | | a single predecessor. Patch by Jakub Staszak. llvm-svn: 72661
* Enable GVN Load PRE.Bill Wendling2009-05-291-1/+1
| | | | llvm-svn: 72589
* just show the instruction, its not that slow.Torok Edwin2009-05-291-6/+1
| | | | llvm-svn: 72577
* for instructions with void type we have no choice but print the instruction asTorok Edwin2009-05-291-1/+4
| | | | | | is, otherwise we get a <badref>. llvm-svn: 72567
* Add a DEBUG() output to GVN that prints the instruction clobbering a load.Torok Edwin2009-05-291-1/+11
| | | | | | | This is useful when trying to figure out why GVN didn't eliminate redundant loads. llvm-svn: 72565
* Fix an issue where phiMap was not being updated properly when doing load PRE.Owen Anderson2009-05-291-0/+5
| | | | | | Diagnosis and patch thanks to Jakub Staszak. llvm-svn: 72562
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-061-3/+3
| | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. llvm-svn: 71071
* Reapply r68211, with the miscompilations it caused fixed.Owen Anderson2009-04-011-9/+30
| | | | llvm-svn: 68262
* Revert r68172. It caused regressions inDan Gohman2009-04-011-38/+10
| | | | | | | | Applications/Burg/burg Applications/ClamAV/clamscan and many other tests. llvm-svn: 68211
* Enhance GVN to propagate simple conditionals. This fixes PR3921.Owen Anderson2009-04-011-10/+38
| | | | llvm-svn: 68172
* Do not attempt to do parial redundancy elimination on void values.John Criswell2009-03-101-3/+4
| | | | | | | Also fixed a punctuation error in the header comment. This fixes PR3775. llvm-svn: 66542
* Skip DbgInfoIntrinsic.Devang Patel2009-03-061-2/+2
| | | | llvm-svn: 66244
* improve naming of values in GVN, patch by Jay Foad!Chris Lattner2009-02-121-2/+2
| | | | llvm-svn: 64363
* Mistakenly turned this on.Bill Wendling2009-02-081-1/+1
| | | | llvm-svn: 64065
* Revert r63999. It was breaking self-hosting builds.Bill Wendling2009-02-081-1/+1
| | | | llvm-svn: 64062
* improve compatibility with cygwin, patch by Jay Foad!Chris Lattner2009-01-191-1/+1
| | | | llvm-svn: 62535
* Don't forget to remove phi nodes from the value numbering table after we ↵Owen Anderson2008-12-231-0/+2
| | | | | | collapse them. llvm-svn: 61358
* Comment clean-ups. No functionality change.Bill Wendling2008-12-221-5/+3
| | | | llvm-svn: 61354
* Check that the instruction isn't in the value numbering scope.Bill Wendling2008-12-221-6/+22
| | | | llvm-svn: 61353
* Simplification: Negate the operator== method instead of implementing a full ↵Bill Wendling2008-12-221-24/+1
| | | | | | operator!= method. llvm-svn: 61352
* Add verification that deleted instruction isn't hiding in the PHI map.Bill Wendling2008-12-221-4/+17
| | | | llvm-svn: 61350
* Verify removed in a few more places.Bill Wendling2008-12-221-0/+2
| | | | llvm-svn: 61349
* Add verification functions to GVN which check to see that an instruction wasBill Wendling2008-12-221-0/+18
| | | | | | | truely deleted. These will be expanded with further checks of all of the data structures. llvm-svn: 61347
* Didn't mean to commit this.Bill Wendling2008-12-181-1/+1
| | | | llvm-svn: 61222
* Re-XFAIL this test until debug stuff settles down.Bill Wendling2008-12-181-1/+1
| | | | llvm-svn: 61219
* reapply this hunk from Bill's reversion in r61169, it is conservativeChris Lattner2008-12-181-0/+5
| | | | | | and safe and orthogonal from turning off load pre. llvm-svn: 61177
* Temporarily revert r61027. It was causing a bootstrap failure in "release" modeBill Wendling2008-12-171-6/+1
| | | | | | | | | | | | | | | | | | | | | | | with everyone's favorite error messages: Comparing stages 2 and 3 warning: ./cc1-checksum.o differs warning: ./cc1plus-checksum.o differs Bootstrap comparison failure! ./c-decl.o differs ./cp/decl.o differs ./df-core.o differs ./gcc.o differs ./i386.o differs ./stor-layout.o differs ./tree-pretty-print.o differs ./tree.o differs make[2]: *** [compare] Error 1 make[1]: *** [stage3-bubble] Error 2 See PR3227. llvm-svn: 61169
* Enable Load PRE. This teaches GVN to push partially redundant loads up theChris Lattner2008-12-151-1/+6
| | | | | | | | | CFG when there is exactly one predecessor where the load is not available. This is designed to not increase code size but still eliminate partially redundant loads. This fires 1765 times on 403.gcc even though it doesn't do critical edge splitting yet (the most common reason for it to fail). llvm-svn: 61027
* Ifdef out some code that I didn't mean to enable by default yet.Owen Anderson2008-12-151-1/+8
| | | | llvm-svn: 61024
* make GVN try to rename inputs to the resultant replaced values, whichChris Lattner2008-12-151-1/+5
| | | | | | | cleans up the generated code a bit. This should have the added benefit of not randomly renaming functions/globals like my previous patch did. :) llvm-svn: 61023
* Add support for slow-path GVN with full phi construction for scalars. This ↵Owen Anderson2008-12-151-7/+77
| | | | | | | | is disabled for now, as it actually pessimizes code in the abscence of phi translation for load elimination. This slow down GVN a bit, by about 2% on 403.gcc. llvm-svn: 61021
* Generalize GVN's phi construciton routine to work for things other than loads.Owen Anderson2008-12-141-3/+7
| | | | llvm-svn: 61009
* Temporarily revert r60973. It's inexplicably causing a failure when ↵Bill Wendling2008-12-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | self-hosting LLVM: llvm[2]: Linking Release executable opt (without symbols) ... Undefined symbols: "llvm::APFloat::IEEEsingle", referenced from: __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(Constants.o) __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o) __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o) "llvm::APFloat::IEEEdouble", referenced from: __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(Constants.o) __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o) __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o) ld: symbol(s) not found This is in release mode. To replicate, compile llvm and llvm-gcc in optimized mode. Then build llvm, in optimized mode, with the newly created compiler. llvm-svn: 60977
* make RLE preserve the name of the load that it replaces. This is justChris Lattner2008-12-131-0/+1
| | | | | | a pretification of the IR. llvm-svn: 60973
* Teach GVN to invalidate some memdep information when it does an RAUWChris Lattner2008-12-091-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | of a pointer. This allows is to catch more equivalencies. For example, the type_lists_compatible_p function used to require two iterations of the gvn pass (!) to delete its 18 redundant loads because the first pass would CSE all the addressing computation cruft, which would unblock the second memdep/gvn passes from recognizing them. This change allows memdep/gvn to catch all 18 when run just once on the function (as is typical :) instead of just 3. On all of 403.gcc, this bumps up the # reundandancies found from: 63 gvn - Number of instructions PRE'd 153991 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted to: 63 gvn - Number of instructions PRE'd 154137 gvn - Number of instructions deleted 50185 gvn - Number of loads deleted +120 loads deleted isn't bad. llvm-svn: 60799
* rename getNonLocalDependency -> getNonLocalCallDependency, and removeChris Lattner2008-12-091-1/+1
| | | | | | pointer stuff from it, simplifying the code a bit. llvm-svn: 60783
* Switch GVN::processNonLocalLoad to using the new Chris Lattner2008-12-091-20/+11
| | | | | | | | | | | | MemDep::getNonLocalPointerDependency method. There are some open issues with this (missed optimizations) and plenty of future work, but this does allow GVN to eliminate *slightly* more loads (49246 vs 49033). Switching over now allows simplification of the other code path in memdep. llvm-svn: 60780
OpenPOWER on IntegriCloud