summaryrefslogtreecommitdiff
path: root/lib/CodeGen
Commit message (Collapse)AuthorAge
* Revert "Reapply r185872 now that the address sanitizer has been changed to ↵Arnold Schwaighofer2013-08-08
| | | | | | | | support this." This reverts commit r187939. It broke an O0 build of a spec benchmark. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188012 91177308-0d34-0410-b5e6-96231b3b80d8
* For DW_TAG_template_type_parameter the actual passed in type couldEric Christopher2013-08-08
| | | | | | | be void and therefore not have a type entry. Only add the type if it is non-void and provide a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187966 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove AllUndef check from one of the loops in getVectorShuffle. It was ↵Craig Topper2013-08-08
| | | | | | already handled by the 'AllLHS && AllRHS' check after the previous loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187965 91177308-0d34-0410-b5e6-96231b3b80d8
* The conversion to bool is fine here, no need to check isType.Eric Christopher2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187964 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that if we're going to attempt to add a type to a DIE thatEric Christopher2013-08-08
| | | | | | | | | | | | the type exists. Fix up cases where we weren't checking for optional types and add an assert to addType to make sure we catch this in the future. Fix up a testcase that was using the tag for DW_TAG_array_type when it meant DW_TAG_enumeration_type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187963 91177308-0d34-0410-b5e6-96231b3b80d8
* Change variable name and reflow formatting.Eric Christopher2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187962 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize mask generation for one of the DAG combiner shufflevector cases.Craig Topper2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187961 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "coff also doesn't have a ReadOnlySection yet, (!)"David Majnemer2013-08-08
| | | | | | | | | | | | This reverts commit r77814. We were sticking global constants in the .data section instead of in the .rdata section when emitting for COFF. This fixes PR16831. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187956 91177308-0d34-0410-b5e6-96231b3b80d8
* Reflow for loop.Eric Christopher2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187954 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more rigorous about the sizes of forms and attributes.Eric Christopher2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187953 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r185872 now that the address sanitizer has been changed to support this.Bill Wendling2013-08-07
| | | | | | | | | | | | | | | | | | | | | | Original commit message: Stop emitting weak symbols into the "coal" sections. The Mach-O linker has been able to support the weak-def bit on any symbol for quite a while now. The compiler however continued to place these symbols into a "coal" section, which required the linker to map them back to the base section name. Replace the sections like this: __TEXT/__textcoal_nt instead use __TEXT/__text __TEXT/__const_coal instead use __TEXT/__const __DATA/__datacoal_nt instead use __DATA/__data <rdar://problem/14265330> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187939 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ISD::FROUND for libm round()Hal Finkel2013-08-07
| | | | | | | | | | | | | | | All libm floating-point rounding functions, except for round(), had their own ISD nodes. Recent PowerPC cores have an instruction for round(), and so here I'm adding ISD::FROUND so that round() can be custom lowered as well. For the most part, this is straightforward. I've added an intrinsic and a matching ISD node just like those for nearbyint() and friends. The SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed fround). This will be used by the PowerPC backend in a follow-up commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187926 91177308-0d34-0410-b5e6-96231b3b80d8
* Using the integrated assembler we'd fail to change section to theEric Christopher2013-08-07
| | | | | | | | | .tbss section for zerofill thread locals. Make sure we do this before emitting the zerofills. Fixes PR15972. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187913 91177308-0d34-0410-b5e6-96231b3b80d8
* Confusing comment typo.Andrew Trick2013-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187895 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some parens. No functional change.Eric Christopher2013-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187872 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a way to grab a particular attribute out of a DIE.Eric Christopher2013-08-07
| | | | | | | Use it when we're looking for a string in particular. Update comments as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187844 91177308-0d34-0410-b5e6-96231b3b80d8
* Move somewhat messy conditional out of line.Eric Christopher2013-08-07
| | | | | | No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187843 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopVectorize: Allow vectorization of loops with lifetime markersArnold Schwaighofer2013-08-06
| | | | | | Patch by Marc Jessome! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187825 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor isInTailCallPosition handlingTim Northover2013-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change came about primarily because of two issues in the existing code. Niether of: define i64 @test1(i64 %val) { %in = trunc i64 %val to i32 tail call i32 @ret32(i32 returned %in) ret i64 %val } define i64 @test2(i64 %val) { tail call i32 @ret32(i32 returned undef) ret i32 42 } should be tail calls, and the function sameNoopInput is responsible. The main problem is that it is completely symmetric in the "tail call" and "ret" value, but in reality different things are allowed on each side. For these cases: 1. Any truncation should lead to a larger value being generated by "tail call" than needed by "ret". 2. Undef should only be allowed as a source for ret, not as a result of the call. Along the way I noticed that a mismatch between what this function treats as a valid truncation and what the backends see can lead to invalid calls as well (see x86-32 test case). This patch refactors the code so that instead of being based primarily on values which it recurses into when necessary, it starts by inspecting the type and considers each fundamental slot that the backend will see in turn. For example, given a pathological function that returned {{}, {{}, i32, {}}, i32} we would consider each "real" i32 in turn, and ask if it passes through unchanged. This is much closer to what the backend sees as a result of ComputeValueVTs. Aside from the bug fixes, this eliminates the recursion that's going on and, I believe, makes the bulk of the code significantly easier to understand. The trade-off is the nasty iterators needed to find the real types inside a returned value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187787 91177308-0d34-0410-b5e6-96231b3b80d8
* AsmPrinter/CMakeLists.txt: Add explicit dependency to intrinsics_gen here.NAKAMURA Takumi2013-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187778 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit previous cleanup with a fix for c++98 ambiguity.Eric Christopher2013-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187752 91177308-0d34-0410-b5e6-96231b3b80d8
* TargetLowering: Add getVectorIdxTy() function v2Tom Stellard2013-08-05
| | | | | | | | | | | | | | | | | | | | | This virtual function can be implemented by targets to specify the type to use for the index operand of INSERT_VECTOR_ELT, EXTRACT_VECTOR_ELT, INSERT_SUBVECTOR, EXTRACT_SUBVECTOR. The default implementation returns the result from TargetLowering::getPointerTy() The previous code was using TargetLowering::getPointerTy() for vector indices, because this is guaranteed to be legal on all targets. However, using TargetLowering::getPointerTy() can be a problem for targets with pointer sizes that differ across address spaces. On such targets, when vectors need to be loaded or stored to an address space other than the default 'zero' address space (which is the address space assumed by TargetLowering::getPointerTy()), having an index that is a different size than the pointer can lead to inefficient pointer calculations, (e.g. 64-bit adds for a 32-bit address space). There is no intended functionality change with this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187748 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Use existing builtin hashing functions to make this routine more"Eric Christopher2013-08-05
| | | | | | This reverts commit r187745. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187747 91177308-0d34-0410-b5e6-96231b3b80d8
* Use existing builtin hashing functions to make this routine moreEric Christopher2013-08-05
| | | | | | simple. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187745 91177308-0d34-0410-b5e6-96231b3b80d8
* Change parent hashing algorithm to be non-recursive and elaborateEric Christopher2013-08-05
| | | | | | greatly on many comments in the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187742 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't leak passes if added outside of the area determined by Started/Stopped ↵Benjamin Kramer2013-08-05
| | | | | | flags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187722 91177308-0d34-0410-b5e6-96231b3b80d8
* Bugfix for making the DWARF debug strings and labels to code emitted as ↵Carlo Kok2013-08-02
| | | | | | secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB (with fix for 64bits msvc) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187656 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r187597, "Bugfix for making the DWARF debug strings and labels to ↵NAKAMURA Takumi2013-08-02
| | | | | | | | code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB." It broke x86_64-win32 builder in llvm/test/DebugInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187642 91177308-0d34-0410-b5e6-96231b3b80d8
* Use function attributes to indicate that we don't want to realign the stack.Bill Wendling2013-08-01
| | | | | | | | | Function attributes are the future! So just query whether we want to realign the stack directly from the function instead of through a random target options structure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187618 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Emit definitions for types with no members.David Blaikie2013-08-01
| | | | | | The absence of members was a poor/incorrect proxy for "is definition". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187607 91177308-0d34-0410-b5e6-96231b3b80d8
* Bugfix for making the DWARF debug strings and labels to code emitted as ↵Carlo Kok2013-08-01
| | | | | | | | secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB. fixes Bug 16249 - LLVM generates broken debug info on Windows git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187597 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crashing on invalid inline asm with matching constraints.Eric Christopher2013-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For a testcase like the following: typedef unsigned long uint64_t; typedef struct { uint64_t lo; uint64_t hi; } blob128_t; void add_128_to_128(const blob128_t *in, blob128_t *res) { asm ("PAND %1, %0" : "+Q"(*res) : "Q"(*in)); } where we'll fail to allocate the register for the output constraint, our matching input constraint will not find a register to match, and could try to search past the end of the current operands array. On the idea that we'd like to attempt to keep compilation going to find more errors in the module, change the error cases when we're visiting inline asm IR to return immediately and avoid trying to create a node in the DAG. This leaves us with only a single error message per inline asm instruction, but allows us to safely keep going in the general case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187470 91177308-0d34-0410-b5e6-96231b3b80d8
* Reflow this to be easier to read.Eric Christopher2013-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187459 91177308-0d34-0410-b5e6-96231b3b80d8
* Down-scale slot index distance to save bits.Andrew Trick2013-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187438 91177308-0d34-0410-b5e6-96231b3b80d8
* MI Sched: Track live-thru registers.Andrew Trick2013-07-30
| | | | | | | | | | | When registers must be live throughout the scheduling region, increase the limit for the register class. Once we exceed the original limit, they will be spilled, and there's no point further reducing pressure. This isn't a perfect heuristics but avoids a situation where the scheduler could become trapped by trying to achieve the impossible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187436 91177308-0d34-0410-b5e6-96231b3b80d8
* MI Sched fix: assert "Disconnected LRG within the scheduling region."Andrew Trick2013-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187435 91177308-0d34-0410-b5e6-96231b3b80d8
* [DAGCombiner] insert_vector_elt: Avoid building a vector twice.Quentin Colombet2013-07-30
| | | | | | | | | | | | | | | | | | This patch prevents the following combine when the input vector is used more than once. insert_vector_elt (build_vector elt0, ..., eltN), NewEltIdx, idx => build_vector elt0, ..., NewEltIdx, ..., eltN The reasons are: - Building a vector may be expensive, so try to reuse the existing part of a vector instead of creating a new one (think big vectors). - elt0 to eltN now have two users instead of one. This may prevent some other optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187396 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a truly egregious thinko in anonymous namespace check,Eric Christopher2013-07-29
| | | | | | | | update testcase to make sure we generate debug info for walrus by adding a non-trivial constructor and verify that we don't emit an ODR signature for the type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187393 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we don't emit an ODR hash for types with no name and makeEric Christopher2013-07-29
| | | | | | sure the comments for each testcase are a bit easier to distinguish. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187392 91177308-0d34-0410-b5e6-96231b3b80d8
* Elaborate a bit on the type unit and ODR conditional code.Eric Christopher2013-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187385 91177308-0d34-0410-b5e6-96231b3b80d8
* Use proper section suffix for COFF weak symbolsNico Rieck2013-07-29
| | | | | | | | | 32-bit symbols have "_" as global prefix, but when forming the name of COMDAT sections this prefix is ignored. The current behavior assumes that this prefix is always present which is not the case for 64-bit and names are truncated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187356 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: MD5 is always little endian, bswap on big endian platforms.Benjamin Kramer2013-07-27
| | | | | | This makes LLVM emit the same signature regardless of host and target endianess. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187304 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a memory leak in the debug emission by simply not allocating memory.Chandler Carruth2013-07-27
| | | | | | | | There doesn't appear to be any reason to put this variable on the heap. I'm suspicious of the LexicalScope above that we stuff in a map and then delete afterward, but I'm just trying to get the valgrind bot clean. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187301 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement isPotentiallyReachable to make nocapture deduction much stronger.Nick Lewycky2013-07-27
| | | | | | | | | | | Adds unit tests for it too. Split BasicBlockUtils into an analysis-half and a transforms-half, and put the analysis bits into a new Analysis/CFG.{h,cpp}. Promote isPotentiallyReachable into llvm::isPotentiallyReachable and move it into Analysis/CFG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187283 91177308-0d34-0410-b5e6-96231b3b80d8
* SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch ↵Tom Stellard2013-07-27
| | | | | | | | | | | | | | conditions Merge consecutive if-regions if they contain identical statements. Both transformations reduce number of branches. The transformation is guarded by a target-hook, and is currently enabled only for +R600, but the correctness has been tested on X86 target using a variety of CPU benchmarks. Patch by: Mei Ye git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187278 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove addLetterToHash, no functional change.Eric Christopher2013-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187245 91177308-0d34-0410-b5e6-96231b3b80d8
* Add preliminary support for hashing DIEs and breaking them intoEric Christopher2013-07-26
| | | | | | | | | | | | | | | | type units. Initially this support is used in the computation of an ODR checker for C++. For now we're attaching it to the DIE, but in the future it will be attached to the type unit. This also starts breaking out types into the separation for type units, but without actually splitting the DIEs. In preparation for hashing the DIEs this adds a DIEString type that contains a StringRef with the string contained at the label. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187213 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a target legalize hook for SplitVectorOperand (again)Justin Holewinski2013-07-26
| | | | | | | | | | | | | | CustomLowerNode was not being called during SplitVectorOperand, meaning custom legalization could not be used by targets. This also adds a test case for NVPTX that depends on this custom legalization. Differential Revision: http://llvm-reviews.chandlerc.com/D1195 Attempt to fix the buildbots by making the X86 test I just added platform independent git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187202 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add a target legalize hook for SplitVectorOperand"Rafael Espindola2013-07-26
| | | | | | | | | | This reverts commit 187198. It broke the bots. The soft float test probably needs a -triple because of name differences. On the hard float test I am getting a "roundss $1, %xmm0, %xmm0", instead of "vroundss $1, %xmm0, %xmm0, %xmm0". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187201 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a target legalize hook for SplitVectorOperandJustin Holewinski2013-07-26
| | | | | | | | | | | | CustomLowerNode was not being called during SplitVectorOperand, meaning custom legalization could not be used by targets. This also adds a test case for NVPTX that depends on this custom legalization. Differential Revision: http://llvm-reviews.chandlerc.com/D1195 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187198 91177308-0d34-0410-b5e6-96231b3b80d8