Commit Graph

27468 Commits

Author SHA1 Message Date
Davide Italiano
d77d4c07fb [PM] Port per-function SCCP to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:18:25 +00:00
Rafael Espindola
ae88dc47a7 White space cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 13:10:27 +00:00
Ashutosh Nema
1db659ede4 Add new flag and intrinsic support for MWAITX and MONITORX instructions
Summary:

MONITORX/MWAITX instructions provide similar capability to the MONITOR/MWAIT
pair while adding a timer function, such that another termination of the MWAITX
instruction occurs when the timer expires. The presence of the MONITORX and
MWAITX instructions is indicated by CPUID 8000_0001, ECX, bit 29.

The MONITORX and MWAITX instructions are intercepted by the same bits that
intercept MONITOR and MWAIT. MONITORX instruction establishes a range to be
monitored. MWAITX instruction causes the processor to stop instruction execution
and enter an implementation-dependent optimized state until occurrence of a
class of events.

Opcode of MONITORX instruction is "0F 01 FA". Opcode of MWAITX instruction is
"0F 01 FB". These opcode information is used in adding tests for the
disassembler.

These instructions are enabled for AMD's bdver4 architecture.

Patch by Ganesh Gopalasubramanian!

Reviewers: echristo, craig.topper, RKSimon
Subscribers: RKSimon, joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19795


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:59:12 +00:00
Rafael Espindola
2dc637165b Don't pass a Reloc::Model to MC.
MC only needs to know if the output is PIC or not. It never has to
decide about creating GOTs and PLTs for example. The only thing that
MC itself uses this information for is expanding "macros" in sparc and
mips. The rest I am pretty sure could be moved to CodeGen.

This is a cleanup and isolates the code from future changes to
Reloc::Model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:58:50 +00:00
Craig Topper
d20d564523 Strengthen type assertion for ISD::VSELECT ensuring that the condition has the name number of elements as the destination type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 06:55:55 +00:00
Craig Topper
f673dcd8f1 [X86] Remove GCC builtin from add/sub/mul/div ss/sd intrinsics. These haven't been used as builtins in clang for a long time.
Can probably remove the intrinsics entirely, but that will require more work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 01:36:25 +00:00
Zachary Turner
6f44b1d369 [codeview] Move Symbol / Type enum defs into CodeView.h
This fixes a build breakage that would otherwise only be fixable
through a circular header dependency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:57:10 +00:00
Zachary Turner
60ce11fcce [codeview] Some cleanup of Symbol Records.
* Reworks the CVSymbolTypes.def to work similarly to TypeRecords.def.
* Moves some enums from SymbolRecords.h to CodeView.h to maintain
  consistency with how we do type records.
* Generalize a few simple things like the record prefix
* Define the leaf enum and the kind enum similar to how we do with tyep
  records.

Differential Revision: http://reviews.llvm.org/D20342
Reviewed By: amccarth, rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:50:21 +00:00
Zachary Turner
8e5ffc9803 Revert "[obj2yaml] [yaml2obj] Support MachO section and section_64
structs"

This reverts commits r269845, r269846, and r269850 as they
introduce a crash in obj2yaml when trying to do a roundtrip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:38:22 +00:00
Rui Ueyama
dce33b5457 pdbdump: Print out more strcutures.
I don't yet fully understand the meaning of these data strcutures,
but at least it seems that their sizes and types are correct.
With this change, we can read publics streams till end.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:07:48 +00:00
Rafael Espindola
c27d8b42ef Delete deprecated function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:07:45 +00:00
Lang Hames
47ad42e0ee [Object] Move isNotObjectErrorInvalidFileType out of header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:38:53 +00:00
Justin Bogner
9c81a3f598 [PM] Port DSE to the new pass manager
Patch by JakeVanAdrighem. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:38:13 +00:00
Chris Bieneman
b04144c7d6 [obj2yaml] [yaml2obj] Support MachO section and section_64 structs
This patch adds round trip support for MachO section structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:31:02 +00:00
Xinliang David Li
3c661ab452 minor cleanup /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:06:16 +00:00
Zachary Turner
cbc09f709e [codeview] Macroify definition of bitwise operators for flags enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:21:01 +00:00
Chris Bieneman
0865cea8c3 Reapply r269782 "[obj2yaml] [yaml2obj] Support for MachO load command structures""
This adds support for all the MachO *_command structures. The load_command payloads still are not represented, but that will come next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 19:44:06 +00:00
Rafael Espindola
8ae1501586 Delete unused defaults.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 18:11:58 +00:00
Rafael Espindola
09ba7ecff8 Don't repeat name in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:57:49 +00:00
Chris Bieneman
923a9ba5c6 Revert "[obj2yaml] [yaml2obj] Support for MachO load command structures"
This reverts commit r269782 because it broke bots with -fpermissive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:13:50 +00:00
Kevin Enderby
77be094e2f Change llvm-objdump, llvm-nm and llvm-size when reporting an object file error
when the object is in an archive to use something like libx.a(foo.o) as part of
the error message.

Also changed llvm-objdump and llvm-size to be like llvm-nm and ignore non-object
files in archives and not produce any error message.

To do this Archive::Child::getAsBinary() was changed from ErrorOr<...> to
Expected<...> then that was threaded up to its users.

Converting this interface to Expected<> from ErrorOr<> does involve
touching a number of places. To contain the changes for now the use of
errorToErrorCode() is still used in one place yet to be fully converted.

Again there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comments for those.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:10:12 +00:00
Chris Bieneman
4a038a7aac [obj2yaml] [yaml2obj] Support for MachO load command structures
This adds support for all the MachO *_command structures. The load_command payloads still are not represented, but that will come next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:03:28 +00:00
Reid Kleckner
87749e8b5d [codeview] Test serialization of all known type records
This just checks that we emit all type records once, and then after
merging the type stream with no other type streams, we still emit every
kind of type record.

We could test the dumper output more closely, but that would make the
test very brittle. Currently we're just getting coverage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 16:20:35 +00:00
Teresa Johnson
a486381660 [ThinLTO] Option to control path of distributed backend files
Summary:
Add support to control where files for a distributed backend (the
individual index files and optional imports files) are created.

This is invoked with a new thinlto-prefix-replace option in the gold
plugin and llvm-lto. If specified, expects a string of the form
"oldprefix:newprefix", and instead of generating these files in the
same directory path as the corresponding bitcode file, will use a path
formed by replacing the bitcode file's path prefix matching oldprefix
with newprefix.

Also add a new replace_path_prefix helper to Path.h in libSupport.

Depends on D19636.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 14:45:30 +00:00
Derek Schuff
4bfd3e29b1 Factor PrologEpilogInserter around spilling, frame finalization, and scavenging
PrologEpilogInserter has these 3 phases, which are related, but not
all of them are needed by all targets. This patch reorganizes PEI's
varous functions around those phases for more clear separation. It also
introduces a new TargetMachine hook, usesPhysRegsForPEI, which is true
for non-virtual targets. When it is true, all the phases operate as
before, and PEI requires the AllVRegsAllocated property on
MachineFunctions. Otherwise, CSR spilling and scavenging are skipped and
only prolog/epilog insertion/frame finalization is done.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 08:49:59 +00:00
Richard Smith
85bfb07553 Add a (size, value) constructor to TinyPtrVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269711 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:57:47 +00:00
Richard Smith
80bf9f5105 Add missing TinyPtrVector functionality: reverse iterators and conversion of
TinyPtrVector<T*> to ArrayRef<const T*>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:45:58 +00:00
Vedant Kumar
ce4aff93aa Revert "Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""
This reverts commit r269694. MSVC says:

error C2086: 'char llvm::ProfErrorInfoBase<enum llvm::instrprof_error>::ID' : redefinition

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:03:38 +00:00
Vedant Kumar
515ee3e025 Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"
Transition InstrProf and Coverage over to the stricter Error/Expected
interface.

Changes since the initial commit:
- Address undefined-var-template warning.
- Fix error message printing in llvm-profdata.
- Check errors in loadTestingFormat() + annotateAllFunctions().
- Defer error handling in InstrProfIterator to InstrProfReader.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:49:39 +00:00
Xinliang David Li
addf109ca6 sync up common profile header /nfc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:34:39 +00:00
Adam Nemet
095bb7d545 [LAA] Comment couldPreventStoreLoadForward. NFC
Also s/Cycles/Iters/ in NumCyclesForStoreLoadThroughMemory to make it
clear that this is not about clock cycles but loop cycles/iterations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 16:57:47 +00:00
Xinliang David Li
61ce277483 [PM] Port indirect call promotion pass to new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 16:31:07 +00:00
Renato Golin
3b0d377ef8 [llc] New diagnostic handler
Without a diagnostic handler installed, llc's behaviour is to exit on the first
error that it encounters. This is very different from the behaviour of clang
and other front ends, which try to gather as many errors as possible before
exiting.

This commit adds a diagnostic handler to llc, allowing it to find and report
more than one error. The old behaviour is preserved under a flag (-exit-on-error).

Some of the tests fail with the new diagnostic handler, so they have to use the
new flag in order to run under the previous behaviour. Some of these are known
bugs, others need further investigation. Ideally, we should fix the tests and
remove the flag at some point in the future.

Reapplied after fixing the LLDB build that was broken due to the new
DiagnosticSeverity in LLVMContext.h, and fixed an UB in the new change.

Patch by Diana Picus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 14:28:02 +00:00
Craig Topper
ef1f2996c1 [AVX512] Fix mask argument type for insertf32x4/inserti32x4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269616 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-15 21:24:45 +00:00
Craig Topper
d175e89cb6 [AVX512] Change 512-bit insertf32x4/inserti32x4 builtin name to match gcc.
Clang doesn't currently use this builtin. Will fix that soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-15 20:09:34 +00:00
Xinliang David Li
e74197bd25 [profile] Header file cleanup /NFC
Remove runtime specific decls from the common header.
This change also syncs up InstrProfData.inc between
llvm and compiler_rt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-15 20:06:11 +00:00
Xinliang David Li
17b42bdb89 Rename pass name to prepare to new PM porting /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269586 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-15 01:04:24 +00:00
Mehdi Amini
9b61d154fc Revert "Revert "Revert 220932.": "Removing the static initializer in ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex""
This reverts commit r269577.
Broke NetBSD, waiting for Kamil to investigate

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269584 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 23:44:21 +00:00
Davide Italiano
d1aa4ea020 [PM] Refactor cross-registration of AM into an helper.
Requested by: Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 23:21:50 +00:00
Craig Topper
b776ae7788 [AVX512] Make the permd intrinsics take a 32-bit immediate to match the software spec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 21:13:20 +00:00
Mehdi Amini
e750cc1694 Revert "Revert 220932.": "Removing the static initializer in ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex"
This reverts commit r221331 and reinstate r220932 as discussed in D19271.
Original commit message was:

This patch adds an llvm_call_once which is a wrapper around
std::call_once on platforms where it is available and devoid
of bugs. The patch also migrates the ManagedStatic mutex to
be allocated using llvm_call_once.

These changes are philosophically equivalent to the changes
added in r219638, which were reverted due to a hang on Win32
which was the result of a bug in the Windows implementation
of std::call_once.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 20:55:52 +00:00
Renato Golin
7e38263edc Revert "[llc] New diagnostic handler"
This reverts commit r269563. Even though now it passes all LLDB bots
after a local fix, there's a new buildbot it fails with tests that we
hadn't seen locally:

http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/15647

Adding those tests to the list to investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269568 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 14:37:11 +00:00
Renato Golin
2c05d88b8d [llc] New diagnostic handler
Without a diagnostic handler installed, llc's behaviour is to exit on the first
error that it encounters. This is very different from the behaviour of clang
and other front ends, which try to gather as many errors as possible before
exiting.

This commit adds a diagnostic handler to llc, allowing it to find and report
more than one error. The old behaviour is preserved under a flag (-exit-on-error).

Some of the tests fail with the new diagnostic handler, so they have to use the
new flag in order to run under the previous behaviour. Some of these are known
bugs, others need further investigation. Ideally, we should fix the tests and
remove the flag at some point in the future.

Reapplied after fixing the LLDB build that was broken due to the new
DiagnosticSeverity in LLVMContext.h.

Patch by Diana Picus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269563 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 13:15:22 +00:00
NAKAMURA Takumi
b363ec418a llvm/Support/MachO.h: Fix warnings. [-Wpedantic]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 08:00:11 +00:00
Chandler Carruth
2e531af53a Revert "Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""
This reverts commit r269491. It triggers warnings with Clang, breaking
builds for -Werror users including several build bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 05:26:26 +00:00
Mehdi Amini
5787524256 Remove unwanted fprintf debug
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269536 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 04:41:14 +00:00
Craig Topper
597f8663a5 Revert r269534 "Silence a -Wundefined-var-template build warning." The bots didn't like that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 03:59:25 +00:00
Craig Topper
4d9e38884a Silence a -Wundefined-var-template build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269534 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 03:48:43 +00:00
Craig Topper
59cfb9caf5 [AVX512] Fix types for pshufd intrinsics. The immediate is the second argument and the mask is the 4th argument. Also move the 128/256 tests to the right test file.
Prior to this the immediate was a strange 16-bits and the 512-bit intrinsic couldn't receive the full 16 mask bits it needs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 00:47:18 +00:00
Reid Kleckner
fed38e2afb [codeview] Add type stream merging prototype
Summary:
This code is intended to be used as part of LLD's PDB writing. Until
that exists, this is exposed via llvm-readobj for testing purposes.

Type stream merging uses the following algorithm:

- Begin with a new empty stream, and a new empty hash table that maps
  from type record contents to new type index.
- For each new type stream, maintain a map from source type index to
  destination type index.
- For each record, copy it and rewrite its type indices to be valid in
  the destination type stream.
- If the new type record is not already present in the destination
  stream hash table, append it to the destination type stream, assign it
  the next type index, and update the two hash tables.
- If the type record already exists in the destination stream, discard
  it and update the type index map to forward the source type index to
  the existing destination type index.

Reviewers: zturner, ruiu

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14 00:02:53 +00:00