Commit Graph

282972 Commits

Author SHA1 Message Date
Eugene Zelenko 25cae5a21f [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 325412
2018-02-16 23:40:07 +00:00
Vitaly Buka 769134dac3 [ThinLTO] Allow indexing to request backend to ignore the module
Summary:
Gold plugin does not add pass to ThinLTO modules without useful symbols.
In this case ThinLTO can't create corresponding index file and some features, like CFI,
cannot be processes by backed correctly without index.
Given that we don't need the backed output we can request it to avoid
processing the module. This is implemented by this patch using new
"SkipModuleByDistributedBackend" flag.

Reviewers: pcc, tejohnson

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

Differential Revision: https://reviews.llvm.org/D42995

llvm-svn: 325411
2018-02-16 23:38:22 +00:00
Vitaly Buka c35ff824de [ThinLTO] Ignore object files with no ThinLTO modules if -fthinlto-index= is set
Summary:
ThinLTO compilation may decide not to split module and keep at as regular LTO.
In this can this module already processed during indexing and already a part of
merged object file. So here we can just skip it.

Reviewers: pcc, tejohnson

Reviewed By: tejohnson

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

Differential Revision: https://reviews.llvm.org/D42680

llvm-svn: 325410
2018-02-16 23:34:16 +00:00
Marc-Andre Laperle 373e30a264 [clangd] Rename some protocol field to lower case
Summary:
Also fixes a GCC compilation error.

Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>

Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D43411

llvm-svn: 325409
2018-02-16 23:12:26 +00:00
Konstantin Zhuravlyov ef9aafcddc AMDGPU: Remove unused private member of AMDGPUTargetELFStreamer
llvm-svn: 325408
2018-02-16 23:04:11 +00:00
Eric Christopher 9beff6d4e7 Run these tests, the errors were old and not valid anymore.
llvm-svn: 325407
2018-02-16 23:02:28 +00:00
Rui Ueyama 4aab7b1d91 Do not print out "no input files" twice.
Differential Revision: https://reviews.llvm.org/D43408

llvm-svn: 325406
2018-02-16 22:58:19 +00:00
Rui Ueyama f05124e60c Use wasm-ld instead of "lld -flavor wasm".
Invoking lld as ld.lld, ld.ld64, lld-link or wasm-ld is preferred
than invoking lld as lld and pass an -flavor option. We have "lld"
file mostly for historical reasons.

Differential Revision: https://reviews.llvm.org/D43407

llvm-svn: 325405
2018-02-16 22:58:02 +00:00
Konstantin Zhuravlyov 82a6199140 AMDGPU/LLD: Remove the use of binary file from one of the AMDGPU tests
Differential Revision: https://reviews.llvm.org/D43413

llvm-svn: 325404
2018-02-16 22:55:36 +00:00
Eric Christopher 8ceddb0ecd Remove an unused function.
llvm-svn: 325403
2018-02-16 22:46:47 +00:00
Eric Christopher e752e68575 Silence an unsigned vs signed compare warning.
llvm-svn: 325402
2018-02-16 22:46:45 +00:00
Aditya Nandakumar b63e763847 [GISel]: Make GlobalISelEmitter rule prioritization compatible with selectionDAG
This patch changes GlobalISelEmitter to rank patterns similar to how the
DAG does it (ie it computes a score for a pattern and adds the added
complexity to it).
This is so that the decision tree for GISelSelector remains compatible
with that of SelectionDAG.

https://reviews.llvm.org/D43270

llvm-svn: 325401
2018-02-16 22:37:15 +00:00
Konstantin Zhuravlyov b3ec7396ed AMDGPU: Update elf flags in amdgpu-elf-flags.s
This is required after r325399:
  - EF_AMDGPU_ARCH_GCN got removed
  - In the test, EF_AMDGPU_ARCH_GCN is replaced with EF_AMDGPU_MACH_AMDGCN_GFX803

llvm-svn: 325400
2018-02-16 22:35:36 +00:00
Konstantin Zhuravlyov 9122a63143 AMDGPU: Bring elf flags in sync with the spec
- Add MACH flags
- Add XNACK flag
- Add reserved flags
- Minor cleanups in docs

Differential Revision: https://reviews.llvm.org/D43356

llvm-svn: 325399
2018-02-16 22:33:59 +00:00
Sanjay Patel 08868e494e [Constant] add floating-point helpers for normal/finite-nz; NFC
...and delete the equivalent local functiona from InstCombine.

These might be useful to other InstCombine files or other passes
and makes FP queries more similar to integer constant queries.

llvm-svn: 325398
2018-02-16 22:32:54 +00:00
Rui Ueyama 14ee1140c1 Make sure we invoke ld64.lld and ld-wasm in the build directory.
llvm-svn: 325397
2018-02-16 22:19:38 +00:00
Martin Storsjo ef4f78bbf2 [COFF] Add support for ARM64 secrel relocations for add/load instructions
Differential Revision: https://reviews.llvm.org/D43287

llvm-svn: 325396
2018-02-16 22:02:38 +00:00
Marc-Andre Laperle 3e618ed8f0 [clangd] Implement textDocument/hover
Summary: Implemention of textDocument/hover as described in LSP definition.

This patch adds a basic Hover implementation.  When hovering a variable,
function, method or namespace, clangd will return a text containing the
declaration's scope, as well as the declaration of the hovered entity.
For example, for a variable:

  Declared in class Foo::Bar

  int hello = 2

For macros, the macro definition is returned.

This patch doesn't include:

- markdown support (the client I use doesn't support it yet)
- range support (optional in the Hover response)
- comments associated to variables/functions/classes

They are kept as future work to keep this patch simpler.

I added tests in XRefsTests.cpp.  hover.test contains one simple
smoketest to make sure the feature works from a black box perspective.

Reviewers: malaperle, krasimir, bkramer, ilya-biryukov

Subscribers: sammccall, mgrang, klimek, rwols, ilya-biryukov, arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D35894

Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
Signed-off-by: William Enright <william.enright@polymtl.ca>
llvm-svn: 325395
2018-02-16 21:38:15 +00:00
Craig Topper 27b9ac2372 [X86] In lowerVSELECTtoVectorShuffle, don't map undef select condition to undef in shuffle mask.
Undef in select condition means we should pick the element from one side or the other. An undef in a shuffle mask means pick any element from either source or worse.

I suspect by the time we get here most of the undefs in a constant vector have been removed by other things, but doing this for safety.

llvm-svn: 325394
2018-02-16 21:36:29 +00:00
Konstantin Zhuravlyov 331f97e171 AMDGPU: Bring processors and features in sync with the spec
- Remove gfx800
- Make iceland gfx802
- Add xnack to gfx902

Differential Revision: https://reviews.llvm.org/D43355

llvm-svn: 325393
2018-02-16 21:26:25 +00:00
Rui Ueyama 4f2b1189d5 Revert an accidental change to where "-flavor GNU" was used by intention.
llvm-svn: 325392
2018-02-16 21:24:01 +00:00
Alexey Bataev 8e39c3446f [OPENMP] Do not emit messages for templates in declare target
constructs.

The compiler may emit some extra warnings for functions, that are
implicit specialization of the templates, declared in the target region.

llvm-svn: 325391
2018-02-16 21:23:23 +00:00
Rui Ueyama 5c33bbed58 Replace -flavor {gnu,darwin} with ld64.lld or ld.lld.
llvm-svn: 325390
2018-02-16 21:16:57 +00:00
Zachary Turner 8826d24576 Try again to fix the build.
This doesn't repro with clang or MSVC so I'm just blindly
guessing.

llvm-svn: 325389
2018-02-16 21:10:34 +00:00
Zachary Turner 10a748aa1e Try to fix broken build with some compilers.
llvm-svn: 325388
2018-02-16 20:58:25 +00:00
Rui Ueyama 61dc84a4db Remove `else` after `break`.
llvm-svn: 325387
2018-02-16 20:53:53 +00:00
Zachary Turner cafd476836 Fix emission of PDB string table.
This was originally reported as a bug with the symptom being "cvdump
crashes when printing an LLD-linked PDB that has an S_FILESTATIC record
in it". After some additional investigation, I determined that this was
a symptom of a larger problem, and in fact the real problem was in the
way we emitted the global PDB string table. As evidence of this, you can
take any lld-generated PDB, run cvdump -stringtable on it, and it would
return no results.

My hypothesis was that cvdump could not *find* the string table to begin
with. Normally it would do this by looking in the "named stream map",
finding the string /names, and using its value as the stream index. If
this lookup fails, then cvdump would fail to load the string table.

To test this hypothesis, I looked at the name stream map generated by a
link.exe PDB, and I emitted exactly those bytes into an LLD-generated
PDB. Suddenly, cvdump could read our string table!

This code has always been hacky and we knew there was something we
didn't understand. After all, there were some comments to the effect of
"we have to emit strings in a specific order, otherwise things don't
work". The key to fixing this was finally understanding this.

The way it works is that it makes use of a generic serializable hash map
that maps integers to other integers. In this case, the "key" is the
offset into a buffer, and the value is the stream number. If you index
into the buffer at the offset specified by a given key, you find the
name. The underlying cause of all these problems is that we were using
the identity function for the hash. i.e. if a string's offset in the
buffer was 12, the hash value was 12. Instead, we need to hash the
string *at that offset*. There is an additional catch, in that we have
to compute the hash as a uint32 and then truncate it to uint16.

Making this work is a little bit annoying, because we use the same hash
table in other places as well, and normally just using the identity
function for the hash function is actually what's desired. I'm not
totally happy with the template goo I came up with, but it works in any
case.

The reason we never found this bug through our own testing is because we
were building a /parallel/ hash table (in the form of an
llvm::StringMap<>) and doing all of our lookups and "real" hash table
work against that. I deleted all of that code and now everything goes
through the real hash table. Then, to test it, I added a unit test which
adds 7 strings and queries the associated values. I test every possible
insertion order permutation of these 7 strings, to verify that it really
does work as expected.

Differential Revision: https://reviews.llvm.org/D43326

llvm-svn: 325386
2018-02-16 20:46:04 +00:00
Simon Pilgrim c2ee69035c Remove useless comment - seems to be a copy+paste typo. NFCI
llvm-svn: 325385
2018-02-16 20:41:06 +00:00
Rui Ueyama e351c3a438 Use write32le instead of write32<little>.
llvm-svn: 325384
2018-02-16 20:38:15 +00:00
Rui Ueyama 1184253891 Refactor wasm/WriterUtil.{cpp,h}.
Summary:
 - Makes code more in line with LLVM style (e.g. const char * -> StringRef)
 - Do not use formatv since we can construct message just by `+`
 - Replace some odd types such as `const StringRef` with more common type
 - Do not use default arguments if they are not necessary

Reviewers: sbc100

Subscribers: jfb, aheejin, llvm-commits, sunfish

Differential Revision: https://reviews.llvm.org/D43403

llvm-svn: 325383
2018-02-16 20:38:00 +00:00
Sam Clegg b2f6e1c2f2 [WebAssebmly] Remove unneeded cast. NFC.
llvm-svn: 325382
2018-02-16 20:26:15 +00:00
Petr Hosek 330a00c41e [clang-include-fixer] Use add_clang_tool instead add_clang_executable
This makes it possible to include clang-include-fixer as distribution
component when building Clang based toolchain using CMake.

Differential Revision: https://reviews.llvm.org/D43371

llvm-svn: 325381
2018-02-16 20:25:45 +00:00
Peter Collingbourne 09e04af42f ELF: Stop collecting a list of symbols in ArchiveFile.
There seems to be no reason to collect this list of symbols.

Also fix a bug where --exclude-libs would apply to all symbols that
appear in an archive's symbol table, even if the relevant archive
member was not added to the link.

Differential Revision: https://reviews.llvm.org/D43369

llvm-svn: 325380
2018-02-16 20:23:54 +00:00
Rafael Espindola f931c179ca Don't depend on "call foo" producing a X86_64_PC32.
Newer versions of the gnu assembler produce a X86_64_PLT32 for
calls. There is a change under review in llvm to do the same, so update
the tests to not depend on it.

We can still produce a R_X86_64_PC32 with ".long foo - .".

llvm-svn: 325379
2018-02-16 20:05:58 +00:00
Evandro Menezes 10ae20d80c [AArch64] Fix BITCAST lowering crash
The data type is assumed to be a vector, but sometimes it is not, leading
to an assertion.

Add simple test-case to verify this.

Differential revision: https://reviews.llvm.org/D42599

llvm-svn: 325378
2018-02-16 20:00:57 +00:00
Rui Ueyama 7b9ed65666 Style fix. NFC.
llvm-svn: 325377
2018-02-16 19:53:29 +00:00
Sam Clegg fe78ccf1a1 [WebAssembly] Fix bug is function signature checking
This bug effected undefined symbols that were resolved by
existing defined symbols.  We were skipping the signature
check in this case.

Differential Revision: https://reviews.llvm.org/D43399

llvm-svn: 325376
2018-02-16 19:45:41 +00:00
Reid Kleckner d23e73cda9 [MS] Make constexpr static data members implicitly inline
This handles them exactly the same way that we handle const integral
static data members with inline definitions, which is what MSVC does.

As a follow-up, now that we have a way to mark variables inline in the
AST, we should consider marking them implicitly inline there instead of
only treating them as inline in CodeGen. Unfortunately, this breaks a
lot of dllimport test cases, so that is future work for now.

Fixes PR36125.

llvm-svn: 325375
2018-02-16 19:44:47 +00:00
Eugene Zelenko a84485ed8d [Documentation] Fix Sphinx error. Limit text width to 80 characters.
llvm-svn: 325374
2018-02-16 19:31:28 +00:00
Alexey Bataev 9a75738b2b [OPENMP] Fix PR35873: Fix data-sharing attributes for const variables.
Compiler erroneously returned wrong data-sharing attributes for the
constant variables if they have explictly specified attributes.

llvm-svn: 325373
2018-02-16 19:16:54 +00:00
Changpeng Fang ba92059ca9 AMDGPU/SI: Extend promoting alloca to vector to arrays of up to 16 elements
Summary:
  This patch extends the promotion of alloca to vector to the arrays of up to 16 elements. Also we introduce
an option, -disable-promote-alloca-to-vector, to switch promotion to vector off, if needed.

Reviewers:
  arsenm

Differential Revision:
  https://reviews.llvm.org/D33559

llvm-svn: 325372
2018-02-16 19:14:17 +00:00
Craig Topper de565fc73e [X86] Only reorder srl/and on last DAG combiner run
This seems to interfere with a target independent brcond combine that looks for the (srl (and X, C1), C2) pattern to enable TEST instructions. Once we flip, that combine doesn't fire and we end up exposing it to the X86 specific BT combine which causes us to emit a BT instruction. BT has lower throughput than TEST.

We could try to make the brcond combine aware of the alternate pattern, but since the flip was just a code size reduction and not likely to enable other combines, it seemed easier to just delay it until after lowering.

Differential Revision: https://reviews.llvm.org/D43201

llvm-svn: 325371
2018-02-16 18:51:09 +00:00
Sam Clegg 3d1f4b954d [WebAssembly] Fix typos in comment. NFC.
Patch by Nicholas Wilson!

llvm-svn: 325370
2018-02-16 18:37:32 +00:00
Alexey Bataev 96dae81d7f [OPENMP] Fix parsing of the directives with inner directives.
The parsing may lead to compiler hanging because of the incorrect
processing of inner OpenMP pragmas.

llvm-svn: 325369
2018-02-16 18:36:44 +00:00
Craig Topper 79bd39db80 [X86] Remove call to ShrinkDemandedCosntant from the SHRUNKBLEND creation code.
We only run this code if know the condition isn't a constant vector. ShrinkDemandedConstant isn't going to find any different.

llvm-svn: 325368
2018-02-16 18:34:46 +00:00
Sam Clegg b7a5469c7e [WebAssembly] MC: Make explicit our current lack of support for relocations against unnamed temporary symbols.
Add an explicit check before looking up symbol in SymbolIndices.
This was previously silently succeeding and returning zero for such
unnamed temporaries.

Differential Revision: https://reviews.llvm.org/D43365

llvm-svn: 325367
2018-02-16 18:06:05 +00:00
Sanjay Patel 91bb775087 [InstCombine] clean up fdiv-with-fdiv folds; NFCI
llvm-svn: 325366
2018-02-16 17:52:32 +00:00
Sanjay Patel 870fbda805 [InstCombine] add FMF to better show current fdiv fold behavior; NFC
llvm-svn: 325365
2018-02-16 17:46:50 +00:00
Erich Keane 29636aaaa6 Clean up 'target' attribute diagnostics
There were a few issues previously with the target
attribute diagnostics implementation that lead to the
attribute being added to the AST despite having an error
in it.

This patch changes that, and adds a test to ensure it
does not get added to the AST.

Differential Revision: https://reviews.llvm.org/D43359

llvm-svn: 325364
2018-02-16 17:31:59 +00:00
Simon Pilgrim 1b81064d1e Fix signed/unsigned comparison warning. NFCI.
llvm-svn: 325363
2018-02-16 17:26:59 +00:00