summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/BBVectorize
Commit message (Collapse)AuthorAgeFilesLines
...
* BBVectorize: Use target costs for incoming and outgoing values instead of ↵Hal Finkel2012-11-012-11/+99
| | | | | | | | | | | the depth heuristic. When target cost information is available, compute explicit costs of inserting and extracting values from vectors. At this point, all costs are estimated using the target information, and the chain-depth heuristic is not needed. As a result, it is now, by default, disabled when using target costs. llvm-svn: 167256
* BBVectorize: Choose pair ordering to minimize shufflesHal Finkel2012-10-319-21/+46
| | | | | | | | | | | | | | | | | | | | BBVectorize would, except for loads and stores, always fuse instructions so that the first instruction (in the current source order) would always represent the low part of the input vectors and the second instruction would always represent the high part. This lead to too many shuffles being produced because sometimes the opposite order produces fewer of them. With this change, BBVectorize tracks the kind of pair connections that form the DAG of candidate pairs, and uses that information to reorder the pairs to avoid excess shuffles. Using this information, a future commit will be able to add VTTI-based shuffle costs to the pair selection procedure. Importantly, the number of remaining shuffles can now be estimated during pair selection. There are some trivial instruction reorderings in the test cases, and one simple additional test where we certainly want to do a reordering to avoid an unnecessary shuffle. llvm-svn: 167122
* BBVectorize: Fix a small bug introduced in r167042.Hal Finkel2012-10-301-0/+28
| | | | | | | We need to make sure that we take the correct load/store alignment when the inputs are flipped. llvm-svn: 167044
* Remove an invalid assert in TargetTransformImplHal Finkel2012-10-301-0/+12
| | | | | | | getCastInstrCost had an assert prohibiting scalar to vector casts. Such casts, however, are allowed. This should make the vectorizer buildbot happier. llvm-svn: 166998
* Move target-specific BBVectorize tests into a separate directory.Hal Finkel2012-10-265-11/+142
| | | | llvm-svn: 166802
* Disable generation of pointer vectors by BBVectorize.Hal Finkel2012-10-261-0/+3
| | | | | | Once vector-of-pointer support works, then this can be reverted. llvm-svn: 166741
* Add CPU model to BBVectorize cost-model tests.Hal Finkel2012-10-252-3/+3
| | | | llvm-svn: 166720
* Begin incorporating target information into BBVectorize.Hal Finkel2012-10-252-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | This is the first of several steps to incorporate information from the new TargetTransformInfo infrastructure into BBVectorize. Two things are done here: 1. Target information is used to determine if it is profitable to fuse two instructions. This means that the cost of the vector operation must not be more expensive than the cost of the two original operations. Pairs that are not profitable are no longer considered (because current cost information is incomplete, for intrinsics for example, equal-cost pairs are still considered). 2. The 'cost savings' computed for the profitability check are also used to rank the DAGs that represent the potential vectorization plans. Specifically, for nodes of non-trivial depth, the cost savings is used as the node weight. The next step will be to incorporate the shuffle costs into the DAG weighting; this will give the edges of the DAG weights as well. Once that is done, when target information is available, we should be able to dispense with the depth heuristic. llvm-svn: 166716
* BBVectorize should ignore unreachable blocks.Hal Finkel2012-10-221-0/+32
| | | | | | | | | Unreachable blocks can have invalid instructions. For example, jump threading can produce self-referential instructions in unreachable blocks. Also, we should not be spending time optimizing unreachable code. Fixes PR14133. llvm-svn: 166423
* DataLayout should use itself when calculating the size of a vector.Hal Finkel2012-10-211-0/+50
| | | | | | | | This is important for vectors of pointers because only DataLayout, not the underlying vector type, knows how to calculate the size of the pointers in the vector. Fixes PR14138. llvm-svn: 166401
* Allow BBVectorize to form non-2^n-length vectors.Hal Finkel2012-06-282-2/+36
| | | | | | | | | | | | | | | | | | | | The original algorithm only used recursive pair fusion of equal-length types. This is now extended to allow pairing of any types that share the same underlying scalar type. Because we would still generally prefer the 2^n-length types, those are formed first. Then a second set of iterations form the non-2^n-length types. Also, a call to SimplifyInstructionsInBlock has been added after each pairing iteration. This takes care of DCE (and a few other things) that make the following iterations execute somewhat faster. For the same reason, some of the simple shuffle-combination cases are now handled internally. There is some additional refactoring work to be done, but I've had many requests for this feature, so additional refactoring will come soon in future commits (as will additional test cases). llvm-svn: 159330
* Allow controlling vectorization of boolean values separately from other ↵Hal Finkel2012-06-241-0/+3
| | | | | | | | integer types. These are used as the result of comparisons, and often handled differently from larger integer types. llvm-svn: 159111
* Allow BBVectorize to fuse compare instructions.Hal Finkel2012-06-231-0/+26
| | | | llvm-svn: 159088
* Teach BBVectorize to combine, when possible, or discard metadata when fusing ↵Hal Finkel2012-06-161-0/+49
| | | | | | | | | | | | instructions. The present implementation handles only TBAA and FP metadata, discarding everything else. For debug metadata, the current behavior is maintained (the debug metadata associated with one of the instructions will be kept, discarding that attached to the other). This should address PR 13040. llvm-svn: 158606
* Don't vectorize target-specific types (ppc_fp128, x86_fp80, etc.).Hal Finkel2012-04-271-0/+18
| | | | | | | | | | Target specific types should not be vectorized. As a practical matter, these types are already register matched (at least in the x86 case), and codegen does not always work correctly (at least in the ppc case, and this is not worth fixing because ppc_fp128 is currently broken and will probably go away soon). llvm-svn: 155729
* Fix an error in BBVectorize important for vectorizing pointer types.Hal Finkel2012-04-141-0/+23
| | | | | | | | | | When vectorizing pointer types it is important to realize that potential pairs cannot be connected via the address pointer argument of a load or store. This is because even after vectorization, the address is still a scalar because the address of the higher half of the pair is implicit from the address of the lower half (it need not be, and should not be, explicitly computed). llvm-svn: 154735
* Enhance BBVectorize to more-properly handle pointer values and vectorize GEPs.Hal Finkel2012-04-141-0/+81
| | | | llvm-svn: 154734
* Add support to BBVectorize for vectorizing selects.Hal Finkel2012-04-131-0/+30
| | | | llvm-svn: 154700
* Correctly vectorize powi.Hal Finkel2012-03-311-0/+44
| | | | | | | | The powi intrinsic requires special handling because it always takes a single integer power regardless of the result type. As a result, we can vectorize only if the powers are equal. Fixes PR12364. llvm-svn: 153797
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-3/+1
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Update BBVectorize to use aliasesUnknownInst.Hal Finkel2012-02-101-0/+244
| | | | | | | | This allows BBVectorize to check the "unknown instruction" list in the alias sets. This is important to prevent instruction fusing from reordering function calls. Resolves PR11920. llvm-svn: 150250
* Boost the effective chain depth of loads and stores.Hal Finkel2012-02-041-0/+22
| | | | | | By default, boost the chain depth contribution of loads and stores. This will allow a load/store pair to vectorize even when it would not otherwise be long enough to satisfy the chain depth requirement. llvm-svn: 149761
* Add a basic-block autovectorization pass.Hal Finkel2012-02-019-0/+633
This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure. Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser). llvm-svn: 149468
OpenPOWER on IntegriCloud