summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* CVP: If we have a PHI with an incoming select, try to skip the select.Benjamin Kramer2013-02-241-5/+24
| | | | | | | | | | This is a common pattern with dyn_cast and similar constructs, when the PHI no longer depends on the select it can often be turned into a simpler construct or even get hoisted out of the loop. PR15340. llvm-svn: 175995
* Fixed a careless mistake.Michael Gottesman2013-02-231-1/+1
| | | | | | rdar://13273675. llvm-svn: 175939
* Implement the NoBuiltin attribute.Bill Wendling2013-02-222-1/+2
| | | | | | | | The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should not treat the callee function as a built-in function. I.e., it shouldn't try to replace that function with different code. llvm-svn: 175835
* Allow GlobalValues to vectorize with AliasAnalysisRenato Golin2013-02-211-35/+154
| | | | | | | | | | | | | | | | | | | | | Storing the load/store instructions with the values and inspect them using Alias Analysis to make sure they don't alias, since the GEP pointer operand doesn't take the offset into account. Trying hard to not add any extra cost to loads and stores that don't overlap on global values, AA is *only* calculated if all of the previous attempts failed. Using biggest vector register size as the stride for the vectorization access, as we're being conservative and the cost model (which calculates the real vectorization factor) is only run after the legalization phase. We might re-think this relationship in the future, but for now, I'd rather be safe than sorry. llvm-svn: 175818
* Remove dead code and whitespace.Chad Rosier2013-02-211-10/+0
| | | | llvm-svn: 175804
* Update a comment that looks to have been accidentally deleted many moons ago.Chad Rosier2013-02-201-1/+1
| | | | llvm-svn: 175658
* [asan] instrument invoke insns with noreturn attribute (as well as call insns)Kostya Serebryany2013-02-201-4/+5
| | | | llvm-svn: 175617
* Remove unused variable.Jakub Staszak2013-02-191-2/+1
| | | | llvm-svn: 175568
* Minor cleanups. No functionality change.Jakub Staszak2013-02-191-10/+7
| | | | llvm-svn: 175567
* Remove unneeded #includes.Jakub Staszak2013-02-191-2/+0
| | | | llvm-svn: 175565
* Fix typos.Jakub Staszak2013-02-191-10/+10
| | | | llvm-svn: 175562
* [asan] instrument memory accesses with unusual sizesKostya Serebryany2013-02-191-29/+49
| | | | | | | | | | | | | | | | | This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or packed structures. Instrumentation is done with two 1-byte checks (first and last bytes) and if the error is found __asan_report_load_n(addr, real_size) or __asan_report_store_n(addr, real_size) is called. Also, call these two new functions in memset/memcpy instrumentation. asan-rt part will follow. llvm-svn: 175507
* Temporarily revert r175470 for more review.Bill Wendling2013-02-191-3/+0
| | | | llvm-svn: 175476
* Check to see if the 'no-builtin' attribute is set before simplifying a ↵Bill Wendling2013-02-181-0/+3
| | | | | | library call. llvm-svn: 175470
* [asan] revert r175266 as it breaks code with packed structures. supporting ↵Kostya Serebryany2013-02-181-1/+1
| | | | | | long double will require a more general solution llvm-svn: 175442
* BBVectorize: Fix an invalid reference bugHal Finkel2013-02-171-4/+7
| | | | | | | | | | | | | | This fixes PR15289. This bug was introduced (recently) in r175215; collecting all std::vector references for candidate pairs to delete at once is invalid because subsequent lookups in the owning DenseMap could invalidate the references. bugpoint was able to reduce a useful test case. Unfortunately, because whether or not this asserts depends on memory layout, this test case will sometimes appear to produce valid output. Nevertheless, running under valgrind will reveal the error. llvm-svn: 175397
* The transform is:Bill Wendling2013-02-161-0/+14
| | | | | | | | | | | | | | | (or (bool?A:B),(bool?C:D)) --> (bool?(or A,C):(or B,D)) By the time the OR is visited, both the SELECTs have been visited and not optimized and the OR itself hasn't been transformed so we do this transform in the hopes that the new ORs will be optimized. The transform is explicitly disabled for vector-selects until "codegen matures to handle them better". Patch by Muhammad Tauqir! llvm-svn: 175380
* Reduce indents in LSRInstance::NarrowSearchSpaceByCollapsingUnrolledCode method.Jakub Staszak2013-02-161-67/+67
| | | | | | No functionality change. llvm-svn: 175364
* BBVectorize: Call a DAG and DAG instead of a treeHal Finkel2013-02-151-84/+84
| | | | | | | | | | Several functions and variable names used the term 'tree' to refer to what is actually a DAG. Correcting this mistake will, hopefully, prevent confusion in the future. No functionality change intended. llvm-svn: 175278
* Fix refactoring mistake in "Teach InstCombine to work with smaller legal ↵Arnaud A. de Grandmaison2013-02-151-1/+1
| | | | | | types..." llvm-svn: 175273
* Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2Arnaud A. de Grandmaison2013-02-151-0/+19
| | | | | | | | | It enables to work with a smaller constant, which is target friendly for those which can compare to immediates. It also avoids inserting a shift in favor of a trunc, which can be free on some targets. This used to work until LLVM-3.1, but regressed with the 3.2 release. llvm-svn: 175270
* [asan] support long double on 64-bit. See ↵Kostya Serebryany2013-02-151-1/+1
| | | | | | https://code.google.com/p/address-sanitizer/issues/detail?id=151 llvm-svn: 175266
* Make helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C ↵Benjamin Kramer2013-02-151-0/+1
| | | | | | linkage. llvm-svn: 175264
* BBVectorize: Cap the number of candidate pairs in each instruction groupHal Finkel2013-02-151-1/+9
| | | | | | | | | | | | | | | | | | | | | | | For some basic blocks, it is possible to generate many candidate pairs for relatively few pairable instructions. When many (tens of thousands) of these pairs are generated for a single instruction group, the time taken to generate and rank the different vectorization plans can become quite large. As a result, we now cap the number of candidate pairs within each instruction group. This is done by closing out the group once the threshold is reached (set now at 3000 pairs). Although this will limit the overall compile-time impact, this may not be the best way to achieve this result. It might be better, for example, to prune excessive candidate pairs after the fact the prevent the generation of short, but highly-connected groups. We can experiment with this in the future. This change reduces the overall compile-time slowdown of the csa.ll test case in PR15222 to ~5x. If 5x is still considered too large, a lower limit can be used as the default. This represents a functionality change, but only for very large inputs (thus, there is no regression test). llvm-svn: 175251
* BBVectorize: Remove the remaining instances of std::multimapHal Finkel2013-02-141-231/+256
| | | | | | | | | | All instances of std::multimap have now been replaced by DenseMap<K, std::vector<V> >, and this yields a speedup of 5% on the csa.ll test case from PR15222. No functionality change intended. llvm-svn: 175216
* BBVectorize: Don't store candidate pairs in a std::multimapHal Finkel2013-02-141-60/+92
| | | | | | | | | | This is another commit on the road to removing std::multimap from BBVectorize. This gives an ~1% speedup on the csa.ll test case in PR15222. No functionality change intended. llvm-svn: 175215
* Retain the name of the new internal global that's been shrunk.Bill Wendling2013-02-131-2/+5
| | | | | | | | | It's possible (e.g. after an LTO build) that an internal global may be used for debugging purposes. If that's the case appending a '.b' to it makes it hard to find that variable. Steal the name from the old GV before deleting it so that they can find that variable again. llvm-svn: 175104
* LoopVectorize: Simplify code for clarity.Benjamin Kramer2013-02-131-10/+8
| | | | | | No functionality change. llvm-svn: 175076
* Metadata for annotating loops as parallel. The first consumer for this Pekka Jaaskelainen2013-02-131-0/+8
| | | | | | | | metadata is the loop vectorizer. See the documentation update for more info. llvm-svn: 175060
* [asan] fix confusing indentationKostya Serebryany2013-02-131-1/+2
| | | | llvm-svn: 175033
* Fix commentArnaud A. de Grandmaison2013-02-131-2/+2
| | | | | | visitSExt is an adapted copy of the related visitZExt method, so adapt the comment accordingly. llvm-svn: 175019
* Changed isStoredObjCPointer => IsStoredObjCPointer. No functionality change.Michael Gottesman2013-02-121-4/+4
| | | | llvm-svn: 175017
* Actually delete this code, since it's really not clear what it'sDan Gohman2013-02-121-24/+0
| | | | | | trying to do. llvm-svn: 175014
* Record PRE predecessors with a SmallVector instead of a DenseMap, andDan Gohman2013-02-121-8/+9
| | | | | | avoid a second pred_iterator traversal. llvm-svn: 175001
* When disabling PRE for a value is directly redundant with itselfDan Gohman2013-02-121-0/+2
| | | | | | | (through a loop), don't continue to iterate through the reamining predecessors. llvm-svn: 174994
* Check that pointers are removed from maps before calling delete on the pointers,Dan Gohman2013-02-121-3/+3
| | | | | | for tidiness' sake. llvm-svn: 174988
* Minor code simplification.Dan Gohman2013-02-121-1/+1
| | | | llvm-svn: 174985
* [ASan] Do not use kDefaultShort64bitShadowOffset on Mac, where the binaries ↵Alexander Potapenko2013-02-121-1/+2
| | | | | | may get mapped at 0x100000000+ and thus may interleave with the shadow. llvm-svn: 174964
* [asan] change the default mapping offset on x86_64 to 0x7fff8000. This gives ↵Kostya Serebryany2013-02-121-3/+5
| | | | | | roughly 5% speedup. Since this is an ABI change, bump the asan ABI version by renaming __asan_init to __asan_init_v1. llvm part, compiler-rt part will follow llvm-svn: 174957
* BBVectorize: Don't over-search when building the dependency mapHal Finkel2013-02-111-2/+10
| | | | | | | | | | | | | When building the pairable-instruction dependency map, don't search past the last pairable instruction. For large blocks that have been divided into multiple instruction groups, searching past the last instruction in each group is very wasteful. This gives a 32% speedup on the csa.ll test case from PR15222 (when using 50 instructions in each group). No functionality change intended. llvm-svn: 174915
* BBVectorize: Omit unnecessary entries in PairableInstUsersHal Finkel2013-02-111-1/+3
| | | | | | | | | | | This map is queried only for instructions in pairs of pairable instructions; so make sure that only pairs of pairable instructions are added to the map. This gives a 3.5% speedup on the csa.ll test case from PR15222. No functionality change intended. llvm-svn: 174914
* Optimization: bitcast (<1 x ...> insertelement ..., X, ...) to ... ==> ↵Michael Ilseman2013-02-111-5/+16
| | | | | | bitcast X to ... llvm-svn: 174905
* BBVectorize: Eliminate one more restricted linear searchHal Finkel2013-02-111-27/+31
| | | | | | | | | | This eliminates one more linear search over a range of std::multimap entries. This gives a 22% speedup on the csa.ll test case from PR15222. No functionality change intended. llvm-svn: 174893
* [asan] added a flag -mllvm asan-short-64bit-mapping-offset=1 (0 by default)Kostya Serebryany2013-02-111-2/+8
| | | | | | | | | | This flag makes asan use a small (<2G) offset for 64-bit asan shadow mapping. On x86_64 this saves us a register, thus achieving ~2/3 of the zero-base-offset's benefits in both performance and code size. Thanks Jakub Jelinek for the idea. llvm-svn: 174886
* BBVectorize: Remove the linear searches from pair connection searchingHal Finkel2013-02-111-24/+11
| | | | | | | | | This removes the last of the linear searches over ranges of std::multimap iterators, giving a 7% speedup on the doduc.bc input from PR15222. No functionality change intended. llvm-svn: 174859
* BBVectorize: Avoid linear searches within the load-move setHal Finkel2013-02-111-20/+30
| | | | | | | | | This is another cleanup aimed at eliminating linear searches in ranges of std::multimap. No functionality change intended. llvm-svn: 174858
* BBVectorize: isa/cast cleanup in getInstructionTypesHal Finkel2013-02-111-4/+4
| | | | | | | | | | Profiling suggests that getInstructionTypes is performance-sensitive, this cleans up some double-casting in that function in favor of using dyn_cast. No functionality change intended. llvm-svn: 174857
* BBVectorize: Make the bookkeeping to support full cycle checking less expensiveHal Finkel2013-02-111-14/+25
| | | | | | | | | | | By itself, this does not have much of an effect, but only because in the default configuration the full cycle checks are used only for small problem sizes. This is part of a general cleanup of uses of iteration over std::multimap ranges only for the purpose of checking membership. No functionality change intended. llvm-svn: 174856
* LSR IVChain improvement.Andrew Trick2013-02-091-1/+13
| | | | | | | | | Handle chains in which the same offset is used for both loads and stores to the same array. Fixes rdar://11410078. llvm-svn: 174789
* Remove #includes from the commonly used LoopInfo.h.Jakub Staszak2013-02-093-0/+3
| | | | llvm-svn: 174786
OpenPOWER on IntegriCloud