summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Unroll again after running BBVectorizeHal Finkel2013-01-291-0/+4
| | | | | | | | Because BBVectorize may significantly shorten a loop body, unroll again after vectorization. This is especially important when using runtime or partial unrolling. llvm-svn: 173730
* Vectorization Factor clarificationRenato Golin2013-01-281-17/+24
| | | | llvm-svn: 173691
* [msan] Mostly disable msan-handle-icmp-exact.Evgeniy Stepanov2013-01-281-6/+24
| | | | | | | | It is way too slow. Change the default option value to 0. Always do exact shadow propagation for unsigned ICmp with constants, it is cheap (under 1% cpu time) and required for correctness. llvm-svn: 173682
* Revert r173678.Evgeniy Stepanov2013-01-281-1/+1
| | | | | | Broken tests. llvm-svn: 173679
* [msan] Make msan-handle-icmp-exact=0 by default.Evgeniy Stepanov2013-01-281-1/+1
| | | | | | 50% slowdown on one of the specs. llvm-svn: 173678
* Created ObjCARCUtil.cpp for functions which in my humble opinion are too ↵Michael Gottesman2013-01-283-126/+152
| | | | | | large to static inline and place in a header file such as ObjCARC.h. llvm-svn: 173666
* Cleaned up includes in various ObjCARC files and removed some whitespace ↵Michael Gottesman2013-01-284-9/+34
| | | | | | violations. llvm-svn: 173663
* Refactor ObjCARCAliasAnalysis into its own file.Michael Gottesman2013-01-285-283/+352
| | | | llvm-svn: 173662
* Refactored out pass ObjCARCAPElim from ObjCARCOpts.cpp => ObjCARCAPElim.cpp.Michael Gottesman2013-01-283-148/+183
| | | | llvm-svn: 173654
* Fixed case insensitive issue.Michael Gottesman2013-01-281-1/+1
| | | | llvm-svn: 173653
* Removed extraneous doxygen end module statement.Michael Gottesman2013-01-281-2/+0
| | | | llvm-svn: 173652
* Extracted pass ObjCARCExpand from ObjCARC.cpp => ObjCARCExpand.cpp.Michael Gottesman2013-01-285-299/+370
| | | | | | | I also added the local header ObjCARC.h for common functions used by the various passes. llvm-svn: 173651
* Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation ↵Michael Gottesman2013-01-2811-11/+88
| | | | | | for refactoring the ARC Optimizer. llvm-svn: 173647
* BBVectorize: Better use of TTI->getShuffleCostHal Finkel2013-01-271-4/+23
| | | | | | | | | | | | | | | | | | | | When flipping the pair of subvectors that form a vector, if the vector length is 2, we can use the SK_Reverse shuffle kind to get more-accurate cost information. Also we can use the SK_ExtractSubvector shuffle kind to get accurate subvector extraction costs. The current cost model implementations don't yet seem complex enough for this to make a difference (thus, there are no test cases with this commit), but it should help in future. Depending on how the various targets optimize and combine shuffles in practice, we might be able to get more-accurate costs by combining the costs of multiple shuffle kinds. For example, the cost of flipping the subvector pairs could be modeled as two extractions and two subvector insertions. These changes, however, should probably be motivated by specific test cases. llvm-svn: 173621
* Re-revert r173342, without losing the compile time improvements, flatChandler Carruth2013-01-271-27/+12
| | | | | | out bug fixes, or functionality preserving refactorings. llvm-svn: 173610
* Renamed function IsPotentialUse to IsPotentialRetainableObjPtr.Michael Gottesman2013-01-271-18/+18
| | | | | | | | | This name change does the following: 1. Causes the function name to use proper ARC terminology. 2. Makes it clear what the function truly does. llvm-svn: 173609
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-271-25/+18
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173602
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-271-22/+15
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173601
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-271-27/+15
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173600
* BBVectorize: Add a additional comment about the cost computationHal Finkel2013-01-261-0/+6
| | | | llvm-svn: 173580
* BBVectorize: Fix anomalous capital letter in commentHal Finkel2013-01-261-1/+1
| | | | llvm-svn: 173579
* Convert BuildLibCalls.cpp to using the AttributeSet methods instead of ↵Bill Wendling2013-01-261-66/+66
| | | | | | AttributeWithIndex. llvm-svn: 173536
* Remove some introspection functions.Bill Wendling2013-01-253-16/+21
| | | | | | | | The 'getSlot' function and its ilk allow introspection into the AttributeSet class. However, that class should be opaque. Allow access through accessor methods instead. llvm-svn: 173522
* LoopVectorize: Refactor the code that vectorizes loads/stores to remove ↵Nadav Rotem2013-01-251-145/+113
| | | | | | duplication. llvm-svn: 173500
* Use the new 'getSlotIndex' method to retrieve the attribute's slot index.Bill Wendling2013-01-253-4/+4
| | | | llvm-svn: 173499
* LoopVectorize: Simplify code. No functionality change.Benjamin Kramer2013-01-251-26/+17
| | | | llvm-svn: 173475
* added ability to dynamically change the ExportList of an alreadyPedro Artigas2013-01-251-0/+10
| | | | | | created InternalizePass (useful for pass reuse) llvm-svn: 173474
* LoopVectorizer: Refactor more code to use the IRBuilder. Nadav Rotem2013-01-251-24/+25
| | | | llvm-svn: 173471
* Refactor some code to use the IRBuilder.Nadav Rotem2013-01-251-20/+21
| | | | llvm-svn: 173467
* [msan] A comment on ICmp handling logic.Evgeniy Stepanov2013-01-251-0/+3
| | | | llvm-svn: 173453
* [msan] Implement exact shadow propagation for relational ICmp.Evgeniy Stepanov2013-01-251-0/+70
| | | | | | | | Only for integers, pointers, and vectors of those. No floats. Instrumentation seems very heavy, and may need to be replaced with some approximation in the future. llvm-svn: 173452
* Switch this code away from Value::isUsedInBasicBlock. That code eitherChandler Carruth2013-01-251-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | loops over instructions in the basic block or the use-def list of the value, neither of which are really efficient when repeatedly querying about values in the same basic block. What's more, we already know that the CondBB is small, and so we can do a much more efficient test by counting the uses in CondBB, and seeing if those account for all of the uses. Finally, we shouldn't blanket fail on any such instruction, instead we should conservatively assume that those instructions are part of the cost. Note that this actually fixes a bug in the pass because isUsedInBasicBlock has a really terrible bug in it. I'll fix that in my next commit, but the fix for it would make this code suddenly take the compile time hit I thought it already was taking, so I wanted to go ahead and migrate this code to a faster & better pattern. The bug in isUsedInBasicBlock was also causing other tests to test the wrong thing entirely: for example we weren't actually disabling speculation for floating point operations as intended (and tested), but the test passed because we failed to speculate them due to the isUsedInBasicBlock failure. llvm-svn: 173417
* Added comment to ObjCARC elaborating what is meant by the term 'Provenance' ↵Michael Gottesman2013-01-241-0/+6
| | | | | | in 'Provenance Analysis'. llvm-svn: 173374
* Reapply chandlerc's r173342 now that the miscompile it was triggering is fixed.Benjamin Kramer2013-01-241-9/+18
| | | | | | | | | | | | | | | | | | | | Original commit message: Plug TTI into the speculation logic, giving it a real cost interface that can be specialized by targets. The goal here is not to be more aggressive, but to just be more accurate with very obvious cases. There are instructions which are known to be truly free and which were not being modeled as such in this code -- see the regression test which is distilled from an inner loop of zlib. Everywhere the TTI cost model is insufficiently conservative I've added explicit checks with FIXME comments to go add proper modelling of these cost factors. If this causes regressions, the likely solution is to make TTI even more conservative in its cost estimates, but test cases will help here. llvm-svn: 173357
* Revert r173342 temporarily. It appears to cause a very late miscompileChandler Carruth2013-01-241-18/+9
| | | | | | of stage2 in a bootstrap. Still investigating.... llvm-svn: 173343
* Plug TTI into the speculation logic, giving it a real cost interfaceChandler Carruth2013-01-241-9/+18
| | | | | | | | | | | | | | | | | | that can be specialized by targets. The goal here is not to be more aggressive, but to just be more accurate with very obvious cases. There are instructions which are known to be truly free and which were not being modeled as such in this code -- see the regression test which is distilled from an inner loop of zlib. Everywhere the TTI cost model is insufficiently conservative I've added explicit checks with FIXME comments to go add proper modelling of these cost factors. If this causes regressions, the likely solution is to make TTI even more conservative in its cost estimates, but test cases will help here. llvm-svn: 173342
* Address a large chunk of this FIXME by accumulating the cost forChandler Carruth2013-01-241-8/+6
| | | | | | | unfolded constant expressions rather than checking each one independently. llvm-svn: 173341
* Switch the constant expression speculation cost evaluation away fromChandler Carruth2013-01-241-7/+14
| | | | | | | | | | | | | | | | | | | | a cost fuction that seems both a bit ad-hoc and also poorly suited to evaluating constant expressions. Notably, it is missing any support for trivial expressions such as 'inttoptr'. I could fix this routine, but it isn't clear to me all of the constraints its other users are operating under. The core protection that seems relevant here is avoiding the formation of a select instruction wich a further chain of select operations in a constant expression operand. Just explicitly encode that constraint. Also, update the comments and organization here to make it clear where this needs to go -- this should be driven off of real cost measurements which take into account the number of constants expressions and the depth of the constant expression tree. llvm-svn: 173340
* Rephrase the speculating scan of the conditional BB to be phrased inChandler Carruth2013-01-241-19/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | terms of cost rather than hoisting a single instruction. This does *not* change the cost model! We still set the cost threshold at 1 here, it's just that we track it by accumulating cost rather than by storing an instruction. The primary advantage is that we no longer leave no-op intrinsics in the basic block. For example, this will now move both debug info intrinsics and a single instruction, instead of only moving the instruction and leaving a basic block with nothing bug debug info intrinsics in it, and those intrinsics now no longer ordered correctly with the hoisted value. Instead, we now splice the entire conditional basic block's instruction sequence. This also places the code for checking the safety of hoisting next to the code computing the cost. Currently, the only observable side-effect of this change is that debug info intrinsics are no longer abandoned. I'm not sure how to craft a test case for this, and my real goal was the refactoring, but I'll talk to Dave or Eric about how to add a test case for this. llvm-svn: 173339
* [asan] fix 32-bit buildsKostya Serebryany2013-01-241-3/+3
| | | | llvm-svn: 173338
* Simplify the PHI node operand rewriting.Chandler Carruth2013-01-241-42/+35
| | | | | | | | | | | | | | | | | | Previously, the code would scan the PHI nodes and build up a small setvector of candidate value pairs in phi nodes to go and rewrite. Once certain the rewrite could be performed, the code walks the set, and for each one re-scans the entire PHI node list looking for nodes to rewrite operands. Instead, scan the PHI nodes once to check for hazards, and then scan it a second time to rewrite the operands to selects. No set vector, and a max of two scans. The only downside is that we might form identical selects, but instcombine or anything else should fold those easily, and it seems unlikely to happen often. llvm-svn: 173337
* [asan] adaptive redzones for globals (the larger the global the larger is ↵Kostya Serebryany2013-01-241-3/+13
| | | | | | the redzone) llvm-svn: 173335
* Give the basic block variables here names based on the if-then-endChandler Carruth2013-01-241-32/+33
| | | | | | structure being analyzed. No functionality changed. llvm-svn: 173334
* Lift a cheap early exit test above loops and other complex early exitChandler Carruth2013-01-241-5/+5
| | | | | | | | | tests. No need to pay the high cost when we're never going to do anything. No functionality changed. llvm-svn: 173331
* Spiff up the comment on this method, making the example a bit moreChandler Carruth2013-01-241-16/+35
| | | | | | | | | | | pretty in doxygen, adding some of the details actually present in a classic example where this matters (a loop from gzip and many other compression algorithms), and a cautionary note about the risks inherent in the transform. This has come up on the mailing lists recently, and I suspect folks reading this code could benefit from going and looking at the MI pass that can really deal with these issues. llvm-svn: 173329
* Remove trailing whitespace.Craig Topper2013-01-241-134/+134
| | | | llvm-svn: 173322
* Revert "InstCombine: Clean up weird code that talks about a modulus that's ↵Benjamin Kramer2013-01-231-1/+6
| | | | | | | | | long gone." This causes crashes during the build of compiler-rt during selfhost. Add a testcase for coverage. llvm-svn: 173279
* InstCombine: Clean up weird code that talks about a modulus that's long gone.Benjamin Kramer2013-01-231-6/+1
| | | | | | | This does the right thing unless the multiplication overflows, but the old code didn't handle that case either. llvm-svn: 173276
* Make sure metarenamer won't rename special stuff (intrinsics and explicitly ↵Anton Korobeynikov2013-01-231-3/+17
| | | | | | | | renamed stuff). Otherwise this might hide the problems. llvm-svn: 173265
* [asan] use ADD instead of OR when applying shadow offset of PowerPC. See ↵Kostya Serebryany2013-01-231-4/+15
| | | | | | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975 for details llvm-svn: 173258
OpenPOWER on IntegriCloud