summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Add back FoldOpIntoPhi optimizations with fix. Included test cases to help ↵Michael Ilseman2012-12-141-0/+4
| | | | | | catch these errors and to test the presence of the optimization itself llvm-svn: 170248
* Enable the loop vectorizer by default.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170246
* rdar://12753946Shuxin Yang2012-12-141-0/+32
| | | | | | Implement rule : "x * (select cond 1.0, 0.0) -> select cond x, 0.0" llvm-svn: 170226
* Fix lint warnings in MemorySanitizer.cpp.Evgeniy Stepanov2012-12-141-9/+12
| | | | llvm-svn: 170203
* [msan] Origin stores and loads do not need explicit alignment.Evgeniy Stepanov2012-12-141-9/+8
| | | | | | Origin address is always 4 byte aligned, and the access type is always i32. llvm-svn: 170199
* [msan] Refactor default shadow propagation and origin tracking.Evgeniy Stepanov2012-12-141-52/+117
| | | | | | | | This change moves the code for default shadow propagaition (handleShadowOr) and origin tracking (setOriginForNaryOp) into a new builder-like class. Also gets rid of handleShadowOrBinary. llvm-svn: 170192
* revert r170166 - disable the loop vectorizer.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170172
* Enable the loop vectorizer.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170166
* Disable the loop vectorizer.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170162
* Enable the Loop Vectorizer by default for O2 and O3. Disable if-conversion ↵Nadav Rotem2012-12-132-2/+2
| | | | | | by default. I plan to revert this patch later today. llvm-svn: 170157
* Revert r170020, "Simplify negated bit test", for now.NAKAMURA Takumi2012-12-131-18/+0
| | | | | | | | | This assumes (1 << n) is always not zero. Consider n is greater than word size. Although I know it is undefined, this transforms undefined behavior hidden. This led clang unexpected behavior with some failures. I will investigate to fix undefined shl in clang. llvm-svn: 170128
* Revert "Restore the PHI optimization I accidently removed" temporarily sinceEric Christopher2012-12-131-4/+0
| | | | | | | | it seems to be breaking self-host for a few people and is PR14592. This reverts commit r170024. llvm-svn: 170106
* Missed these calls from the previous rename somehow.Rafael Espindola2012-12-131-2/+2
| | | | llvm-svn: 170094
* Rename isPowerOfTwo to isKnownToBeAPowerOfTwo.Rafael Espindola2012-12-131-2/+2
| | | | | | | | In a previous thread it was pointed out that isPowerOfTwo is not a very precise name since it can return false for powers of two if it is unable to show that they are powers of two. llvm-svn: 170093
* Pattern matching code for intrinsics.Michael Ilseman2012-12-131-15/+17
| | | | | | Provides m_Argument that allows matching against a CallSite's specified argument. Provides m_Intrinsic pattern that can be templatized over the intrinsic id and bind/match arguments similarly to other pattern matchers. Implementations provided for 0 to 4 arguments, though it's very simple to extend for more. Also provides example template specialization for bswap (m_BSwap) and example of code cleanup for its use. llvm-svn: 170091
* Take into account minimize size attribute in the inliner.Quentin Colombet2012-12-131-2/+4
| | | | | | | | | Better controls the inlining of functions when the caller function has MinSize attribute. Basically, when the caller function has this attribute, we do not "force" the inlining of callee functions carrying the InlineHint attribute (i.e., functions defined with inline keyword) llvm-svn: 170065
* Teach the cost model about the optimization in r169904: Truncation of ↵Nadav Rotem2012-12-132-2/+20
| | | | | | induction variables costs the same as scalar trunc. llvm-svn: 170051
* Typo.Chad Rosier2012-12-131-1/+1
| | | | llvm-svn: 170050
* Restore the PHI optimization I accidently removedMichael Ilseman2012-12-121-0/+4
| | | | llvm-svn: 170024
* Remove trailing whitespaceMichael Ilseman2012-12-121-39/+39
| | | | llvm-svn: 170022
* Simplify negated bit testDavid Majnemer2012-12-121-0/+18
| | | | llvm-svn: 170020
* Fix indentation.Nadav Rotem2012-12-121-4/+3
| | | | llvm-svn: 170005
* LoopVectorizer: Use the "optsize" attribute to decide if we are allowed to ↵Nadav Rotem2012-12-123-8/+13
| | | | | | increase the function size. llvm-svn: 170004
* The TargetData is not used for the isPowerOfTwo determination. It has neverRafael Espindola2012-12-121-3/+2
| | | | | | | | | | been used in the first place. It simply was passed to the function and to the recursive invocations. Simply drop the parameter and update the callers for the new signature. Patch by Saleem Abdulrasool! llvm-svn: 169988
* Improve debug info generated with enabled AddressSanitizer.Alexey Samsonov2012-12-122-0/+39
| | | | | | | | | | | | When ASan replaces <alloca instruction> with <offset into a common large alloca>, it should also patch llvm.dbg.declare calls and replace debug info descriptors to mark that we've replaced alloca with a value that stores an address of the user variable, not the user variable itself. See PR11818 for more context. llvm-svn: 169984
* Fix the ascii drawing that was ruined when I split the H and CPPNadav Rotem2012-12-121-10/+10
| | | | llvm-svn: 169955
* fix a typo.Nadav Rotem2012-12-121-1/+1
| | | | llvm-svn: 169953
* LoopVectorizer: When -Os is used, vectorize only loops that dont require a ↵Nadav Rotem2012-12-124-29/+68
| | | | | | tail loop. There is no testcase because I dont know of a way to initialize the loop vectorizer pass without adding an additional hidden flag. llvm-svn: 169950
* - Fix a problematic way in creating all-the-1 APInt.Shuxin Yang2012-12-121-2/+4
| | | | | | - Propagate "exact" bit of [l|a]shr instruction. llvm-svn: 169942
* Remove redunant optimizations from InstCombine, instead call the appropriate ↵Michael Ilseman2012-12-122-30/+9
| | | | | | functions from SimplifyInstruction llvm-svn: 169941
* PR14574. Fix a bug in the code that calculates the mask the converted PHIs ↵Nadav Rotem2012-12-111-1/+1
| | | | | | in if-conversion. llvm-svn: 169916
* Loop Vectorize: optimize the vectorization of trunc(induction_var). The ↵Nadav Rotem2012-12-111-1/+13
| | | | | | truncation is now done on scalars. llvm-svn: 169904
* Use an ArrayRef instead of a std::vector&.Rafael Espindola2012-12-111-4/+4
| | | | llvm-svn: 169881
* [msan] Use explicitely aligned stores and loads with function argument shadow.Evgeniy Stepanov2012-12-111-8/+13
| | | | | | | | Use explicitely aligned store and load instructions to deal with argument and retval shadow. This matters when an argument's alignment is higher than __msan_param_tls alignment (which is the case with __m128i). llvm-svn: 169859
* Revert EVT->MVT changes, r169836-169851, due to buildbot failures.Patrik Hagglund2012-12-111-1/+1
| | | | llvm-svn: 169854
* Change TargetLowering::getLoadExtAction to take an MVT, instead of EVT.Patrik Hagglund2012-12-111-1/+1
| | | | llvm-svn: 169840
* Fix PR14565. Don't if-convert loops that have switch statements in them.Nadav Rotem2012-12-111-0/+4
| | | | llvm-svn: 169813
* Enable the loop vectorizer only on O2 and above. (Still disabled by default)Nadav Rotem2012-12-101-1/+1
| | | | llvm-svn: 169774
* Split the LoopVectorizer into H and CPP.Nadav Rotem2012-12-102-951/+993
| | | | llvm-svn: 169771
* Don't use a red zone for code coverage if the user specified `-mno-red-zone'.Bill Wendling2012-12-101-4/+17
| | | | | | | | | The `-mno-red-zone' flag wasn't being propagated to the functions that code coverage generates. This allowed some of them to use the red zone when that wasn't allowed. <rdar://problem/12843084> llvm-svn: 169754
* Add support for reverse induction variables. For example:Nadav Rotem2012-12-101-90/+191
| | | | | | | while (i--) sum+=A[i]; llvm-svn: 169752
* Add a new visitor for walking the uses of a pointer value.Chandler Carruth2012-12-101-219/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This visitor provides infrastructure for recursively traversing the use-graph of a pointer-producing instruction like an alloca or a malloc. It maintains a worklist of uses to visit, so it can handle very deep recursions. It automatically looks through instructions which simply translate one pointer to another (bitcasts and GEPs). It tracks the offset relative to the original pointer as long as that offset remains constant and exposes it during the visit as an APInt offset. Finally, it performs conservative escape analysis. However, currently it has some limitations that should be addressed going forward: 1) It doesn't handle vectors of pointers. 2) It doesn't provide a cheaper visitor when the constant offset tracking isn't needed. 3) It doesn't support non-instruction pointer values. The current functionality is exactly what is required to implement the SROA pointer-use visitors in terms of this one, rather than in terms of their own ad-hoc base visitor, which was always very poorly specified. SROA has been converted to use this, and the code there deleted which this utility now provides. Technically speaking, using this new visitor allows SROA to handle a few more cases than it previously did. It is now more aggressive in ignoring chains of instructions which look like they would defeat SROA, but in fact do not because they never result in a read or write of memory. While this is "neat", it shouldn't be interesting for real programs as any such chains should have been removed by others passes long before we get to SROA. As a consequence, I've not added any tests for these features -- it shouldn't be part of SROA's contract to perform such heroics. The goal is to extend the functionality of this visitor going forward, and re-use it from passes like ASan that can benefit from doing a detailed walk of the uses of a pointer. Thanks to Ben Kramer for the code review rounds and lots of help reviewing and debugging this patch. llvm-svn: 169728
* Fix PR14548: SROA was crashing on a mixture of i1 and i8 loads and stores.Chandler Carruth2012-12-101-2/+2
| | | | | | | | | | | | | | | | | | | When SROA was evaluating a mixture of i1 and i8 loads and stores, in just a particular case, it would tickle a latent bug where we compared bits to bytes rather than bits to bits. As a consequence of the latent bug, we would allow integers through which were not byte-size multiples, a situation the later rewriting code was never intended to handle. In release builds this could trigger all manner of oddities, but the reported issue in PR14548 was forming invalid bitcast instructions. The only downside of this fix is that it makes it more clear that SROA in its current form is not capable of handling mixed i1 and i8 loads and stores. Sometimes with the previous code this would work by luck, but usually it would crash, so I'm not terribly worried. I'll watch the LNT numbers just to be sure. llvm-svn: 169719
* LoopVectorize: support vectorizing intrinsic callsPaul Redmond2012-12-091-2/+55
| | | | | | | | | - added function to VectorTargetTransformInfo to query cost of intrinsics - vectorize trivially vectorizable intrinsic calls such as sin, cos, log, etc. Reviewed by: Nadav llvm-svn: 169711
* test commit.Paul Redmond2012-12-091-1/+1
| | | | llvm-svn: 169709
* Use m_OneUse pattern instead of hasOneUse() method.Jakub Staszak2012-12-091-7/+4
| | | | | | No functionality change. llvm-svn: 169703
* Remove trailing spaces.Jakub Staszak2012-12-091-80/+80
| | | | llvm-svn: 169701
* Switch SROA to pop Uses off the back of its visitors' queues.Chandler Carruth2012-12-091-10/+8
| | | | | | | | This will more closely match the behavior of the new PtrUseVisitor that I am adding. Hopefully this will not change the actual behavior in any way, but by making the processing order more similar help in debugging. llvm-svn: 169697
* - Re-enable population count loop idiom recognization Shuxin Yang2012-12-091-19/+516
| | | | | | | - fix a bug which cause sigfault. - add two testing cases which was causing crash llvm-svn: 169687
* Revert the patches adding a popcount loop idiom recognition pass.Chandler Carruth2012-12-081-513/+19
| | | | | | | | | | | | | | There are still bugs in this pass, as well as other issues that are being worked on, but the bugs are crashers that occur pretty easily in the wild. Test cases have been sent to the original commit's review thread. This reverts the commits: r169671: Fix a logic error. r169604: Move the popcnt tests to an X86 subdirectory. r168931: Initial commit adding the pass. llvm-svn: 169683
OpenPOWER on IntegriCloud