summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Reverting patch in revision 89758, initial attempt at fixing PR5373 has ↵Edward O'Callaghan2009-11-251-0/+1
| | | | | | proven to be bogus. llvm-svn: 89844
* Fix for PR5373, Credit to Jakub Staszak.Edward O'Callaghan2009-11-241-1/+0
| | | | llvm-svn: 89758
* Make ConstantFoldConstantExpression recursively visit the entireDan Gohman2009-11-231-0/+9
| | | | | | | | | | ConstantExpr, not just the top-level operator. This allows it to fold many more constants. Also, make GlobalOpt call ConstantFoldConstantExpression on GlobalVariable initializers. llvm-svn: 89659
* Fix a use of an invalidated iterator in the case where there are multipleDan Gohman2009-11-231-1/+5
| | | | | | adjacent uses of a dead basic block from the same user. This fixes PR5596. llvm-svn: 89658
* Pull LLVMContext out of PromoteMemToReg.Nick Lewycky2009-11-234-12/+8
| | | | llvm-svn: 89645
* Remove LLVMContext and its include.Nick Lewycky2009-11-231-7/+5
| | | | llvm-svn: 89644
* Remove unused LLVMContext.Nick Lewycky2009-11-231-5/+2
| | | | llvm-svn: 89642
* Reapply r88830 with a bugfix: this transform only applies to icmp eq/ne. ThisNick Lewycky2009-11-231-0/+30
| | | | | | fixes part of PR5438. llvm-svn: 89639
* Add more optimizations for object size checking, enable handling ofEric Christopher2009-11-211-35/+144
| | | | | | | object size intrinsic and verify return type is correct. Collect various code in one place. llvm-svn: 89523
* Make Loop::getLoopLatch() work on loops which don't have preheaders, asDan Gohman2009-11-201-1/+6
| | | | | | | | | | | | it may be used in contexts where preheader insertion may have failed due to an indirectbr. Make LoopSimplify's LoopSimplify::SeparateNestedLoop properly fail in the case that it would require splitting an indirectbr edge. These fix PR5502. llvm-svn: 89484
* Fix IPSCCP's code for deleting dead blocks to tolerate outstandingDan Gohman2009-11-201-2/+6
| | | | | | blockaddress users. This fixes PR5569. llvm-svn: 89483
* Revert "Add some rough optimizations for checking routines.", it buildeth not.Daniel Dunbar2009-11-201-119/+12
| | | | llvm-svn: 89482
* Add some rough optimizations for checking routines.Eric Christopher2009-11-201-12/+119
| | | | llvm-svn: 89479
* Fix PR5563, an expensive checks failure when running onDuncan Sands2009-11-201-1/+1
| | | | | | | | | | | | | tests/Transforms/InstCombine/shufflemask-undef.ll. If anyone cares, the use of 2*e here (and the equivalent all over the place in instcombine) seems wrong, though harmless: it should really be twice the length of the input vector. I think shufflevector used to require that the mask have the same length as the input, but I don't think that's true any more. I don't care enough about vectors to do anything about this... llvm-svn: 89456
* Extend CaptureTracking to indicate when a value is never stored, evenDan Gohman2009-11-191-2/+2
| | | | | | | | if it is not ultimately captured. Teach BasicAliasAnalysis that a local object address which does not escape and is never stored does not alias with a value resulting from a load. llvm-svn: 89398
* Enable hoisting of loads from constant memory by default. In cases whereDan Gohman2009-11-191-11/+1
| | | | | | | | they are lowered to instruction sequences more complex than a simple load, such that CodeGen cannot rematerialize them, a reload from a spill slot is likely to be cheaper than the complex sequence. llvm-svn: 89374
* Eliminate duplicate phi nodes in loops. Loop rotation, for example, can ↵Jim Grosbach2009-11-191-0/+6
| | | | | | introduce these, and it's beneficial to later passes to clean them up. llvm-svn: 89298
* Make EliminateDuplicatePHINodes() available as a utility functionJim Grosbach2009-11-191-1/+1
| | | | llvm-svn: 89297
* grammarJim Grosbach2009-11-171-2/+2
| | | | llvm-svn: 89145
* 80-column violationsJim Grosbach2009-11-171-8/+11
| | | | llvm-svn: 89123
* Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to ↵Evan Cheng2009-11-171-87/+99
| | | | | | use postinc iv. llvm-svn: 89116
* Remove trailing whitespaceJim Grosbach2009-11-171-74/+74
| | | | llvm-svn: 89110
* Remove debug info attached with an instruction.Devang Patel2009-11-171-36/+18
| | | | llvm-svn: 89016
* Fix an expensive-checks error.David Greene2009-11-161-20/+24
| | | | | | | The Mask and LHSMask may not be of the same size, so don't do the transformation if they're different. llvm-svn: 88972
* CreateIntCast takes an "isSigned" parameter. Pass "true" for it, rather thanDuncan Sands2009-11-161-1/+3
| | | | | | a name. llvm-svn: 88908
* make PRE of loads preserve the alignment of the moved load instruction.Chris Lattner2009-11-151-5/+8
| | | | llvm-svn: 88865
* fix a bug handling 'not x' when x is undef.Chris Lattner2009-11-151-2/+3
| | | | llvm-svn: 88864
* Revert r88830 and r88831 which appear to have caused a selfhost buildbot someNick Lewycky2009-11-151-28/+0
| | | | | | grief. I suspect this patch merely exposed a bug else. llvm-svn: 88841
* Teach instcombine to look for booleans in wider integers when it encounters aNick Lewycky2009-11-151-0/+28
| | | | | | | zext(icmp). It may be able to optimize that away. This fixes one of the cases in PR5438. llvm-svn: 88830
* Remove LLVMContext from reassociate. It was threaded through every function butNick Lewycky2009-11-141-22/+14
| | | | | | ultimately never used. llvm-svn: 88763
* Add an option for running GVN with redundant load processing disabled.Dan Gohman2009-11-141-9/+23
| | | | llvm-svn: 88742
* Re-enable this code, since redundant PHIs are now being better nuked.Owen Anderson2009-11-121-4/+0
| | | | llvm-svn: 87042
* use isInstructionTriviallyDead, as pointed out by DuncanChris Lattner2009-11-121-3/+3
| | | | llvm-svn: 87035
* implement a nice little efficiency hack in the inliner. Since we're nowChris Lattner2009-11-121-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | running IPSCCP early, and we run functionattrs interlaced with the inliner, we often (particularly for small or noop functions) completely propagate all of the information about a call to its call site in IPSSCP (making a call dead) and functionattrs is smart enough to realize that the function is readonly (because it is interlaced with inliner). To improve compile time and make the inliner threshold more accurate, realize that we don't have to inline dead readonly function calls. Instead, just delete the call. This happens all the time for C++ codes, here are some counters from opt/llvm-ld counting the number of times calls were deleted vs inlined on various apps: Tramp3d opt: 5033 inline - Number of call sites deleted, not inlined 24596 inline - Number of functions inlined llvm-ld: 667 inline - Number of functions deleted because all callers found 699 inline - Number of functions inlined 483.xalancbmk opt: 8096 inline - Number of call sites deleted, not inlined 62528 inline - Number of functions inlined llvm-ld: 217 inline - Number of allocas merged together 2158 inline - Number of functions inlined 471.omnetpp: 331 inline - Number of call sites deleted, not inlined 8981 inline - Number of functions inlined llvm-ld: 171 inline - Number of functions deleted because all callers found 629 inline - Number of functions inlined Deleting a call is much faster than inlining it, and is insensitive to the size of the callee. :) llvm-svn: 86975
* - Teach LSR to avoid changing cmp iv stride if it will create an immediate thatEvan Cheng2009-11-121-209/+355
| | | | | | | | | | | | | | cannot be folded into target cmp instruction. - Avoid a phase ordering issue where early cmp optimization would prevent the later count-to-zero optimization. - Add missing checks which could cause LSR to reuse stride that does not have users. - Fix a bug in count-to-zero optimization code which failed to find the pre-inc iv's phi node. - Remove, tighten, loosen some incorrect checks disable valid transformations. - Quite a bit of code clean up. llvm-svn: 86969
* use getPredicateOnEdge to fold comparisons through PHI nodes,Chris Lattner2009-11-121-1/+11
| | | | | | | which implements GCC PR18046. This also gets us 360 more jump threads on 176.gcc. llvm-svn: 86953
* various fixes to the lattice transfer functions.Chris Lattner2009-11-121-0/+6
| | | | llvm-svn: 86952
* switch jump threading to use getPredicateOnEdge in one placeChris Lattner2009-11-121-10/+13
| | | | | | | | making the new LVI stuff smart enough to subsume some special cases in the old code. Disable them when LVI is around, the testcase still passes. llvm-svn: 86951
* Add the braces gcc suggested.Daniel Dunbar2009-11-121-5/+8
| | | | llvm-svn: 86933
* with the new code we can thread non-instruction values. ThisChris Lattner2009-11-121-1/+6
| | | | | | allows us to handle the test10 testcase. llvm-svn: 86924
* this argument can be an arbitrary value, it doesn't need to be an instruction.Chris Lattner2009-11-121-4/+3
| | | | llvm-svn: 86923
* expose edge information and switch j-t to use it.Chris Lattner2009-11-121-2/+2
| | | | llvm-svn: 86920
* pass TD into a SimplifyCmpInst call. Add another case thatChris Lattner2009-11-111-3/+24
| | | | | | uses LVI info when -enable-jump-threading-lvi is passed. llvm-svn: 86886
* Don't trivially delete unused calls to llvm.invariant.start. This allowsDuncan Sands2009-11-111-0/+3
| | | | | | | | | | | | | llvm.invariant.start to be used without necessarily being paired with a call to llvm.invariant.end. If you run the entire optimization pipeline then such calls are in fact deleted (adce does it), but that's actually a good thing since we probably do want them to be zapped late in the game. There should really be an integration test that checks that the llvm.invariant.start call lasts long enough that all passes that do interesting things with it get to do their stuff before it is deleted. But since no passes do anything interesting with it yet this will have to wait for later. llvm-svn: 86840
* remove the now dead condprop pass, PR3906.Chris Lattner2009-11-113-294/+0
| | | | llvm-svn: 86810
* stub out some LazyValueInfo interfaces, and have JumpThreadingChris Lattner2009-11-111-18/+45
| | | | | | | | start using them in a trivial way when -enable-jump-threading-lvi is passed. enable-jump-threading-lvi will be my playground for awhile. llvm-svn: 86789
* add a fixmeChris Lattner2009-11-111-0/+4
| | | | llvm-svn: 86766
* Block terminator may be a switch.Evan Cheng2009-11-111-1/+1
| | | | llvm-svn: 86761
* Implement support to debug inlined functions.Devang Patel2009-11-102-4/+57
| | | | llvm-svn: 86748
* implement a TODO by teaching jump threading about "xor x, 1".Chris Lattner2009-11-101-2/+14
| | | | llvm-svn: 86739
OpenPOWER on IntegriCloud