summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize
AgeCommit message (Collapse)AuthorFilesLines
2012-10-18remove unused variable to fix a warning.Nadav Rotem1-2/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166170 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Remove the use of dominators and AA.Nadav Rotem1-8/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166167 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Vectorizer: Add support for loops with an unknown count. For example:Nadav Rotem1-68/+159
for (i=0; i<n; i++){ a[i] = b[i+1] + c[i+3]; } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166165 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17LoopVectorize.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi1-2/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166153 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17Remove redundant SetInsertPoint call.Jakub Staszak1-1/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166138 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17Fix some typos and wrong indenting.Roman Divacky1-4/+4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166128 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17Add a loop vectorizer.Nadav Rotem3-2/+808
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166112 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08Move TargetData to DataLayout.Micah Villmow1-4/+4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru1-1/+1
See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27Fix a typo 'iff' => 'if'Sylvestre Ledru1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29Make MemoryBuiltins aware of TargetLibraryInfo.Benjamin Kramer1-1/+1
This disables malloc-specific optimization when -fno-builtin (or -ffreestanding) is specified. This has been a problem for a long time but became more severe with the recent memory builtin improvements. Since the memory builtin functions are used everywhere, this required passing TLI in many places. This means that functions that now have an optional TLI argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead mallocs anymore if the TLI argument is missing. I've updated most passes to do the right thing. Fixes PR13694 and probably others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162841 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28Precompute SCEV pointer analysis prior to instruction fusion in BBVectorize.Hal Finkel1-10/+51
When both a load/store and its address computation are being vectorized, it can happen that the address-computation vectorization destroys SCEV's ability to analyize the relative pointer offsets. As a result (like with the aliasing analysis info), we need to precompute the necessary information prior to instruction fusing. This was found during stress testing (running through the test suite with a very low required chain length); unfortunately, I don't have a small test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28Remove a useless check in BBVectorize.Hal Finkel1-5/+0
A shuffle mask will always be a constant, but I did not realize that when I originally wrote the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28Allow BBVectorize to form non-2^n-length vectors.Hal Finkel1-132/+532
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159330 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28Refactor operation equivalence checking in BBVectorize by extending ↵Hal Finkel1-23/+2
Instruction::isSameOperationAs. Maintaining this kind of checking in different places is dangerous, extending Instruction::isSameOperationAs consolidates this logic into one place. Here I've added an optional flags parameter and two flags that are important for vectorization: CompareIgnoringAlignment and CompareUsingScalarTypes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159329 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-24llvm/lib: [CMake] Add explicit dependency to intrinsics_gen.NAKAMURA Takumi1-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159112 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-24Allow controlling vectorization of boolean values separately from other ↵Hal Finkel1-4/+14
integer types. These are used as the result of comparisons, and often handled differently from larger integer types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159111 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-23Allow BBVectorize to fuse compare instructions.Hal Finkel1-0/+8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159088 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-16Teach BBVectorize to combine, when possible, or discard metadata when fusing ↵Hal Finkel1-0/+30
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158606 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-27Don't vectorize target-specific types (ppc_fp128, x86_fp80, etc.).Hal Finkel1-0/+6
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155729 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16Fix style violation in BBVectorize (pointed out by Bill Wendling)Hal Finkel1-3/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154810 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16Simplify checking for pointer types in BBVectorize (this change was ↵Hal Finkel1-5/+2
suggested by Duncan). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154787 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-14Fix an error in BBVectorize important for vectorizing pointer types.Hal Finkel1-0/+31
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154735 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-14Enhance BBVectorize to more-properly handle pointer values and vectorize GEPs.Hal Finkel1-2/+27
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154734 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13Add support to BBVectorize for vectorizing selects.Hal Finkel1-0/+8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154700 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-07Refactor: Use positive field names in VectorizeConfig.Hongbin Zheng1-13/+15
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-05BBVectorize: Add the const modifier to the VectorizeConfig because we won'tHongbin Zheng1-1/+1
modify it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154098 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-05Introduce the VectorizeConfig class, with which we can control the behaviorHongbin Zheng1-32/+60
of the BBVectorizePass without using command line option. As pointed out by Hal, we can ask the TargetLoweringInfo for the architecture specific VectorizeConfig to perform vectorizing with architecture specific information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-05Add the function "vectorizeBasicBlock" which allow users vectorize aHongbin Zheng1-5/+19
BasicBlock in other passes, e.g. we can call vectorizeBasicBlock in the loop unroll pass right after the loop is unrolled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31Correctly vectorize powi.Hal Finkel1-11/+33
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153797 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05fix typosSebastian Pop1-7/+7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152035 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05remove spaces on empty linesSebastian Pop1-9/+9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152034 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10Update BBVectorize to use aliasesUnknownInst.Hal Finkel1-9/+3
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150250 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06fix indentationSebastian Pop1-9/+9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149857 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05Simplify contains tests using 'count'.David Blaikie1-2/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05BBVectorize.cpp: Get rid of comparision to bool to fix a warning.NAKAMURA Takumi1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149810 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04Boost the effective chain depth of loads and stores.Hal Finkel1-0/+10
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149761 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-02BBVectorize: Simplify code, no functionality change.Benjamin Kramer1-9/+3
Also silences warnings about bodyless for loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-02Minor changes from review.Hal Finkel1-19/+17
As suggested by Nick Lewycky, the tree traversal queues have been changed to SmallVectors and the associated loops have been rotated. Also, an 80-col violation was fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149607 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-02Vectorize long blocks in groups.Hal Finkel1-41/+90
Long basic blocks with many candidate pairs (such as in the SHA implementation in Perl 5.14; thanks to Roman Divacky for the example) used to take an unacceptably-long time to compile. Instead, break long blocks into groups so that no group has too many candidate pairs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01BBVectorize.cpp: Try to fix MSVC build. map::iterator and multimap::iterator ↵NAKAMURA Takumi1-2/+2
are incompatible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149475 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01A few of the changes suggested in code review (by Nick Lewycky)Hal Finkel1-7/+8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149472 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01Add a basic-block autovectorization pass.Hal Finkel5-0/+1878
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149468 91177308-0d34-0410-b5e6-96231b3b80d8