summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* IR: Introduce GenericDwarfNodeDuncan P. N. Exon Smith2015-01-208-18/+249
| | | | | | | | | | | | As part of PR22235, introduce `DwarfNode` and `GenericDwarfNode`. The former is a metadata node with a DWARF tag. The latter matches our current (generic) schema of a header with string (and stringified integer) data and an arbitrary number of operands. This doesn't move it into place yet; that change will require a large number of testcase updates. llvm-svn: 226529
* AsmParser: Abstract more of MDLocation parser, NFCDuncan P. N. Exon Smith2015-01-191-16/+27
| | | | llvm-svn: 226527
* AsmParser: Split up ParseMDFieldsImpl(), NFCDuncan P. N. Exon Smith2015-01-192-10/+17
| | | | llvm-svn: 226526
* [dsymutil] Add the detected target triple to the debug map.Frederic Riss2015-01-194-5/+21
| | | | | | | It will be needed to instantiate the Target object that we will use to create all the MC objects for the dwarf emission. llvm-svn: 226525
* AsmParser: Fix error location for missing fieldsDuncan P. N. Exon Smith2015-01-194-10/+21
| | | | llvm-svn: 226524
* IR: Cleanup MDNode field use, NFCDuncan P. N. Exon Smith2015-01-192-28/+20
| | | | | | | | | Swap usage of `SubclassData32` and `MDNodeSubclassData`, and rename `MDNodeSubclassData` to `NumUnresolved`. Small drive-by cleanup to `countUnresolvedOperands()` since otherwise the name clash with local vars named `NumUnresolved` would be confusing. llvm-svn: 226523
* IR: Move replaceWithUniqued(), etc., to source file, NFCDuncan P. N. Exon Smith2015-01-192-24/+29
| | | | llvm-svn: 226522
* IR: Cleanup MDNode::MDNode(), NFCDuncan P. N. Exon Smith2015-01-191-10/+9
| | | | llvm-svn: 226521
* IR: Merge UniquableMDNode back into MDNode, NFCDuncan P. N. Exon Smith2015-01-1910-175/+142
| | | | | | | | | As pointed out in r226501, the distinction between `MDNode` and `UniquableMDNode` is confusing. When we need subclasses of `MDNode` that don't use all its functionality it might make sense to break it apart again, but until then this makes the code clearer. llvm-svn: 226520
* IR: Extract MDNodeOpsKey, NFCDuncan P. N. Exon Smith2015-01-193-50/+84
| | | | | | Make the MDTuple operand hashing logic reusable. llvm-svn: 226519
* IR: Simplify uniquifyImpl(), NFCDuncan P. N. Exon Smith2015-01-192-33/+27
| | | | llvm-svn: 226518
* IR: Simplify erasing from uniquing store, NFCDuncan P. N. Exon Smith2015-01-192-9/+1
| | | | llvm-svn: 226517
* Remove dead code, NFCDuncan P. N. Exon Smith2015-01-191-1/+0
| | | | llvm-svn: 226516
* Utils: Simplify MapMetadata(), NFCDuncan P. N. Exon Smith2015-01-191-22/+37
| | | | | | Extract out the operand remapping loops, which are now very similar. llvm-svn: 226515
* Skip upcast, NFCDuncan P. N. Exon Smith2015-01-191-1/+1
| | | | llvm-svn: 226514
* [X86][AVX] Missing AVX1 memory folding float instructionsSimon Pilgrim2015-01-193-196/+511
| | | | | | | | | | Now that we can create much more exhaustive X86 memory folding tests, this patch adds the missing AVX1/F16C floating point instruction stack foldings we can easily test for including the scalar intrinsics (add, div, max, min, mul, sub), conversions float/int to double, half precision conversions, rounding, dot product and bit test. The patch also adds a couple of obviously missing SSE instructions (more to follow once we have full SSE testing). Now that scalar folding is working it broke a very old test (2006-10-07-ScalarSSEMiscompile.ll) - this test appears to make no sense as its trying to ensure that a scalar subtraction isn't folded as it 'would zero the top elts of the loaded vector' - this test just appears to be wrong to me. Differential Revision: http://reviews.llvm.org/D7055 llvm-svn: 226513
* Fix whitespace, NFCDuncan P. N. Exon Smith2015-01-191-3/+3
| | | | llvm-svn: 226512
* Utils: Simplify MapMetadata(), NFCDuncan P. N. Exon Smith2015-01-192-80/+37
| | | | | | | | Take advantage of the new ability of temporary nodes to mutate to distinct and uniqued nodes to greatly simplify the `MapMetadata()` helper functions. llvm-svn: 226511
* IR: Allow temporary nodes to become uniqued or distinctDuncan P. N. Exon Smith2015-01-193-0/+161
| | | | | | | | | | | Add `MDNode::replaceWithUniqued()` and `MDNode::replaceWithDistinct()`, which mutate temporary nodes to become uniqued or distinct. On uniquing collisions, the unique version is returned and the node is deleted. This takes advantage of temporary nodes being folded back in, and should let me clean up some awkward logic in `MapMetadata()`. llvm-svn: 226510
* IR: Remove templates from TempMDNodeDeleter, NFCDuncan P. N. Exon Smith2015-01-191-5/+4
| | | | | | | | r226504 added `TempMDNodeDeleter` to help with `std::unique_ptr<>`-izing the `MDNode::getTemporary()` interface. It doesn't need to be templated, though. llvm-svn: 226509
* IR: Split out countUnresolvedOperands(), NFCDuncan P. N. Exon Smith2015-01-192-4/+9
| | | | llvm-svn: 226508
* Cleanup whitespace, NFCDuncan P. N. Exon Smith2015-01-191-3/+3
| | | | llvm-svn: 226507
* IR: Return unique_ptr from MDNode::getTemporary()Duncan P. N. Exon Smith2015-01-1910-81/+77
| | | | | | | | | | | | Change `MDTuple::getTemporary()` and `MDLocation::getTemporary()` to return (effectively) `std::unique_ptr<T, MDNode::deleteTemporary>`, and clean up call sites. (For now, `DIBuilder` call sites just call `release()` immediately.) There's an accompanying change in each of clang and polly to use the new API. llvm-svn: 226504
* Add r224985 back with fixes.Rafael Espindola2015-01-1919-247/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fixes are to note that AArch64 has additional restrictions on when local relocations can be used. In particular, ld64 requires that relocations to cstring/cfstrings use linker visible symbols. Original message: In an assembly expression like bar: .long L0 + 1 the intended semantics is that bar will contain a pointer one byte past L0. In sections that are merged by content (strings, 4 byte constants, etc), a single position in the section doesn't give the linker enough information. For example, it would not be able to tell a relocation must point to the end of a string, since that would look just like the start of the next. The solution used in ELF to use relocation with symbols if there is a non-zero addend. In MachO before this patch we would just keep all symbols in some sections. This would miss some cases (only cstrings on x86_64 were implemented) and was inefficient since most relocations have an addend of 0 and can be represented without the symbol. This patch implements the non-zero addend logic for MachO too. llvm-svn: 226503
* IR: Add MDLocation::getTemporary()Duncan P. N. Exon Smith2015-01-192-0/+13
| | | | llvm-svn: 226502
* IR: Remove MDNodeFwdDeclDuncan P. N. Exon Smith2015-01-1913-95/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove `MDNodeFwdDecl` (as promised in r226481). Aside from API changes, there's no real functionality change here. `MDNode::getTemporary()` now forwards to `MDTuple::getTemporary()`, which returns a tuple with `isTemporary()` equal to true. The main point is that we can now add temporaries of other `MDNode` subclasses, needed for PR22235 (I introduced `MDNodeFwdDecl` in the first place because I didn't recognize this need, and thought they were only needed to handle forward references). A few things left out of (or highlighted by) this commit: - I've had to remove the (few) uses of `std::unique_ptr<>` to deal with temporaries, since the destructor is no longer public. `getTemporary()` should probably return the equivalent of `std::unique_ptr<T, MDNode::deleteTemporary>`. - `MDLocation::getTemporary()` doesn't exist yet (worse, it actually does exist, but does the wrong thing: `MDNode::getTemporary()` is inherited and returns an `MDTuple`). - `MDNode` now only has one subclass, `UniquableMDNode`, and the distinction between them is actually somewhat confusing. I'll fix those up next. llvm-svn: 226501
* [Hexagon] Updating muxir/ri/ii intrinsics. Setting predicate registers as ↵Colin LeMahieu2015-01-194-101/+129
| | | | | | compatible with i32 rather than doing custom type conversion. llvm-svn: 226500
* IR: Extract out and reuse `storeImpl()`, NFCDuncan P. N. Exon Smith2015-01-192-28/+22
| | | | llvm-svn: 226499
* IR: Extract out getUniqued(), NFCDuncan P. N. Exon Smith2015-01-191-28/+24
| | | | llvm-svn: 226498
* IR: Reuse `getImpl()` for `getDistinct()`, NFCDuncan P. N. Exon Smith2015-01-192-63/+72
| | | | | | | | Merge `getDistinct()`'s implementation with those of `get()` and `getIfExists()` for both `MDTuple` and `MDLocation`. This will make it easier to scale to supporting temporaries. llvm-svn: 226497
* IR: Move replaceAllUsesWith() back up to MDNodeDuncan P. N. Exon Smith2015-01-191-5/+9
| | | | | | | Move `MDNodeFwdDecl::replaceAllUsesWith()` back up to `MDNode`, but assert `isTemporary()`. llvm-svn: 226495
* IR: Be specific about what MDNode::get() returns, NFCDuncan P. N. Exon Smith2015-01-191-8/+8
| | | | llvm-svn: 226494
* Remove dead code, NFCDuncan P. N. Exon Smith2015-01-191-3/+0
| | | | llvm-svn: 226493
* IR: Simplify MDNode::setOperand(), NFCDuncan P. N. Exon Smith2015-01-191-5/+1
| | | | llvm-svn: 226492
* IR: Simplify handleChangedOperand() fast path, NFCDuncan P. N. Exon Smith2015-01-191-3/+1
| | | | | | | Use `isUniqued()` instead of `isStoredDistinctInContext()`, and remove an assertion that won't be valid once temporaries are merged back in. llvm-svn: 226491
* IR: Remove direct comparisons against Metadata::Storage, NFCDuncan P. N. Exon Smith2015-01-191-3/+3
| | | | llvm-svn: 226490
* IR: Assert that resolve() is only called on uniqued nodes, NFCDuncan P. N. Exon Smith2015-01-191-1/+3
| | | | | | | | | Add an assertion in `UniquableMDNode::resolve()` to prevent temporaries from being resolved (once they're merged back in). Needed to shuffle order of `resolve()` and `storeDistinctInContext()` to prevent it from firing. llvm-svn: 226489
* IR: Remove isa<UniquableMDNode>, NFCDuncan P. N. Exon Smith2015-01-191-1/+1
| | | | llvm-svn: 226488
* IR: Simplify DIBuilder::trackIfUnresolved(), NFCDuncan P. N. Exon Smith2015-01-191-8/+6
| | | | llvm-svn: 226487
* IR: Remove isa<MDNodeFwdDecl>, NFCDuncan P. N. Exon Smith2015-01-191-4/+1
| | | | llvm-svn: 226486
* IR: Unify code for MDNode::isResolved(), NFCDuncan P. N. Exon Smith2015-01-192-17/+11
| | | | | | | | | | Unify the definitions of `MDNode::isResolved()` and `UniquableMDNode::isResolved()`. Previously, `UniquableMDNode` could answer this question more efficiently, but now that RAUW support has been unified with `MDNodeFwdDecl`, `MDNode` doesn't need any casts to figure out the answer. llvm-svn: 226485
* IR: Store RAUW support and Context in the same pointer, NFCDuncan P. N. Exon Smith2015-01-194-24/+135
| | | | | | | | | | | | | | Add an `LLVMContext &` to `ReplaceableMetadataImpl`, create a class that either holds a reference to an `LLVMContext` or owns a `ReplaceableMetadataImpl`, and use the new class in `MDNode`. - This saves a pointer in `UniquableMDNode` at the cost of a pointer in `ValueAsMetadata` (which didn't used to store the `LLVMContext`). There are far more of the former. - Unifies RAUW support between `MDNodeFwdDecl` (which is going away, see r226481) and `UniquableMDNode`. llvm-svn: 226484
* [Hexagon] Converting intrinsics combine imm/imm, simple shifts and extends.Colin LeMahieu2015-01-193-0/+135
| | | | llvm-svn: 226483
* IR: Add isUniqued() and isTemporary()Duncan P. N. Exon Smith2015-01-194-12/+32
| | | | | | | | Change `MDNode::isDistinct()` to only apply to 'distinct' nodes (not temporaries), and introduce `MDNode::isUniqued()` and `MDNode::isTemporary()` for the other two possibilities. llvm-svn: 226482
* IR: Use an enum to describe Metadata storage, NFCDuncan P. N. Exon Smith2015-01-192-38/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | More clearly describe the type of storage used for `Metadata`. - `Uniqued`: uniqued, stored in the context. - `Distinct`: distinct, stored in the context. - `Temporary`: not owned by anyone. This is the first in a series of commits to fix a design problem with `MDNodeFwdDecl` that I need to solve for PR22235. While `MDNodeFwdDecl` works well as a forward declaration, we use `MDNode::getTemporary()` for more than forward declarations -- we also need to create early versions of nodes (with fields not filled in) that we'll fill out later (see `DIBuilder::finalize()` and `CGDebugInfo::finalize()` for examples). This was a blind spot I had when I introduced `MDNodeFwdDecl` (which David Blaikie (indirectly) highlighted in an unrelated review [1]). [1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150112/252381.html In general, we need `MDTuple::getTemporary()` to give a temporary tuple (like `MDNodeFwdDecl`), `MDLocation::getTemporary()` to give a temporary location, and (the problem at hand) `GenericDebugMDNode::getTemporary()` to give a temporary generic debug node. So I need to fold the idea of "temporary" nodes back into `UniquableMDNode`. (More commits to follow as I refactor.) llvm-svn: 226481
* [Hexagon] Converting remaining ALU32/ALU intrinsics.Colin LeMahieu2015-01-194-29/+60
| | | | llvm-svn: 226480
* [Hexagon] Converting ALU32/ALU intrinsics to new patterns.Colin LeMahieu2015-01-192-30/+141
| | | | llvm-svn: 226478
* Remove support for DIVariable's FlagIndirectVariable and expectAdrian Prantl2015-01-1918-69/+45
| | | | | | | | | | | | | | | frontends to use a DIExpression with a DW_OP_deref instead. This is not only a much more natural place for this informationl; there is also a technical reason: The FlagIndirectVariable is used to mark a variable that is turned into a reference by virtue of the calling convention; this happens for example to aggregate return values. The inliner, for example, may actually need to undo this indirection to correctly represent the value in its new context. This is impossible to implement because the DIVariable can't be safely modified. We can however safely construct a new DIExpression on the fly. llvm-svn: 226476
* [AArch64] Implement GHC calling conventionGreg Fitzgerald2015-01-196-1/+151
| | | | | | | | | | Original patch by Luke Iannini. Minor improvements and test added by Erik de Castro Lopo. Differential Revision: http://reviews.llvm.org/D6877 From: Erik de Castro Lopo <erikd@mega-nerd.com> llvm-svn: 226473
* [Hexagon] Converting halfword to double accumulating multiply intrinsics.Colin LeMahieu2015-01-192-141/+440
| | | | llvm-svn: 226472
OpenPOWER on IntegriCloud