summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* remove debugChris Lattner2009-12-311-1/+1
| | | | llvm-svn: 92369
* teach reassociate to factor x+x+x -> x*3. While I'm at it,Chris Lattner2009-12-311-22/+70
| | | | | | fix RemoveDeadBinaryOp to actually do something. llvm-svn: 92368
* change reassociate to use SmallVector for its key datastructuresChris Lattner2009-12-311-15/+18
| | | | | | instead of std::vector. llvm-svn: 92366
* change an if to an assert, fix comment.Chris Lattner2009-12-311-4/+4
| | | | llvm-svn: 92364
* move the rest of the add optimization code out to OptimizeAdd,Chris Lattner2009-12-311-93/+94
| | | | | | improve some comments, simplify a bit of code. llvm-svn: 92363
* factor statistic updating better.Chris Lattner2009-12-311-19/+9
| | | | llvm-svn: 92362
* simple fix for an incorrect factoring which causes aChris Lattner2009-12-311-0/+7
| | | | | | miscompilation, PR5458. llvm-svn: 92354
* factor code out into helper functions.Chris Lattner2009-12-311-88/+109
| | | | llvm-svn: 92347
* switch some std::vector's to smallvector. Reduce nesting.Chris Lattner2009-12-311-54/+57
| | | | llvm-svn: 92346
* use more modern datastructures.Chris Lattner2009-12-311-4/+5
| | | | llvm-svn: 92344
* clean up -debug output.Chris Lattner2009-12-311-3/+4
| | | | llvm-svn: 92343
* fix Analysis/DebugInfo.h to not include Metadata.h. Do thisChris Lattner2009-12-311-0/+1
| | | | | | | by moving one method out of line and eliminating redundant checks from other methods. llvm-svn: 92337
* rename "elements" of metadata to "operands". "Elements" areChris Lattner2009-12-311-3/+3
| | | | | | | things that occur in types. "operands" are things that occur in values. llvm-svn: 92322
* Use an array instead of a SmallVector.Benjamin Kramer2009-12-291-7/+7
| | | | llvm-svn: 92264
* prune #includes.Chris Lattner2009-12-291-2/+2
| | | | llvm-svn: 92260
* Final step in the metadata API restructuring: move the Chris Lattner2009-12-292-6/+3
| | | | | | | | getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. llvm-svn: 92259
* remove useless argument.Chris Lattner2009-12-291-8/+7
| | | | llvm-svn: 92256
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-282-8/+14
| | | | | | | | | | | | | | | | | | | | | | I asked Devang to do back on Sep 27. Instead of going through the MetadataContext class with methods like getMD() and getMDs(), just ask the instruction directly for its metadata with getMetadata() and getAllMetadata(). This includes a variety of other fixes and improvements: previously all Value*'s were bloated because the HasMetadata bit was thrown into value, adding a 9th bit to a byte. Now this is properly sunk down to the Instruction class (the only place where it makes sense) and it will be folded away somewhere soon. This also fixes some confusion in getMDs and its clients about whether the returned list is indexed by the MDID or densely packed. This is now returned sorted and densely packed and the comments make this clear. This introduces a number of fixme's which I'll follow up on. llvm-svn: 92235
* split code that doesn't need to be templated out of IRBuilder into a newChris Lattner2009-12-281-0/+1
| | | | | | | non-templated IRBuilderBase class. Move that large CreateGlobalString out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h llvm-svn: 92227
* rename getMDKind -> getMDKindID, make it autoinsert if an MD KindChris Lattner2009-12-282-4/+2
| | | | | | | doesn't exist already, eliminate registerMDKind. Tidy up a bunch of random stuff. llvm-svn: 92225
* Metadata.h doesn't need to include ValueHandle.h anymore.Chris Lattner2009-12-281-0/+1
| | | | llvm-svn: 92211
* move an optimization for memcmp out of simplifylibcalls and into Chris Lattner2009-12-241-13/+0
| | | | | | | | | SDISel. This optimization was causing simplifylibcalls to introduce type-unsafe nastiness. This is the first step, I'll be expanding the memcmp optimizations shortly, covering things that we really really wouldn't want simplifylibcalls to do. llvm-svn: 92098
* reorder to follow a normal fall-through style, no functionality change.Chris Lattner2009-12-231-4/+3
| | | | llvm-svn: 92084
* Remove dump routine and the associated Debug.h from a header. Patch upDavid Greene2009-12-231-36/+36
| | | | | | other files to compensate. llvm-svn: 92075
* Update objectsize intrinsic and associated dependencies. FixEric Christopher2009-12-231-1/+1
| | | | | | lowering code and update testcases. llvm-svn: 91979
* Fix the Convert to scalar to not insert dead loads in the store case. TheChris Lattner2009-12-221-2/+12
| | | | | | | | | | | | | | load is needed when we have a small store into a large alloca (at which point we get a load/insert/store sequence), but when you do a full-sized store, this load ends up being dead. This dead load is bad in really large nasty testcases where the load ends up causing mem2reg to insert large chains of dependent phi nodes which only ADCE can delete. Instead of doing this, just don't insert the dead load. This fixes rdar://6864035 llvm-svn: 91917
* fix some fixme's by using twinesChris Lattner2009-12-221-6/+2
| | | | llvm-svn: 91916
* Generalize SROA to allow the first index of a GEP to be non-zero. Add aBob Wilson2009-12-221-23/+4
| | | | | | | | missing check that an array reference doesn't go past the end of the array, and remove some redundant checks for in-bound array and vector references that are no longer needed. llvm-svn: 91897
* Implement PR5795 by merging duplicated return blocks. This could go furtherChris Lattner2009-12-221-0/+72
| | | | | | | by merging all returns in a function into a single one, but simplifycfg currently likes to duplicate the return (an unfortunate choice!) llvm-svn: 91890
* The phi translated pointer can be computed when returning a partially cached ↵Chris Lattner2009-12-221-1/+1
| | | | | | | | | | result instead of stored. This reduces memdep memory usage, and also eliminates a bunch of weakvh's. This speeds up gvn on gcc.c-torture/20001226-1.c from 23.9s to 8.45s (2.8x) on a different machine than earlier. llvm-svn: 91885
* Whitespace fixes.Eric Christopher2009-12-221-4/+4
| | | | llvm-svn: 91875
* Add suggested parentheses.Daniel Dunbar2009-12-211-4/+4
| | | | llvm-svn: 91853
* Add a fastpath to Load GVN to special case when we have exactly one dominatingChris Lattner2009-12-211-2/+10
| | | | | | | | | | | load to avoid even messing around with SSAUpdate at all. In this case (which is very common, we can just use the input value directly). This speeds up GVN time on gcc.c-torture/20001226-1.c from 36.4s to 16.3s, which still isn't great, but substantially better and this is a simple speedup that applies to lots of different cases. llvm-svn: 91851
* refactor some code out to a new helper method.Chris Lattner2009-12-211-22/+27
| | | | llvm-svn: 91849
* improve indentation avoid a pointless conversion from weakvh to trackingvh,Chris Lattner2009-12-211-3/+3
| | | | | | no functionality change. llvm-svn: 91848
* Remove special-case SROA optimization of variable indexes to one-element andBob Wilson2009-12-211-141/+30
| | | | | | | | two-element arrays. After restructuring the SROA code, it was not safe to do this without adding more checking. It is not clear that this special-case has really been useful, and removing this simplifies the code quite a bit. llvm-svn: 91828
* revert r89298, which was committed without a testcase. I thinkChris Lattner2009-12-211-6/+0
| | | | | | the underlying PHI node insertion issue in SSAUpdate is fixed. llvm-svn: 91821
* fix PR5837 by having SSAUpdate reuse phi nodes for theChris Lattner2009-12-211-1/+23
| | | | | | | | | | 'GetValueInMiddleOfBlock' case, instead of inserting duplicates. A similar fix is almost certainly needed by the machine-level SSAUpdate implementation. llvm-svn: 91820
* give instcombine some helper functions for matching MIN and MAX, andChris Lattner2009-12-211-10/+118
| | | | | | | | | implement some optimizations for MIN(MIN()) and MAX(MAX()) and MIN(MAX()) etc. This substantially improves the code in PR5822 but doesn't kick in much elsewhere. 2 max's were optimized in pairlocalalign and one in smg2000. llvm-svn: 91814
* enhance x-(-A) -> x+A to preserve NUW/NSW.Chris Lattner2009-12-211-11/+47
| | | | | | | | | | | Use the presence of NSW/NUW to fold "icmp (x+cst), x" to a constant in cases where it would otherwise be undefined behavior. Surprisingly (to me at least), this triggers hundreds of the times in a few benchmarks: lencode, ldecode, and 466.h264ref seem to *really* like this. llvm-svn: 91812
* Optimize all cases of "icmp (X+Cst), X" to something simpler. This triggersChris Lattner2009-12-211-3/+74
| | | | | | | a bunch in lencode, ldecod, spass, 176.gcc, 252.eon, among others. It is also the first part of PR5822 llvm-svn: 91811
* Fix a bunch of little errors that Clang complains about when its being pedanticDouglas Gregor2009-12-191-1/+1
| | | | llvm-svn: 91764
* fix PR5827 by disabling the phi slicing transformation in a caseChris Lattner2009-12-191-1/+20
| | | | | | | | where instcombine would have to split a critical edge due to a phi node of an invoke. Since instcombine can't change the CFG, it has to bail out from doing the transformation. llvm-svn: 91763
* Update my SROA changes in response to review.Bob Wilson2009-12-191-33/+38
| | | | | | | | | | * change FindElementAndOffset to return a uint64_t instead of unsigned, and to identify the type to be used for that result in a GEP instruction. * move "isa<ConstantInt>" to be first in conditional. * replace some dyn_casts with casts. * add a comment about handling mem intrinsics. llvm-svn: 91762
* Reapply 91459 with a simple fix for the problem that broke the x86_64-darwinBob Wilson2009-12-181-405/+425
| | | | | | | bootstrap. This also replaces the WeakVH references that Chris objected to with normal Value references. llvm-svn: 91711
* Optimize icmp of null and select of two constants even if the select hasEli Friedman2009-12-181-15/+17
| | | | | | multiple uses. (The construct in question was found in gcc.) llvm-svn: 91675
* Eliminte unnecessary uses of <cstdio>.Dan Gohman2009-12-182-5/+3
| | | | llvm-svn: 91666
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-187-26/+26
| | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. llvm-svn: 91654
* Minor code simplification.Dan Gohman2009-12-181-4/+1
| | | | llvm-svn: 91653
* Don't pass const pointers by reference.Dan Gohman2009-12-181-13/+13
| | | | llvm-svn: 91647
OpenPOWER on IntegriCloud