1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

22504 Commits

Author SHA1 Message Date
Rafael Espindola
4467ec2e41 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>.

llvm-svn: 228980
2015-02-12 23:29:51 +00:00
David Blaikie
52492e048a Add missing override.
llvm-svn: 228974
2015-02-12 22:58:53 +00:00
Zachary Turner
8f5e13b9c7 Attempt to fix the build again.
llvm-svn: 228964
2015-02-12 21:25:58 +00:00
Zachary Turner
5a969b378c Attempt to fix Linux builds after r228960.
llvm-svn: 228962
2015-02-12 21:17:07 +00:00
Rafael Espindola
83518ea75f Remove mostly unused setters.
Most of the code was setting the TargetOptions directly.

llvm-svn: 228961
2015-02-12 21:16:34 +00:00
Zachary Turner
6cde1e9388 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.

llvm-svn: 228960
2015-02-12 21:09:24 +00:00
Rafael Espindola
5feecddc53 On ELF, put PIC jump tables in a non executable section.
Fixes PR22558.

llvm-svn: 228939
2015-02-12 17:46:49 +00:00
Rafael Espindola
fb65819e24 Put each jump table in an independent section if the function is too.
This allows the linker to GC both, fixing pr22557.

llvm-svn: 228937
2015-02-12 17:16:46 +00:00
Benjamin Kramer
4b76aa3d46 MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros
Update all callers.

llvm-svn: 228930
2015-02-12 15:35:40 +00:00
Andrea Di Biagio
7ca0db442c [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

llvm-svn: 228923
2015-02-12 14:17:24 +00:00
Benjamin Kramer
c7a7636094 BitVector: Remove manual bit width dispatch, this is handled by templates
NFC.

llvm-svn: 228922
2015-02-12 14:02:58 +00:00
Benjamin Kramer
d08a40831d 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.

llvm-svn: 228921
2015-02-12 13:47:29 +00:00
Adrian Prantl
9ec54ab53b Generalize DIBuilder's createReplaceableForwardDecl() to a more flexible
createReplaceableCompositeType() that allows to create non-forward-declared
temporary nodes.

Paired commit with CFE.

llvm-svn: 228852
2015-02-11 17:45:05 +00:00
Andrea Di Biagio
70c7608263 [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

llvm-svn: 228829
2015-02-11 14:22:18 +00:00
Arnaud A. de Grandmaison
bfad2ea31a [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.

llvm-svn: 228816
2015-02-11 08:25:36 +00:00
Reid Kleckner
86643b627c 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.

llvm-svn: 228782
2015-02-11 01:23:16 +00:00
Zachary Turner
473b4aac78 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.

llvm-svn: 228755
2015-02-10 22:43:25 +00:00
Zachary Turner
422f6e29d5 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.

llvm-svn: 228747
2015-02-10 21:17:52 +00:00
Aaron Ballman
e5024a035a Now use the __debugbreak intrinsic instead of calling RaiseException; it requires no forward declares and still calls VEH.
llvm-svn: 228745
2015-02-10 21:13:04 +00:00
Aaron Ballman
39da612547 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.
llvm-svn: 228738
2015-02-10 20:13:52 +00:00
Andrew Kaylor
fff974fc6d 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

llvm-svn: 228733
2015-02-10 19:52:43 +00:00
Duncan P. N. Exon Smith
73d123e7bc 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.

llvm-svn: 228726
2015-02-10 19:13:46 +00:00
Paul Robinson
b0fca412c4 Explicitly initialize a flag in a default constructor.
Works around a Visual C++ issue.

Patch by Douglas Yung!

llvm-svn: 228699
2015-02-10 15:30:02 +00:00
Aaron Ballman
a7a249093b 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.

llvm-svn: 228691
2015-02-10 14:28:11 +00:00
Lang Hames
27d2677ad7 [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.

llvm-svn: 228676
2015-02-10 07:35:39 +00:00
Lang Hames
132f37f8e5 [Orc] Add missing casserts header to JITSymbol.h.
llvm-svn: 228675
2015-02-10 07:26:19 +00:00
Zachary Turner
0d4fc2d795 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

llvm-svn: 228669
2015-02-10 05:04:25 +00:00
Duncan P. N. Exon Smith
61535117b4 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.

llvm-svn: 228652
2015-02-10 01:59:57 +00:00
Duncan P. N. Exon Smith
6c66615baf IR: Add accessors to MDExpression
Add some accessors to `MDExpression`.

llvm-svn: 228648
2015-02-10 01:36:46 +00:00
Duncan P. N. Exon Smith
9fcf9cd379 AsmParser: Add stubs for specialized MDNodes, NFC
Well, the exact error from the failed parse will change, but...

llvm-svn: 228644
2015-02-10 01:08:16 +00:00
Duncan P. N. Exon Smith
1c43bf9cfb 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.

llvm-svn: 228640
2015-02-10 00:52:32 +00:00
Lang Hames
2359267cca [Orc] Back out one of the GCC ICE workarounds from r228568. NFC.
llvm-svn: 228637
2015-02-10 00:37:26 +00:00
Aaron Ballman
da25678483 Reverting r228628; it broke at least one builder due to the forward declare of RaiseException.
llvm-svn: 228633
2015-02-10 00:00:54 +00:00
Adrian Prantl
f10ec50249 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.

llvm-svn: 228631
2015-02-09 23:57:15 +00:00
Duncan P. N. Exon Smith
8456fa3c41 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).

llvm-svn: 228629
2015-02-09 23:21:05 +00:00
Aaron Ballman
230da450ab 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.
llvm-svn: 228628
2015-02-09 23:11:39 +00:00
Ramkumar Ramachandra
545e586a0e [Statepoint] Improve two asserts, fix some style (NFC)
Summary:
It's important that our users immediately know what gc.safepoint_poll
is. Also fix the style of the declaration of CreateGCStatepoint, in
preparation for another change that will wrap it.

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 228626
2015-02-09 23:02:10 +00:00
Duncan P. N. Exon Smith
ec76782680 IR: Take uint64_t in DIBuilder::createExpression()
`DIExpression` deals with `uint64_t`, so it doesn't make sense that
`createExpression()` is created from `int64_t`.  Switch to `uint64_t` to
unify them.

I've temporarily left in the `int64_t` version, which forwards to the
`uint64_t` version.  I'll delete it once I've updated the callers.

llvm-svn: 228619
2015-02-09 22:13:27 +00:00
Duncan P. N. Exon Smith
03fb95aca6 IR: Document horrible abuse of loose DIDescriptor, NFC
I'll circle back and fix this somehow; for now I just don't want to
forget about it.

llvm-svn: 228608
2015-02-09 21:26:34 +00:00
Duncan P. N. Exon Smith
c4219c892a IR: Remove dead code in DITemplate*
These are never referenced or filled in.

llvm-svn: 228607
2015-02-09 21:23:34 +00:00
Ben Langmuir
615dcdb7b4 Reduce the LockFileManager timeout, and provide unsafeRemoveLockFile
5 minutes is an eternity, so try to strike a better balance between
waiting long enough for any reasonable module build and not so long that
users kill the process because they think it's hanging.

Also give the client a way to delete the lock file after a timeout.

llvm-svn: 228603
2015-02-09 20:34:24 +00:00
Sanjoy Das
db6aec61b3 Address post-commit review for rL228587: make it explicit that the
<NW> bit of a SCEVAddRecExpr does not depend on the sign of the step
and the start value of the step.

llvm-svn: 228595
2015-02-09 19:39:00 +00:00
Sanjoy Das
2602c601e8 Clarify the wording on what it means for a SCEVAddRecExpr to be <NW>.
llvm-svn: 228587
2015-02-09 18:44:42 +00:00
Lang Hames
a19eaab874 [Orc] Revert r228567 (GCC ICE workaround) - it doesn't seem to have helped.
As far as I can tell r228568 was the right workaround, and r228567 was
unnecessary. If reverting this causes problems on the bots I'll reinstate it.

llvm-svn: 228585
2015-02-09 18:16:43 +00:00
Lang Hames
f1ea70a68b [Orc] Try another workaround for the GCC 4.7.2 ICE introduced in r228557. NFC.
llvm-svn: 228568
2015-02-09 07:47:32 +00:00
Lang Hames
6983fc8f43 [Orc] Tweak lambda capture lists to try to avoid an ICE on gcc-4.7.2. NFC.
Apparently gcc-4.7.2 is touchy about 'this' appearing in a lambda capture list
along with other captures. I've rewritten my captures to try to avoid the issue.

llvm-svn: 228567
2015-02-09 07:22:56 +00:00
Lang Hames
79fa1f9f13 [Orc] Fix the MSVC bots by using LLVM_EXPLICIT rather than explicit.
llvm-svn: 228564
2015-02-09 04:46:41 +00:00
Lang Hames
92f9dd24ac [Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.
This patch refactors a key piece of the Orc APIs: It removes the
*::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target
addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn
respectively, which return instances of the new JITSymbol type. Unlike the old
methods, calling findSymbol or findSymbolIn does not cause the symbol to be
immediately materialized when found. Instead, the symbol will be materialized
if/when the getAddress method is called on the returned JITSymbol. This allows
us to query for the existence of symbols without actually materializing them. In
the future I expect more information to be attached to the JITSymbol class, for
example whether the returned symbol is a weak or strong definition. This will
allow us to properly handle weak symbols and multiple definitions.

llvm-svn: 228557
2015-02-09 01:20:51 +00:00
Zachary Turner
71e3bf6e80 Make PDBSymbol's IPDBSymbol reference const.
llvm-svn: 228553
2015-02-08 22:53:53 +00:00
Zachary Turner
754851ad80 DebugInfoPDB: Make the symbol base case hold an IPDBSession ref.
Dumping a symbol often requires access to data that isn't inside
the symbol hierarchy, but which is only accessible through the
top-level session.  This patch is a pure interface change to give
symbols a reference to the session.

llvm-svn: 228542
2015-02-08 20:58:09 +00:00