Commit Graph

22217 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
246f0931ff AsmWriter/Bitcode: MDLexicalBlockFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229017 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:30:42 +00:00
Duncan P. N. Exon Smith
c7be07e636 AsmWriter/Bitcode: MDLexicalBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229016 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:29:28 +00:00
Duncan P. N. Exon Smith
ed356a925a AsmWriter/Bitcode: MDSubprogram
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229014 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:26:47 +00:00
Duncan P. N. Exon Smith
37742c3591 AsmWriter/Bitcode: MDCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:25:10 +00:00
Zachary Turner
bcaafc81ab Improve llvm-pdbdump output display.
This patch adds a number of improvements to llvm-pdbdump.

1) Dumping of the entire global scope, and not only those
   symbols that live in individual compilands.
2) Prepend class name to member functions and data
3) Improved display of bitfields.
4) Support for dumping more kinds of data symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:23:51 +00:00
Duncan P. N. Exon Smith
1c092c03ba AsmWriter/Bitcode: MDSubroutineType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229011 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:22:59 +00:00
Duncan P. N. Exon Smith
dacf0004cb AsmWriter/Bitcode: MDDerivedType and MDCompositeType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229009 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:20:38 +00:00
Duncan P. N. Exon Smith
192d9c3b6f AsmWriter/Bitcode: MDFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229007 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:19:14 +00:00
Duncan P. N. Exon Smith
57b4c150ca AsmWriter/Bitcode: MDBasicType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:14:58 +00:00
Duncan P. N. Exon Smith
aa7c94359c AsmWriter/Bitcode: MDEnumerator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:14:11 +00:00
Duncan P. N. Exon Smith
b984c49449 AsmWriter/Bitcode: MDSubrange
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:10:38 +00:00
Duncan P. N. Exon Smith
7473485c0f IR: Add MDExpression::ExprOperand
Port `DIExpression::Operand` over to `MDExpression::ExprOperand`.  The
logic is needed directly in `MDExpression` to support printing in
assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229002 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:07:46 +00:00
Duncan P. N. Exon Smith
191690dc8c Support: Add dwarf::getOperationEncoding()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:05:00 +00:00
Duncan P. N. Exon Smith
5fc468cbf5 Support: Rewrite LocationAtom and OperationEncodingString(), NFC
Use `Dwarf.def` more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:04:08 +00:00
Akira Hatanaka
ac844bf562 [LinkModules] Change the way ModuleLinker merges triples.
This commit makes the following changes:

- Stop issuing a warning when the triples' string representations do not match
  exactly if the Triple objects generated from the strings compare equal.
 
- On Apple platforms, choose the triple that has the larger minimum version
  number. 

rdar://problem/16743513

Differential Revision: http://reviews.llvm.org/D7591


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 00:40:41 +00:00
Rafael Espindola
2fa06b171b Add support for having multiple sections with the same name and comdat.
Using this in combination with -ffunction-sections allows LLVM to output a .o
file with mulitple sections named .text. This saves space by avoiding long
unique names of the form .text.<C++ mangled name>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228980 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 23:29:51 +00:00
David Blaikie
122ea21abf Add missing override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 22:58:53 +00:00
Zachary Turner
3231937293 Attempt to fix the build again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 21:25:58 +00:00
Zachary Turner
232308cfa9 Attempt to fix Linux builds after r228960.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228962 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 21:17:07 +00:00
Rafael Espindola
8093f4b9bb Remove mostly unused setters.
Most of the code was setting the TargetOptions directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 21:16:34 +00:00
Zachary Turner
13a819cbad Add concrete type overloads to PDBSymbol::findChildren().
Frequently you only want to iterate over children of a specific
type (e.g. functions).  Previously you would get back a generic
interface that allowed iteration over the base symbol type,
which you would have to dyn_cast<> each one of.  With this patch,
we allow the user to specify the concrete type as a template
parameter, and it will return an iterator which returns instances
of the concrete type directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228960 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 21:09:24 +00:00
Rafael Espindola
c3c5d7c2d6 On ELF, put PIC jump tables in a non executable section.
Fixes PR22558.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228939 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 17:46:49 +00:00
Rafael Espindola
8eeedf74d3 Put each jump table in an independent section if the function is too.
This allows the linker to GC both, fixing pr22557.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228937 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 17:16:46 +00:00
Benjamin Kramer
d913d9d2c3 MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros
Update all callers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:35:40 +00:00
Andrea Di Biagio
44926033f6 [TTI] Teach the cost heuristic how to query TLI to check if a zext/trunc is 'free' for the target.
Now that SimplifyCFG uses TTI for the cost heuristic, we can teach BasicTTIImpl
how to query TLI in order to get a more accurate cost for truncates and
zero-extends.

Before this patch, the basic cost heuristic in TargetTransformInfoImplCRTPBase
would have conservatively returned a 'default' TCC_Basic for all zero-extends,
and TCC_Free for truncates on native types.

This patch improves the heuristic so that we query TLI (if available) to get
more accurate answers. If TLI is available, then methods 'isZExtFree' and
'isTruncateFree' can be used to check if a zext/trunc is free for the target.

Added more test cases to SimplifyCFG/X86/speculate-cttz-ctlz.ll.
With this change, SimplifyCFG is now able to speculate a 'cheap' cttz/ctlz
immediately followed by a free zext/trunc.

Differential Revision: http://reviews.llvm.org/D7585


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228923 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 14:17:24 +00:00
Benjamin Kramer
c70b2070db BitVector: Remove manual bit width dispatch, this is handled by templates
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228922 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 14:02:58 +00:00
Benjamin Kramer
9df4111876 MathExtras: Parametrize count(Trailing|Leading)Zeros on the type size.
Otherwise we will always select the generic version for e.g. unsigned
long if uint64_t is typedef'd to 'unsigned long long'. Also remove
enable_if hacks in favor of static_assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228921 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 13:47:29 +00:00
Adrian Prantl
71a70be163 Generalize DIBuilder's createReplaceableForwardDecl() to a more flexible
createReplaceableCompositeType() that allows to create non-forward-declared
temporary nodes.

Paired commit with CFE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228852 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 17:45:05 +00:00
Andrea Di Biagio
f033db57e9 [TTI] Improved cost heuristic for cttz/ctlz calls.
This patch is a follow-up of r228826 (see code-review: D7506).

Now that SimplifyCFG uses TargetTransformInfo for cost analysis, we 
have to fix the cost heuristic for intrinsic calls to cttz/ctlz.

This patch defines method 'getIntrinsicCost' in BasicTTIImpl: now, BasicTTIImpl
queries TLI to check if a call to cttz/ctlz is cheap for the target.

Added test cases in Transforms/SimplifyCFG/X86 to verify that on x86,
SimplifyCFG only speculates a call to cttz/ctlz if it is cheap.

Differential Revision: http://reviews.llvm.org/D7554


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228829 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 14:22:18 +00:00
Arnaud A. de Grandmaison
8ee1b65836 [PBQP] Cautiously update edge costs in the solver
The NodeMetadata are maintained in an incremental way. When an edge between
2 nodes has its cost updated, in the course of graph reduction for example,
the NodeMetadata need first to have the old edge cost removed, then the new
edge cost added. Only once the NodeMetadata have been fully updated, it
becomes safe to consider promoting the nodes to the
ConservativelyAllocatable or OptimallyReducible sets. Previously, this
promotion was occuring right after the removing the old cost, and this was
breaking the assumption that a ConservativelyAllocatable should not be
spilled.

This patch also adds asserts to:
 - enforces the invariant that a node's reduction can not be downgraded,
 - only not provably allocatable or optimally reducible nodes can be spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228816 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 08:25:36 +00:00
Reid Kleckner
690248bf52 Don't promote asynch EH invokes of nounwind functions to calls
If the landingpad of the invoke is using a personality function that
catches asynch exceptions, then it can catch a trap.

Also add some landingpads to invalid LLVM IR test cases that lack them.

Over-the-shoulder reviewed by David Majnemer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228782 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:23:16 +00:00
Zachary Turner
1e70854148 Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.
This makes llvm-pdbdump available on all platforms, although it
will currently fail to create a dumper if there is no PDB reader
implementation for the current platform.

It implements dumping of compilands and children, which is less
information than was previously available, but it has to be
rewritten from scratch using the new set of interfaces, so the
rest of the functionality will be added back in subsequent commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 22:43:25 +00:00
Zachary Turner
8ffa03cd98 Provide DIA implementation of DebugInfoPDB.
This implements DebugInfoPDB when the DIA SDK is present on the system.
Specifically, this means that the following conditions are met:
  1) You are building on Windows.
  2) You are building with MSVC.
  3) Visual Studio did not corrupt the installation of DIA due to a
     known issue with side-by-side installations of VS2012 and VS2013.
If all of these conditions are true, you will be able to pass a value
of PDB_Reader::DIA to PDB::createPdbReader().

There are no tests for this yet, as any test will be in the form of a
lit test which tests the llvm-pdbdump.exe, which still needs to be
rewritten in terms of this library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 21:17:52 +00:00
Aaron Ballman
a4109ad7b9 Now use the __debugbreak intrinsic instead of calling RaiseException; it requires no forward declares and still calls VEH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 21:13:04 +00:00
Aaron Ballman
7bddff5443 Changing the status code generated by LLVM_BUILTIN_TRAP on Windows to be something categorized as a valid error code. Fixes crashing uses (such as not --crash) with existing sys::Wait behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228738 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 20:13:52 +00:00
Andrew Kaylor
7741851819 Adding support for llvm.eh.begincatch and llvm.eh.endcatch intrinsics and beginning the documentation of native Windows exception handling.
Differential Revision: http://reviews.llvm.org/D7398



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 19:52:43 +00:00
Duncan P. N. Exon Smith
027898a77a IR: Add MDNode::replaceWithPermanent()
Add new API for converting temporaries that may self-reference.
Self-referencing nodes are not allowed to be uniqued, so sending them
into `replaceWithUniqued()` is dangerous (and this commit adds
assertions that prevent it).

`replaceWithPermanent()` has similar semantics to `get()` followed by
calls to `replaceOperandWith()`.  In particular, if there's a
self-reference, it returns a distinct node; otherwise, it returns a
uniqued one.  Like `replaceWithUniqued()` and `replaceWithDistinct()`
(well, it calls out to them) it mutates the temporary node in place if
possible, only calling `replaceAllUsesWith()` on a uniquing collision.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228726 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 19:13:46 +00:00
Paul Robinson
a932cb6d09 Explicitly initialize a flag in a default constructor.
Works around a Visual C++ issue.

Patch by Douglas Yung!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 15:30:02 +00:00
Aaron Ballman
8be1058946 Re-committing r228628 with a fix for 64-bit builds.
On Windows, we now use RaiseException to generate the kind of trap we require (one which calls our vectored exception handler), and fall back to using a volatile write to simulate a trap elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228691 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 14:28:11 +00:00
Lang Hames
e65664e90d [Orc] Fix a bug in the LazyEmittingLayer - capture names by value (as
std::strings) rather than StringRefs in JITSymbol get-address lambda.

Capturing a StringRef by-value is still effectively capturing a reference, which
is no good here because the referenced string may be gone by the time the lambda
is being evaluated the original value may be gone. Make sure to capture a
std::string instead.

No test case: This bug doesn't manifest under OrcMCJITReplacement, since it
keeps IR modules (from which the StringRefs are sourced) alive permanently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228676 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 07:35:39 +00:00
Lang Hames
b7387a07d0 [Orc] Add missing casserts header to JITSymbol.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228675 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 07:26:19 +00:00
Zachary Turner
e20fe230bd Define HAVE_DIA_SDK on Windows when DIA is present.
This allows all CMake projects, as well as C++ code, to detect if
and when DIA SDK is available for use so that we can enable the
DIA-based PDB reader implementation.

Differential Revision: http://reviews.llvm.org/D7457
Reviewed By: Chandler Carruth

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 05:04:25 +00:00
Duncan P. N. Exon Smith
3740ae4600 IR: Remove unnecessary fields from MDTemplateParameter
I noticed this fields were never used in r228607, but I neglected to
propagate that into `MDTemplateParameter` until now.  This really should
have been done before commit in r228640; sorry for the churn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228652 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 01:59:57 +00:00
Duncan P. N. Exon Smith
db7dea0e2e IR: Add accessors to MDExpression
Add some accessors to `MDExpression`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 01:36:46 +00:00
Duncan P. N. Exon Smith
f4293bcf4e AsmParser: Add stubs for specialized MDNodes, NFC
Well, the exact error from the failed parse will change, but...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228644 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 01:08:16 +00:00
Duncan P. N. Exon Smith
14fcfef23b IR: Add specialized debug info metadata nodes
Add specialized debug info metadata nodes that match the `DIDescriptor`
wrappers (used by `DIBuilder`) closely.  Assembly and bitcode support to
follow soon (it'll mostly just be obvious), but this sketches in today's
schema.  This is the first big commit (well, the only *big* one aside
from the testcase changes that'll come when I move this into place) for
PR22464.

I've marked a bunch of obvious changes as `TODO`s in the source; I plan
to make those changes promptly after this hierarchy is moved underneath
`DIDescriptor`, but for now I'm aiming mostly to match the status quo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228640 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 00:52:32 +00:00
Lang Hames
c9af50b223 [Orc] Back out one of the GCC ICE workarounds from r228568. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228637 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 00:37:26 +00:00
Aaron Ballman
c0cd86712c Reverting r228628; it broke at least one builder due to the forward declare of RaiseException.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 00:00:54 +00:00
Adrian Prantl
4f1b7f3100 Debug info: Use DW_OP_bit_piece instead of DW_OP_piece in the
intermediate representation. This
- increases consistency by using the same granularity everywhere
- allows for pieces < 1 byte
- DW_OP_piece didn't actually allow storing an offset.

Part of PR22495.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228631 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-09 23:57:15 +00:00
Duncan P. N. Exon Smith
a9a077681d ADT: Allow up to 18 arguments in hash_combine()
I just realized that the specialized metadata node patch I'm about to
commit won't compile on old compilers.  Bump `hash_combine()`'s support
for non-variadic templates to 18 (I tested this by reversing the logic
in the #ifdef).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-09 23:21:05 +00:00