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

23343 Commits

Author SHA1 Message Date
David Blaikie
ec41387ad6 Revert "[opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst"
This reverts commit r235458.

It looks like this might be breaking something LTO-ish. Looking into it
& will recommit with a fix/test case/etc once I've got more to go on.

llvm-svn: 235533
2015-04-22 18:16:49 +00:00
Pete Cooper
553bbedfdb Change MachineOperand::OpKind from unsigned char to a bitfield. NFC.
This causes OpKind and all the bitfields after it to use 32-bit load/stores instead of i24's for the existing bitfields.

Bugs will be filed to track whether clang and llvm could have generated the 32-bit operations in the front-end or optimizer.

Reviewed by Rafael.

llvm-svn: 235528
2015-04-22 17:48:26 +00:00
Yaron Keren
372925e7ab Recommit r235219, it's need for out-of-tree users of AlignOf.h.
llvm-svn: 235522
2015-04-22 16:43:56 +00:00
Lang Hames
76014c544d [patchpoint] Add support for symbolic patchpoint targets to SelectionDAG and the
X86 backend.

The code generated for symbolic targets is identical to the code generated for
constant targets, except that a relocation is emitted to fix up the actual
target address at link-time. This allows IR and object files containing
patchpoints to be cached across JIT-invocations where the target address may
change.

llvm-svn: 235483
2015-04-22 06:02:31 +00:00
Yaron Keren
b8b0518eaa Revert r235219, it's not needed after r235450.
llvm-svn: 235480
2015-04-22 05:06:57 +00:00
David Blaikie
df921652b4 [opaque pointer types] Serialize the value type for atomic store instructions
Without pointee types the space optimization of storing only the pointer
type and not the value type won't be viable - so add the extra type
information that would be missing.

llvm-svn: 235475
2015-04-22 04:14:46 +00:00
David Blaikie
253de8b56b [opaque pointer types] Serialize the value type for store instructions
Without pointee types the space optimization of storing only the pointer
type and not the value type won't be viable - so add the extra type
information that would be missing.

Storeatomic coming soon.

llvm-svn: 235474
2015-04-22 04:14:42 +00:00
Duncan P. N. Exon Smith
272b8f5b73 Linker: Add flag to override linkage rules
Add a flag to lib/Linker (and `llvm-link`) to override linkage rules.
When set, the functions in the source module *always* replace those in
the destination module.

The `llvm-link` option is `-override=abc.ll`.  All the "regular" modules
are loaded and linked first, followed by the `-override` modules.  This
is useful for debugging workflows where some subset of the module (e.g.,
a single function) is extracted into a separate file where it's
optimized differently, before being merged back in.

Patch by Luqman Aden!

llvm-svn: 235473
2015-04-22 04:11:00 +00:00
Craig Topper
a6afd6d359 Cleanup formatting for consistency with surrounding code.
llvm-svn: 235462
2015-04-22 02:09:39 +00:00
David Blaikie
0477b5459c [opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst
Calls to llvm::Value::mutateType are becoming extra-sensitive now that
instructions have extra type information that will not be derived from
operands or result type (alloca, gep, load, call/invoke, etc... ). The
special-handling for mutateType will get more complicated as this work
continues - it might be worth making mutateType virtual & pushing the
complexity down into the classes that need special handling. But with
only two significant uses of mutateType (vectorization and linking) this
seems OK for now.

Totally open to ideas/suggestions/improvements, of course.

With this, and a bunch of exceptions, we can roundtrip an indirect call
site through bitcode and IR. (a direct call site is actually trickier...
I haven't figured out how to deal with the IR deserializer's lazy
construction of Function/GlobalVariable decl's based on the type of the
entity which means looking through the "pointer to T" type referring to
the global)

llvm-svn: 235458
2015-04-21 23:26:57 +00:00
Lang Hames
fdb0fb38b7 Update comment. NFC.
llvm-svn: 235417
2015-04-21 21:15:35 +00:00
Daniel Berlin
3991a891cf Revamp PredIteratorCache interface to be cleaner.
Summary:
This lets us use range based for loops.

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 235416
2015-04-21 21:11:50 +00:00
Duncan P. N. Exon Smith
8bc0dcc184 DebugInfo: Remove DIArray and DITypeArray typedefs
Remove the `DIArray` and `DITypeArray` typedefs, preferring the
underlying types (`DebugNodeArray` and `MDTypeRefArray`, respectively).

llvm-svn: 235413
2015-04-21 20:07:38 +00:00
Duncan P. N. Exon Smith
511d9ff510 DebugInfo: Use MDType in DITypeIdentifierMap
Use `MDType*` instead of `MDNode*` in `DITypeIdentifierMap`, since all
the members should be types.

llvm-svn: 235407
2015-04-21 19:17:20 +00:00
Daniel Berlin
5fd7b29133 Move IDF Calculation to a separate file, expose an interface to it.
Summary:
MemorySSA uses this algorithm as well, and this enables us to reuse the code in both places.

There are no actual algorithm or datastructure changes in here, just code movement.

Reviewers: qcolombet, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 235406
2015-04-21 19:13:02 +00:00
Duncan P. N. Exon Smith
a87225dfd4 DebugInfo: Prune unnecessary forward declarations
Probably these forward declarations were once useful, but they certainly
don't belong here now.

llvm-svn: 235405
2015-04-21 19:00:26 +00:00
Duncan P. N. Exon Smith
8911bb4284 DebugInfo: Drop rest of DIDescriptor subclasses
Delete the remaining subclasses of (the already deleted) `DIDescriptor`.
Part of PR23080.

llvm-svn: 235404
2015-04-21 18:44:06 +00:00
Reid Kleckner
3b4014368f Re-land r235154-r235156 under the existing -sehprepare flag
Keep the old SEH fan-in lowering on by default for now, since projects
rely on it.  This will make it easy to test this change with a simple
flag flip.

llvm-svn: 235399
2015-04-21 18:23:57 +00:00
Toma Tabacu
1b99f111c2 [mips] [IAS] Implement the .asciiz directive.
Summary:
This directive is exactly the same as .asciz, except it's only used by MIPS.
It is used to store null terminated strings in object files.

Reviewers: rafael, dsanders, echristo

Reviewed By: dsanders, echristo

Subscribers: echristo, llvm-commits

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

llvm-svn: 235382
2015-04-21 11:50:52 +00:00
Elena Demikhovsky
abf0138a81 AVX-512: Added logical and arithmetic instructions for SKX
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 235375
2015-04-21 10:27:40 +00:00
Duncan P. N. Exon Smith
dc9077df15 DebugInfo: Delete subclasses of DIScope
Delete subclasses of (the already defunct) `DIScope`, updating users to
use the raw pointers from the `Metadata` hierarchy directly.

llvm-svn: 235356
2015-04-20 22:10:08 +00:00
Duncan P. N. Exon Smith
a8e8f5d3ae DebugInfo: Delete old subclasses of DIType
Delete subclasses of (the already deleted) `DIType` in favour of
directly using pointers from the `Metadata` hierarchy.

While `DICompositeType` wraps `MDCompositeTypeBase` and `DIDerivedType`
wraps `MDDerivedTypeBase`, most uses of each really meant the more
specific `MDCompositeType` and `MDDerivedType`.

llvm-svn: 235351
2015-04-20 21:17:32 +00:00
Tom Stellard
1b7911183d IR: Add ConstantFP::getNaN()
This is a wrapper around APFloat::getNaN().

llvm-svn: 235332
2015-04-20 19:38:24 +00:00
Duncan P. N. Exon Smith
13554f3cb5 DebugInfo: Remove DIType
This is the last major parent class, so I'll probably start deleting
classes in batches now.  Looks like many of the references to the DI*
hierarchy were updated organically along the way.

llvm-svn: 235331
2015-04-20 18:52:06 +00:00
Duncan P. N. Exon Smith
4fbe63c785 DebugInfo: Remove DIScope
Replace uses of `DIScope` with `MDScope*`.  There was one spot where
I've left an `MDScope*` uninitialized (where `DIScope` would have been
default-initialized to `nullptr`) -- this is intentional, since the
if/else that follows should unconditional assign it to a value.

llvm-svn: 235327
2015-04-20 18:32:29 +00:00
Duncan P. N. Exon Smith
5d6b438e18 DebugInfo: Remove typedefs for DITypeRef, etc.
Remove typedefs for type refs:

  - DITypeRef => MDTypeRef
  - DIScopeRef => MDScopeRef
  - DIDescriptorRef => DebugNodeRef

llvm-svn: 235323
2015-04-20 18:20:03 +00:00
Rafael Espindola
28542bc9a4 Don't allow pwrite to resize a stream.
The current implementations could exhibit some behavior differences:

raw_fd_ostream: Whatever the underlying fd does with seek+write. In a normal
file, the write position would be back to the old offset.

raw_svector_ostream: The write position is always the end of the stream, so
after pwrite the write position would be the new end. This matches what OS_X
(all BSD?) do with a pwrite in a O_APPEND fd.

Given that we don't need that feature and don't use O_APPEND a lot in LLVM,
just disallow it.

I am open to suggestions on renaming pwrite to something else, but this fixes
the issue for now.

Thanks to Yaron Keren for reporting it.

llvm-svn: 235303
2015-04-20 13:04:30 +00:00
Karthik Bhat
5e3fcb9de3 Fix buildbot failure on darwin from r235284.
llvm-svn: 235287
2015-04-20 07:07:10 +00:00
Karthik Bhat
e3028c8087 [NFC] Refactor identification of reductions as common utility function.
This patch refactors reduction identification code out of LoopVectorizer and
exposes them as common utilities.
No functional change.
Review: http://reviews.llvm.org/D9046

llvm-svn: 235284
2015-04-20 04:38:33 +00:00
Simon Atanasyan
03d9746b57 [mips] Update MIPS relocations list
No functional changes.

llvm-svn: 235278
2015-04-19 20:51:55 +00:00
Eric Christopher
4995cc0feb Remove the FCFI option from TargetOptions as it is currently unused.
llvm-svn: 235269
2015-04-19 03:21:08 +00:00
Eric Christopher
5f337055c2 Remove CFIFuncName from TargetOptions as it is currently unused.
llvm-svn: 235268
2015-04-19 03:21:04 +00:00
Eric Christopher
b2b28a6b63 Remove the CFIEnforcing flag from TargetOptions as it is unused.
llvm-svn: 235267
2015-04-19 03:20:59 +00:00
Eric Christopher
853f61980f Remove the CFIType TargetOption as it is unused.
llvm-svn: 235266
2015-04-19 03:20:55 +00:00
Eric Christopher
2b1be84066 Remove the JITEmitDebugInfo TargetOptions as they're only set and
not used anywhere in llvm.

llvm-svn: 235265
2015-04-19 03:20:51 +00:00
Duncan P. N. Exon Smith
de4cfb653d DebugInfo: Delete DIDescriptor (but not its subclasses)
Delete `DIDescriptor` and update the remaining users.  I'll follow-up by
deleting subclasses in manageable groups (top-down).

llvm-svn: 235248
2015-04-18 00:35:36 +00:00
Duncan P. N. Exon Smith
c7f08b339f DebugInfo: Remove DIDescriptor from the DebugInfo API
Stop using `DIDescriptor` and its subclasses in the `DebugInfoFinder`
API, as well as the rest of the API hanging around in `DebugInfo.h`.

llvm-svn: 235240
2015-04-17 23:20:10 +00:00
Zachary Turner
7bf82f4127 [PDB] Support executables and source/line info.
Previously DebugInfoPDB could only load data for a PDB given a
path to the PDB.  It could not open an EXE and find the matching
PDB and verify it matched, etc.  This patch adds support for that
so that we can simply load debug information for a PDB directly.

Additionally, this patch extends DebugInfoPDB to support getting
source and line information for symbols.

llvm-svn: 235237
2015-04-17 22:40:36 +00:00
David Blaikie
8a16658970 [opaque pointer type] Access the pointee of the result type from the GEP rather than pulling it out of the pointer result type
The implementation of this GEP::getResultElementType will be refactored
to either rely on a member variable, or recompute the value from the
indicies (any preferences?).

llvm-svn: 235236
2015-04-17 22:32:20 +00:00
David Blaikie
513ab6886b [opaque pointer type] Avoid creating (and then unwrapping) a pointer type to compute the result type of a GEP
llvm-svn: 235234
2015-04-17 22:32:16 +00:00
Rafael Espindola
2e994b78fe Compute A-B when A or B is weak.
Similar to r235222, but for the weak symbol case.

In an "ideal" assembler/object format an expression would always refer to the
final value and A-B would only be computed from a section in the same
comdat as A and B with A and B strong.

Unfortunately that is not the case with debug info on ELF, so we need an
heuristic.  Since we need an heuristic, we may as well use the same one as
gas:

* call weak_sym : produces a relocation, even if in the same section.
* A - weak_sym and weak_sym -A: don't produce a relocation if we can
  compute it.

This fixes pr23272 and changes the fix of pr22815 to match what gas does.

llvm-svn: 235227
2015-04-17 21:15:17 +00:00
David Blaikie
7b0ae200c4 [opaque pointer types] Use the pointee type loaded from bitcode when constructing a LoadInst
Now (with a few carefully placed suppressions relating to general type
serialization, etc) we can round trip a simple load through bitcode and
textual IR without calling getElementType on a PointerType.

llvm-svn: 235221
2015-04-17 19:56:21 +00:00
Aaron Ballman
c32277bfbc Suppressing the C4324 warnings generated by MSVC. This is the only declarative instance that would generate the warning, but it accounted for about 525+ warnings due to template instantiations. This is a marginal-value warning which we may decide to disable more broadly, but since this header is in Support and may be used out of tree, it's a low burden for us to be warning-free in this case.
llvm-svn: 235219
2015-04-17 19:35:44 +00:00
Pirama Arumuga Nainar
f8369b5437 Add support to promote f16 to f32
Summary:
This patch adds legalization support to operate on FP16 as a load/store type
and do operations on it as floats.

Tests for ARM are added to test/CodeGen/ARM/fp16-promote.ll

Reviewers: srhines, t.p.northover

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

llvm-svn: 235215
2015-04-17 18:36:25 +00:00
Manman Ren
b67a75becd [LTO API] add lto_codegen_set_should_internalize.
When debugging LTO issues with ld64, we use -save-temps to save the merged
optimized bitcode file, then invoke ld64 again on the single bitcode file.
The saved bitcode file is already internalized, so we can call
lto_codegen_set_should_internalize and skip running internalization again.

rdar://20227235

llvm-svn: 235211
2015-04-17 17:10:09 +00:00
Kit Barton
ddc4c0a63d Add support for v1i128 type.
The v1i128 type is needed for the quadword add/substract instructions introduced
in POWER8. Futhermore, the PowerPC ABI specifies that parameters of type v1i128
are to be passed in a single vector register, while parameters of type i128 are
passed in pairs of GPRs. Thus, it is necessary to be able to differentiate
between v1i128 and i128 in LLVM.

http://reviews.llvm.org/D8564

llvm-svn: 235198
2015-04-17 16:11:05 +00:00
Kit Barton
9fb427d0ff Add the i128 builtin type to LLVM.
The i128 type is needed as a builtin type in order to support the v1i128 vector
type. The PowerPC ABI requires that the i128 and v1i128 types are handled
differently when passed as parameters to functions (i128 is passed in pairs of
GPRs, v1i128 is passed in a single vector register). 

http://reviews.llvm.org/D8564

llvm-svn: 235196
2015-04-17 15:32:15 +00:00
Rafael Espindola
3882872dda Move AliasedSymbol to MachObjectWriter.
It was only used by MachO.
Part of pr19627.

llvm-svn: 235185
2015-04-17 12:28:43 +00:00
Nico Weber
ffd0269e17 Revert r235154-r235156, they cause asserts when building win64 code (http://crbug.com/477988)
llvm-svn: 235170
2015-04-17 09:10:43 +00:00
David Blaikie
18f7eb6578 Narrow down the type of CallInst::getFunctionType to a FunctionType
llvm-svn: 235159
2015-04-17 06:40:11 +00:00