summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed EOL whitespace.Michael Gottesman2013-01-071-29/+29
| | | | llvm-svn: 171791
* Sink AddrMode back into TargetLowering, removing one of the mostChandler Carruth2013-01-071-1/+1
| | | | | | | | | peculiar headers under include/llvm. This struct still doesn't make a lot of sense, but it makes more sense down in TargetLowering than it did before. llvm-svn: 171739
* Remove LSR's use of the random AddrMode struct. These variables wereChandler Carruth2013-01-071-68/+76
| | | | | | | | | | | | already in a class, just inline the four of them. I suspect that this class could be simplified some to not always keep distinct variables for these things, but it wasn't clear to me how given the usage so I opted for a trivial and mechanical translation. This removes one of the two remaining users of a header in include/llvm which does nothing more than define a 4 member struct. llvm-svn: 171738
* Switch the SCEV expander and LoopStrengthReduce to useChandler Carruth2013-01-071-161/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TargetTransformInfo rather than TargetLowering, removing one of the primary instances of the layering violation of Transforms depending directly on Target. This is a really big deal because LSR used to be a "special" pass that could only be tested fully using llc and by looking at the full output of it. It also couldn't run with any other loop passes because it had to be created by the backend. No longer is this true. LSR is now just a normal pass and we should probably lift the creation of LSR out of lib/CodeGen/Passes.cpp and into the PassManagerBuilder. =] I've not done this, or updated all of the tests to use opt and a triple, because I suspect someone more familiar with LSR would do a better job. This change should be essentially without functional impact for normal compilations, and only change behvaior of targetless compilations. The conversion required changing all of the LSR code to refer to the TTI interfaces, which fortunately are very similar to TargetLowering's interfaces. However, it also allowed us to *always* expect to have some implementation around. I've pushed that simplification through the pass, and leveraged it to simplify code somewhat. It required some test updates for one of two things: either we used to skip some checks altogether but now we get the default "no" answer for them, or we used to have no information about the target and now we do have some. I've also started the process of removing AddrMode, as the TTI interface doesn't use it any longer. In some cases this simplifies code, and in others it adds some complexity, but I think it's not a bad tradeoff even there. Subsequent patches will try to clean this up even further and use other (more appropriate) abstractions. Yet again, almost all of the formatting changes brought to you by clang-format. =] llvm-svn: 171735
* Make the MergeGlobals pass correctly handle the address space qualifiers of ↵Silviu Baranga2013-01-071-11/+24
| | | | | | the global variables. We partition the set of globals by their address space, and apply the same the trasnformation as before to merge them. llvm-svn: 171730
* Switch LoopIdiom pass to directly require target transform information.Chandler Carruth2013-01-071-3/+3
| | | | | | | | I'm sorry for duplicating bad style here, but I wanted to keep consistency. I've pinged the code review thread where this style was reviewed and changes were requested. llvm-svn: 171714
* Make SimplifyCFG simply depend upon TargetTransformInfo and pass itChandler Carruth2013-01-071-9/+15
| | | | | | | | | | | | | through as a reference rather than a pointer. There is always *some* implementation of this available, so this simplifies code by not having to test for whether it is available or not. Further, it turns out there were piles of places where SimplifyCFG was recursing and not passing down either TD or TTI. These are fixed to be more pedantically consistent even though I don't have any particular cases where it would matter. llvm-svn: 171691
* Make the popcnt support enums and methods have more clear names andChandler Carruth2013-01-071-1/+1
| | | | | | | follow the conding conventions regarding enumerating a set of "kinds" of things. llvm-svn: 171687
* Move TargetTransformInfo to live under the Analysis library. This noChandler Carruth2013-01-072-2/+2
| | | | | | | longer would violate any dependency layering and it is in fact an analysis. =] llvm-svn: 171686
* [ObjCARC Debug Message] - Added debug message when fuse a retain/autorelease ↵Michael Gottesman2013-01-071-2/+10
| | | | | | pair in ObjCARCContract::ContractAutorelease. llvm-svn: 171679
* [ObjCARC Debug Message] - Added debug message when we zap a matching ↵Michael Gottesman2013-01-071-0/+3
| | | | | | retain/autorelease pair in ObjCARCOpt::OptimizeReturns. llvm-svn: 171678
* [ObjCARC Debug Message] - Added debug message when we erase ARC calls with ↵Michael Gottesman2013-01-071-0/+2
| | | | | | null since they are no-ops. llvm-svn: 171677
* [ObjCARC Debug Message] - Added debug message when we add a nounwind keyword ↵Michael Gottesman2013-01-061-0/+2
| | | | | | to a function which can not throw. llvm-svn: 171676
* [ObjCARC Debug Message] - Added debug message when we add a tail keyword to ↵Michael Gottesman2013-01-061-0/+3
| | | | | | a function which can never be passed stack args. llvm-svn: 171675
* [ObjCARC Debug Messages] - Added missing newline.Michael Gottesman2013-01-061-1/+1
| | | | llvm-svn: 171674
* Added debug statement to ObjCARC when we replace objc_autorelease(x) with ↵Michael Gottesman2013-01-061-0/+8
| | | | | | objc_release(x) when x is otherwise unused. llvm-svn: 171673
* Added 2x Debug statements to ObjCARC that log when we handle the two ↵Michael Gottesman2013-01-061-2/+16
| | | | | | | | undefined pointer-to-weak-pointer is NULL cases by replacing the given call inst with an undefined value. The reason that there are two cases is that the first case handles the unary cases and the second the binary cases. llvm-svn: 171672
* Added debug message in ObjCARC when we remove a no-op cast which has only ↵Michael Gottesman2013-01-061-0/+2
| | | | | | special semantic meaning in the frontend and thus in the optimizer can be deleted. llvm-svn: 171670
* Added debug message to ObjCARC when we transform an ↵Michael Gottesman2013-01-061-0/+12
| | | | | | objc_autoreleaseReturnValue => objc_autorelease due to its operand not being used as a return value. llvm-svn: 171669
* Fix a crash in LSR replaceCongruentIVs.Andrew Trick2013-01-061-1/+1
| | | | | | | Indirect branch in the preheader crashes replaceCongruentIVs. Fixes rdar://12910141. llvm-svn: 171653
* Added debug message to ObjCARC when we transform ↵Michael Gottesman2013-01-051-0/+11
| | | | | | objc_retainAutorelasedReturnValue => objc_retain since the operand to said function is not a return value. llvm-svn: 171629
* Added debug message for ObjCARC when we zap an ↵Michael Gottesman2013-01-051-0/+5
| | | | | | objc_autoreleaseReturnValue/objc_retainAutoreleasedValue pair. llvm-svn: 171628
* switch from pointer equality comparison to MDNode::getMostGenericTBAA Chris Lattner2013-01-051-3/+5
| | | | | | when merging two TBAA tags, pointed out by Nuno. llvm-svn: 171627
* Switch LoopIdiomRecognize to directly use the TargetTransformInfoChandler Carruth2013-01-051-11/+9
| | | | | | interface rather than the ScalarTargetTransformInterface. llvm-svn: 171616
* Sink the AddressingModeMatcher helper class into an anonymous namespaceChandler Carruth2013-01-051-1/+623
| | | | | | | | | | | | next to its only user. This helper relies on TargetLowering information that shouldn't be generally used throughout the Transfoms library, and so it made little sense as a generic utility. This also consolidates the file where we need to remove the remaining uses of TargetLowering in favor of the IR-layer abstract interface in TargetTransformInfo. llvm-svn: 171590
* Added DEBUG message to ObjCARC when we optimize objc_retain => ↵Michael Gottesman2013-01-041-0/+10
| | | | | | objc_retainAutorelasedReturnValue. llvm-svn: 171535
* Fixed up some DEBUG messages where I was putting in the text of a message ↵Michael Gottesman2013-01-041-8/+8
| | | | | | | | the method where it was being called when I should have just prefixed the actual message with Pass::Method. Additionally I fixed some whitespace issues. llvm-svn: 171534
* Changed two debug statements that state that a queue had finished being ↵Michael Gottesman2013-01-031-2/+2
| | | | | | processed when said queue was really a list to state a list had finished being processed. llvm-svn: 171465
* Added DEBUG message for ObjCARC when we zap a push/pop pair in ↵Michael Gottesman2013-01-031-0/+3
| | | | | | ObjCARCAPElim::OptimizeBB. llvm-svn: 171464
* Added DEBUG message to ObjCARC when we transform objc_initWeak(p, null) => ↵Michael Gottesman2013-01-031-0/+4
| | | | | | *p = null. llvm-svn: 171463
* Added DEBUG message for ObjCARC when an inline asm marker is inserted for ↵Michael Gottesman2013-01-031-0/+2
| | | | | | architectures where this is required to perform a retainAutoreleasedReturnValue optimization. llvm-svn: 171462
* - Add comment to two functions which might be considered as dead code. Shuxin Yang2013-01-021-2/+4
| | | | | | - Fix a typo llvm-svn: 171399
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-0232-144/+144
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-021-1/+1
| | | | | | | | | | utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. llvm-svn: 171362
* Add IRBuilder::CreateVectorSplat and use it to simplify code.Benjamin Kramer2013-01-011-12/+1
| | | | llvm-svn: 171349
* SROA: Clean up unused assignment warnings from clang's analyzer.Benjamin Kramer2013-01-011-5/+4
| | | | | | No functionality change. llvm-svn: 171348
* Added DEBUG message when ObjCARC replaces a call which returns its argument ↵Michael Gottesman2013-01-011-2/+6
| | | | | | | | | | | verbatim with its argument to temporarily undo an optimization. Specifically these calls return their argument verbatim, as a low-level optimization. However, this makes high-level optimizations harder. We undo any uses of this optimization that the front-end emitted. We redo them later in the contract pass. llvm-svn: 171346
* Added DEBUG messages to the top of several processing loops in ObjCARC.cpp ↵Michael Gottesman2013-01-011-3/+32
| | | | | | | | | that emit what instructions are being visited. This is a part of a larger effort of adding DEBUG messages to the ARC Optimizer Backend. llvm-svn: 171345
* Fix LICM's memory promotion optimization to preserve TBAA tags whenChris Lattner2012-12-311-6/+18
| | | | | | | promoting a store in a loop. This was noticed when working on PR14753, but isn't directly related. llvm-svn: 171281
* convert a bunch of callers from DataLayout::getIndexedOffset() to ↵Nuno Lopes2012-12-301-39/+1
| | | | | | | | | GEP::accumulateConstantOffset(). The later API is nicer than the former, and is correct regarding wrap-around offsets (if anyone cares). There are a few more places left with duplicated code, which I'll remove soon. llvm-svn: 171259
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-303-4/+7
| | | | | | | | | directly. This is in preparation for removing the use of the 'Attribute' class as a collection of attributes. That will shift to the AttributeSet class instead. llvm-svn: 171253
* Every pass deserves a name, even codegenprep.Evan Cheng2012-12-211-0/+2
| | | | llvm-svn: 170831
* Add a new attribute, 'noduplicate'. If a function contains a noduplicate ↵James Molloy2012-12-204-4/+29
| | | | | | | | call, the call cannot be duplicated - Jump threading, loop unrolling, loop unswitching, and loop rotation are inhibited if they would duplicate the call. Similarly inlining of the function is inhibited, if that would duplicate the call (in particular inlining is still allowed when there is only one callsite and the function has internal linkage). llvm-svn: 170704
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-194-34/+34
| | | | | | single attribute in the future. llvm-svn: 170502
* SROA: Replace calls to getScalarSizeInBits to DataLayout's API becauseNadav Rotem2012-12-181-6/+6
| | | | | | getScalarSizeInBits could not handle vectors of pointers. llvm-svn: 170412
* Fix another SROA crasher, PR14601.Chandler Carruth2012-12-171-1/+1
| | | | | | | | This was a silly oversight, we weren't pruning allocas which were used by variable-length memory intrinsics from the set that could be widened and promoted as integers. Fix that. llvm-svn: 170353
* Teach the rewriting of memcpy calls to support subvector copies.Chandler Carruth2012-12-171-40/+41
| | | | | | | | | | | | | | | | | | This also cleans up a bit of the memcpy call rewriting by sinking some irrelevant code further down and making the call-emitting code a bit more concrete. Previously, memcpy of a subvector would actually miscompile (!!!) the copy into a single vector element copy. I have no idea how this ever worked. =/ This is the memcpy half of PR14478 which we probably weren't noticing previously because it didn't actually assert. The rewrite relies on the newly refactored insert- and extractVector functions to do the heavy lifting, and those are the same as used for loads and stores which makes the test coverage a bit more meaningful here. llvm-svn: 170338
* Optimize tree walking in markAliveBlocks.Evgeniy Stepanov2012-12-171-4/+3
| | | | | | | | Check whether a BB is known as reachable before adding it to the worklist. This way BB's with multiple predecessors are added to the list no more than once. llvm-svn: 170335
* Fix a secondary bug I introduced while fixing the first part of PR14478.Chandler Carruth2012-12-171-6/+2
| | | | | | | | | | | | The first half of fixing this bug was actually in r170328, but was entirely coincidental. It did however get me to realize the nature of the bug, and adapt the test case to test more interesting behavior. In turn, that uncovered the rest of the bug which I've fixed here. This should fix two new asserts that showed up in the vectorize nightly tester. llvm-svn: 170333
* Hoist a convertValue call to the two paths where it is needed.Chandler Carruth2012-12-171-3/+4
| | | | | | | | I noticed this while looking at r170328. We only ever do a vector rewrite when the alloca *is* the vector type, so it's good to not paper over bugs here by doing a convertValue that isn't needed. llvm-svn: 170331
OpenPOWER on IntegriCloud