summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* DAGCombiner: Don't fold vector muls with constants that look like a splat of ↵Benjamin Kramer2013-09-191-3/+7
| | | | | | | | a power of 2 but differ in bit width. PR17283. llvm-svn: 191000
* Debug info: Get rid of the VLA indirection hack in FastISel.Adrian Prantl2013-09-181-15/+10
| | | | | | | | Use the DIVariable::isIndirect() flag set by the frontend instead of guessing whether to set the machine location's indirection bit. Paired commit with CFE. llvm-svn: 190961
* Costmodel: Add support for horizontal vector reductionsArnold Schwaighofer2013-09-171-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added documentation to getMemsetStores.Serge Pavlov2013-09-171-0/+18
| | | | llvm-svn: 190866
* [SelectionDAG] Teach the vector scalarizer about TRUNCATE.Quentin Colombet2013-09-172-3/+4
| | | | | | | | | | | When a truncate node defines a legal vector type but uses an illegal vector type, the legalization process was splitting the vector until <1 x vector> type, but then it was failing to scalarize the node because it did not know how to handle TRUNCATE. <rdar://problem/14989896> llvm-svn: 190830
* Debug info: Fix PR16736 and rdar://problem/14990587.Adrian Prantl2013-09-165-5/+7
| | | | | | | A DBG_VALUE is register-indirect iff the first operand is a register _and_ the second operand is an immediate. llvm-svn: 190821
* Use reference instead of copy.Jakub Staszak2013-09-161-2/+2
| | | | llvm-svn: 190813
* Implement function prefix data as an IR feature.Peter Collingbourne2013-09-161-0/+4
| | | | | | | | | Previous discussion: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html Differential Revision: http://llvm-reviews.chandlerc.com/D1191 llvm-svn: 190773
* Replace some unnecessary vector copies with references.Benjamin Kramer2013-09-151-2/+2
| | | | llvm-svn: 190770
* Prevent assert in CombinerGlobalAA with null valuesHal Finkel2013-09-151-1/+1
| | | | | | | DAGCombiner::isAlias can be called with SrcValue1 or SrcValue2 null, and we can't use AA in this case (if we try, then the casting code in AA will assert). llvm-svn: 190763
* [Peephole] Rewrite copies to avoid cross register banks copies.Quentin Colombet2013-09-131-84/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By definition copies across register banks are not coalescable. Still, it may be possible to get rid of such a copy when the value is available in another register of the same register file. Consider the following example, where capital and lower letters denote different register file: b = copy A <-- cross-bank copy ... C = copy b <-- cross-bank copy This could have been optimized this way: b = copy A <-- cross-bank copy ... C = copy A <-- same-bank copy Note: b and C's definitions may be in different basic blocks. This patch adds a peephole optimization that looks through a chain of copies leading to a cross-bank copy and reuses a source that is on the same register file if available. This solution could also be used to get rid of some copies (e.g., A could have been used instead of C). However, we do not do so because: - It may over constrain the coloring of the source register for coalescing. - The register allocator may not be able to find a nice split point for the longer live-range, leading to more spill. <rdar://problem/14742333> llvm-svn: 190713
* Add initial support for handling gnu style pubnames accepted by someEric Christopher2013-09-132-8/+117
| | | | | | | | versions of gold. This support is designed to allow gold to produce gdb_index sections similar to the accelerator tables and consumable by gdb. llvm-svn: 190649
* Reformat and hoist section grabbing to top level.Eric Christopher2013-09-131-25/+30
| | | | llvm-svn: 190648
* Add an instruction deprecation feature to TableGen.Joey Gouly2013-09-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | The 'Deprecated' class allows you to specify a SubtargetFeature that the instruction is deprecated on. The 'ComplexDeprecationPredicate' class allows you to define a custom predicate that is called to check for deprecation. For example: ComplexDeprecationPredicate<"MCR"> would mean you would have to define the following function: bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI, std::string &Info) Which returns 'false' for not deprecated, and 'true' for deprecated and store the warning message in 'Info'. The MCTargetAsmParser constructor was chaned to take an extra argument of the MCInstrInfo class, so out-of-tree targets will need to be changed. llvm-svn: 190598
* Fix crash in AggressiveAntiDepBreaker with empty CriticalPathSetHal Finkel2013-09-121-1/+1
| | | | | | | | | | | | If no register classes are added to CriticalPathRCs, then the CriticalPathSet bitmask will be empty. In that case, ExcludeRegs must remain NULL or else this line will cause a segfault: } else if ((ExcludeRegs != NULL) && ExcludeRegs->test(AntiDepReg)) { I have no in-tree test case. llvm-svn: 190584
* Remove pointless assertion after r190376Matt Arsenault2013-09-121-2/+0
| | | | llvm-svn: 190565
* Debug info: add more comments.Manman Ren2013-09-111-2/+14
| | | | llvm-svn: 190544
* Add getUnrollingPreferences to TTIHal Finkel2013-09-111-0/+3
| | | | | | | | | Allow targets to customize the default behavior of the generic loop unrolling transformation. This will be used by the PowerPC backend when targeting the A2 core (which is in-order with a deep pipeline), and using more aggressive defaults is important. llvm-svn: 190542
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-1122-42/+41
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. llvm-svn: 190536
* Give internal classes hidden visibility.Benjamin Kramer2013-09-1122-41/+42
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. llvm-svn: 190534
* Simplify the checking of function attributes by using the simple methods.Bill Wendling2013-09-111-6/+3
| | | | llvm-svn: 190499
* Rename variables for consistency.Eli Friedman2013-09-111-6/+6
| | | | | | No functional change. llvm-svn: 190466
* Fix unused variables.Eli Friedman2013-09-102-1/+2
| | | | llvm-svn: 190448
* Hoist section call out of loop.Eric Christopher2013-09-101-2/+2
| | | | llvm-svn: 190440
* Debug Info: create scope children DIEs when the scope DIE is not null.Manman Ren2013-09-102-19/+54
| | | | | | | | | | | | | | | | We try to create the scope children DIEs after we create the scope DIE. But to avoid emitting empty lexical block DIE, we first check whether a scope DIE is going to be null, then create the scope children if it is not null. From the number of children, we decide whether to actually create the scope DIE. This patch also removes an early exit which checks for a special condition. It also removes deletion of un-used children DIEs that are generated because we used to generate children DIEs before the scope DIE. Deletion of un-used children DIEs may cause problem because we sometimes keep created DIEs in a member variable of a CU. llvm-svn: 190421
* Debug Info: define a DIRef template.Manman Ren2013-09-102-6/+4
| | | | | | | | | | | | | Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure the Value is indeed a scope ref and a type ref. Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef for getContainingType and getClassType. DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for readability and type safety. llvm-svn: 190418
* Don't use getSetCCResultType for creating a vselectMatt Arsenault2013-09-101-2/+1
| | | | | | | | | | | | | | | | | | | The vselect mask isn't a setcc. This breaks in the case when the result of getSetCCResultType is larger than the vector operands e.g. %tmp = select i1 %cmp <2 x i8> %a, <2 x i8> %b when getSetCCResultType returns <2 x i32>, the assertion that the (MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits()) is hit. No test since I don't think I can hit this with any of the current targets. The R600/SI implementation would break, since it returns a vector of i1 for this, but it doesn't reach ExpandSELECT for other reasons. llvm-svn: 190376
* Enable -misched-cyclicpath by default.Andrew Trick2013-09-091-1/+1
| | | | llvm-svn: 190367
* Debug Info: move DIScope::getContext back from DwarfDebug.Manman Ren2013-09-093-27/+1
| | | | | | | | This partially reverts r190330. DIScope::getContext now returns DIScopeRef instead of DIScope. We construct a DIScopeRef from DIScope when we are dealing with subprogram, lexical block or name space. llvm-svn: 190362
* mi-sched: smooth out the cyclicpath heuristic.Andrew Trick2013-09-091-1/+4
| | | | | | | | | | | | | | | Arnold's idea. I generally try to avoid stateful heuristics because it can make debugging harder. However, we need a way to prevent the latency priority from dominating, and it somewhat makes sense to schedule aggressively for latency only within an issue group. Swift in particular likes this, and it doesn't hurt anyone else: | Benchmarks/MiBench/consumer-lame | 10.39% | | Benchmarks/Misc/himenobmtxpa | 9.63% | llvm-svn: 190360
* white spaces and long linesJack Carter2013-09-091-45/+81
| | | | llvm-svn: 190358
* Always add global names. We're adding them in the rest of the codeEric Christopher2013-09-091-3/+2
| | | | | | | | | as well as types. No functional change as they're not emitted unless the option is true anyhow. llvm-svn: 190346
* Rename for consistency.Eric Christopher2013-09-092-4/+4
| | | | llvm-svn: 190345
* Call generateCompactUnwindEncodings() right before we need to output the ↵Bill Wendling2013-09-091-4/+3
| | | | | | | | | | | | | frame information. There are more than one paths to where the frame information is emitted. Place the call to generateCompactUnwindEncodings() into the method which outputs the frame information, thus ensuring that the encoding is there for every path. This involved threading the MCAsmBackend object through to this method. <rdar://problem/13623355> llvm-svn: 190335
* Debug Info: Use DIScopeRef for DIType::getContext.Manman Ren2013-09-092-7/+7
| | | | | | | | | | | | | | | | | In DIBuilder, the context field of a TAG_member is updated to use the scope reference. Verifier is updated accordingly. DebugInfoFinder now needs to generate a type identifier map to have access to the actual scope. Same applies for BreakpointPrinter. processModule of DebugInfoFinder is called during initialization phase of the verifier to make sure the type identifier map is constructed early enough. We are now able to unique a simple class as demonstrated by the added testing case. llvm-svn: 190334
* Debug Info: move DIScope::getContext to DwarfDebug.Manman Ren2013-09-093-5/+31
| | | | | | | | | | | | DIScope::getContext is a wrapper function that calls the specific getContext method on each subclass. When we switch DIType::getContext to return DIScopeRef instead of DIScope, DIScope::getContext can no longer return a DIScope without a type identifier map. DIScope::getContext is only used by DwarfDebug, so we move it to DwarfDebug to have easy access to the type identifier map. llvm-svn: 190330
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-092-36/+53
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 llvm-svn: 190328
* Debug Info: Move isSubprogramContext from DebugInfo to DwarfDebug.Manman Ren2013-09-093-1/+18
| | | | | | | | | | This helper function needs the type identifier map when we switch DIType::getContext to return DIScopeRef instead of DIScope. Since isSubprogramContext is used by DwarfDebug only, We move it to DwarfDebug to have easy access to the map. llvm-svn: 190325
* Debug Info: Rename DITypeRef to DIScopeRef.Manman Ren2013-09-092-5/+5
| | | | | | | | | | | | | | | | | | | | | | A reference to a scope is more general than a reference to a type since DIType is a subclass of DIScope. A reference to a type can be either an identifier for the type or the DIType itself, while a reference to a scope can be either an identifier for the type (when the scope is indeed a type) or the DIScope itself. A reference to a type and a reference to a scope will be resolved in the same way. The only difference is in the verifier when a field is a reference to a type (i.e. the containing type field of a DICompositeType) or a field is a reference to a scope (i.e. the context field of a DIType). This is to get ready for switching DIType::getContext to return DIScopeRef instead of DIScope. Tighten up isTypeRef and isScopeRef to make sure the identifier is not empty and the MDNode is DIType for TypeRef and DIScope for ScopeRef. llvm-svn: 190322
* [stackprotector] Modernize code with IRBuilderBenjamin Kramer2013-09-091-32/+17
| | | | llvm-svn: 190317
* [ARMv8] Prevent generation of deprecated IT blocks on ARMv8 in Thumb mode.Joey Gouly2013-09-091-21/+18
| | | | | | | | | IT blocks can only be one instruction lonf, and can only contain a subset of the 16 instructions. Patch by Artyom Skrobov! llvm-svn: 190309
* Generate compact unwind encoding from CFI directives.Bill Wendling2013-09-091-3/+4
| | | | | | | | | | | | | | | We used to generate the compact unwind encoding from the machine instructions. However, this had the problem that if the user used `-save-temps' or compiled their hand-written `.s' file (with CFI directives), we wouldn't generate the compact unwind encoding. Move the algorithm that generates the compact unwind encoding into the MCAsmBackend. This way we can generate the encoding whether the code is from a `.ll' or `.s' file. <rdar://problem/13623355> llvm-svn: 190290
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-071-1/+1
| | | | | | | | a DISubprogram. Verifier is updated accordingly. llvm-svn: 190229
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-061-1/+1
| | | | | | | | a DICompositeType. Verifier is updated accordingly. llvm-svn: 190190
* mi-sched: cleanup register pressure update, remove a FIXME.Andrew Trick2013-09-061-19/+26
| | | | llvm-svn: 190181
* mi-sched: improve regpressure tracing.Andrew Trick2013-09-061-2/+7
| | | | llvm-svn: 190180
* mi-sched: print tree size in -view-misched-dagsAndrew Trick2013-09-061-1/+5
| | | | llvm-svn: 190179
* mi-sched: register pressure update tracing.Andrew Trick2013-09-061-0/+4
| | | | llvm-svn: 190178
* mi-sched: Reorder Cyclicpath (latency) and CriticalMax (pressure) heuristics.Andrew Trick2013-09-061-4/+4
| | | | | | The latency based scheduling could induce spills in some cases. llvm-svn: 190177
* Added MachineSchedPolicy.Andrew Trick2013-09-061-35/+51
| | | | | | | | Allow subtargets to customize the generic scheduling strategy. This is convenient for targets that don't need to add new heuristics by specializing the strategy. llvm-svn: 190176
OpenPOWER on IntegriCloud