Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Move variable into assert to avoid unused variable warning. | Eric Christopher | 2013-09-17 | 1 | -2/+1 |
| | | | | llvm-svn: 190886 | ||||
* | Costmodel: Add support for horizontal vector reductions | Arnold Schwaighofer | 2013-09-17 | 1 | -0/+272 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upcoming SLP vectorization improvements will want to be able to estimate costs of horizontal reductions. Add infrastructure to support this. We model reductions as a series of (shufflevector,add) tuples ultimately followed by an extractelement. For example, for an add-reduction of <4 x float> we could generate the following sequence: (v0, v1, v2, v3) \ \ / / \ \ / + + (v0+v2, v1+v3, undef, undef) \ / ((v0+v2) + (v1+v3), undef, undef) %rdx.shuf = shufflevector <4 x float> %rdx, <4 x float> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef> %bin.rdx = fadd <4 x float> %rdx, %rdx.shuf %rdx.shuf7 = shufflevector <4 x float> %bin.rdx, <4 x float> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef> %bin.rdx8 = fadd <4 x float> %bin.rdx, %rdx.shuf7 %r = extractelement <4 x float> %bin.rdx8, i32 0 This commit adds a cost model interface "getReductionCost(Opcode, Ty, Pairwise)" that will allow clients to ask for the cost of such a reduction (as backends might generate more efficient code than the cost of the individual instructions summed up). This interface is excercised by the CostModel analysis pass which looks for reduction patterns like the one above - starting at extractelements - and if it sees a matching sequence will call the cost model interface. We will also support a second form of pairwise reduction that is well supported on common architectures (haddps, vpadd, faddp). (v0, v1, v2, v3) \ / \ / (v0+v1, v2+v3, undef, undef) \ / ((v0+v1)+(v2+v3), undef, undef, undef) %rdx.shuf.0.0 = shufflevector <4 x float> %rdx, <4 x float> undef, <4 x i32> <i32 0, i32 2 , i32 undef, i32 undef> %rdx.shuf.0.1 = shufflevector <4 x float> %rdx, <4 x float> undef, <4 x i32> <i32 1, i32 3, i32 undef, i32 undef> %bin.rdx.0 = fadd <4 x float> %rdx.shuf.0.0, %rdx.shuf.0.1 %rdx.shuf.1.0 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef, <4 x i32> <i32 0, i32 undef, i32 undef, i32 undef> %rdx.shuf.1.1 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef> %bin.rdx.1 = fadd <4 x float> %rdx.shuf.1.0, %rdx.shuf.1.1 %r = extractelement <4 x float> %bin.rdx.1, i32 0 llvm-svn: 190876 | ||||
* | Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector ↵ | Craig Topper | 2013-07-11 | 1 | -1/+1 |
| | | | | | | size. llvm-svn: 186098 | ||||
* | Fix indentation. No functional change. | Craig Topper | 2013-07-11 | 1 | -8/+8 |
| | | | | llvm-svn: 186065 | ||||
* | CostModel: Add parameter to instruction cost to further classify operand values | Arnold Schwaighofer | 2013-04-04 | 1 | -1/+23 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On certain architectures we can support efficient vectorized version of instructions if the operand value is uniform (splat) or a constant scalar. An example of this is a vector shift on x86. We can efficiently support for (i = 0 ; i < ; i += 4) w[0:3] = v[0:3] << <2, 2, 2, 2> but not for (i = 0; i < ; i += 4) w[0:3] = v[0:3] << x[0:3] This patch adds a parameter to getArithmeticInstrCost to further qualify operand values as uniform or uniform constant. Targets can then choose to return a different cost for instructions with such operand values. A follow-up commit will test this feature on x86. radar://13576547 llvm-svn: 178807 | ||||
* | Cost model support for lowered math builtins. | Benjamin Kramer | 2013-02-28 | 1 | -0/+11 |
| | | | | | | | | | | We make the cost for calling libm functions extremely high as emitting the calls is expensive and causes spills (on x86) so performance suffers. We still vectorize important calls like ceilf and friends on SSE4.1. and fabs. Differential Revision: http://llvm-reviews.chandlerc.com/D466 llvm-svn: 176287 | ||||
* | Cost model: Add check for reverse shuffles to CostModel analysis | Arnold Schwaighofer | 2013-02-12 | 1 | -0/+18 |
| | | | | | | | | | | Check for reverse shuffles in the CostModel analysis pass and query TargetTransform info accordingly. This allows us we can write test cases for reverse shuffles. radar://13171406 llvm-svn: 174932 | ||||
* | ARM cost model: Address computation in vector mem ops not free | Arnold Schwaighofer | 2013-02-08 | 1 | -0/+5 |
| | | | | | | | | | | | | | | | Adds a function to target transform info to query for the cost of address computation. The cost model analysis pass now also queries this interface. The code in LoopVectorize adds the cost of address computation as part of the memory instruction cost calculation. Only there, we know whether the instruction will be scalarized or not. Increase the penality for inserting in to D registers on swift. This becomes necessary because we now always assume that address computation has a cost and three is a closer value to the architecture. radar://13097204 llvm-svn: 174713 | ||||
* | Move TargetTransformInfo to live under the Analysis library. This no | Chandler Carruth | 2013-01-07 | 1 | -1/+1 |
| | | | | | | | longer would violate any dependency layering and it is in fact an analysis. =] llvm-svn: 171686 | ||||
* | Switch the cost model analysis over to just the TTI interface. | Chandler Carruth | 2013-01-05 | 1 | -20/+15 |
| | | | | llvm-svn: 171619 | ||||
* | Move all of the header files which are involved in modelling the LLVM IR | Chandler Carruth | 2013-01-02 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366 | ||||
* | Update the docs of the cost model. | Nadav Rotem | 2012-12-24 | 1 | -3/+6 |
| | | | | llvm-svn: 171016 | ||||
* | constify the cost API | Nadav Rotem | 2012-12-03 | 1 | -7/+7 |
| | | | | llvm-svn: 169172 | ||||
* | Use the new script to sort the includes of every file under lib. | Chandler Carruth | 2012-12-03 | 1 | -2/+2 |
| | | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131 | ||||
* | CostModel: add support for Vector Insert and Extract. | Nadav Rotem | 2012-11-02 | 1 | -0/+18 |
| | | | | llvm-svn: 167329 | ||||
* | Add a cost model analysis that allows us to estimate the cost of IR-level ↵ | Nadav Rotem | 2012-11-02 | 1 | -0/+175 |
instructions. llvm-svn: 167324 |