platform/upstream/llvm.git
6 years agoAMDGPU: Remove unused private member of AMDGPUTargetELFStreamer
Konstantin Zhuravlyov [Fri, 16 Feb 2018 23:04:11 +0000 (23:04 +0000)]
AMDGPU: Remove unused private member of AMDGPUTargetELFStreamer

llvm-svn: 325408

6 years agoRun these tests, the errors were old and not valid anymore.
Eric Christopher [Fri, 16 Feb 2018 23:02:28 +0000 (23:02 +0000)]
Run these tests, the errors were old and not valid anymore.

llvm-svn: 325407

6 years agoDo not print out "no input files" twice.
Rui Ueyama [Fri, 16 Feb 2018 22:58:19 +0000 (22:58 +0000)]
Do not print out "no input files" twice.

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

llvm-svn: 325406

6 years agoUse wasm-ld instead of "lld -flavor wasm".
Rui Ueyama [Fri, 16 Feb 2018 22:58:02 +0000 (22:58 +0000)]
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

6 years agoAMDGPU/LLD: Remove the use of binary file from one of the AMDGPU tests
Konstantin Zhuravlyov [Fri, 16 Feb 2018 22:55:36 +0000 (22:55 +0000)]
AMDGPU/LLD: Remove the use of binary file from one of the AMDGPU tests

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

llvm-svn: 325404

6 years agoRemove an unused function.
Eric Christopher [Fri, 16 Feb 2018 22:46:47 +0000 (22:46 +0000)]
Remove an unused function.

llvm-svn: 325403

6 years agoSilence an unsigned vs signed compare warning.
Eric Christopher [Fri, 16 Feb 2018 22:46:45 +0000 (22:46 +0000)]
Silence an unsigned vs signed compare warning.

llvm-svn: 325402

6 years ago[GISel]: Make GlobalISelEmitter rule prioritization compatible with selectionDAG
Aditya Nandakumar [Fri, 16 Feb 2018 22:37:15 +0000 (22:37 +0000)]
[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

6 years agoAMDGPU: Update elf flags in amdgpu-elf-flags.s
Konstantin Zhuravlyov [Fri, 16 Feb 2018 22:35:36 +0000 (22:35 +0000)]
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

6 years agoAMDGPU: Bring elf flags in sync with the spec
Konstantin Zhuravlyov [Fri, 16 Feb 2018 22:33:59 +0000 (22:33 +0000)]
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

6 years ago[Constant] add floating-point helpers for normal/finite-nz; NFC
Sanjay Patel [Fri, 16 Feb 2018 22:32:54 +0000 (22:32 +0000)]
[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

6 years agoMake sure we invoke ld64.lld and ld-wasm in the build directory.
Rui Ueyama [Fri, 16 Feb 2018 22:19:38 +0000 (22:19 +0000)]
Make sure we invoke ld64.lld and ld-wasm in the build directory.

llvm-svn: 325397

6 years ago[COFF] Add support for ARM64 secrel relocations for add/load instructions
Martin Storsjo [Fri, 16 Feb 2018 22:02:38 +0000 (22:02 +0000)]
[COFF] Add support for ARM64 secrel relocations for add/load instructions

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

llvm-svn: 325396

6 years ago[clangd] Implement textDocument/hover
Marc-Andre Laperle [Fri, 16 Feb 2018 21:38:15 +0000 (21:38 +0000)]
[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

6 years ago[X86] In lowerVSELECTtoVectorShuffle, don't map undef select condition to undef in...
Craig Topper [Fri, 16 Feb 2018 21:36:29 +0000 (21:36 +0000)]
[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

6 years agoAMDGPU: Bring processors and features in sync with the spec
Konstantin Zhuravlyov [Fri, 16 Feb 2018 21:26:25 +0000 (21:26 +0000)]
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

6 years agoRevert an accidental change to where "-flavor GNU" was used by intention.
Rui Ueyama [Fri, 16 Feb 2018 21:24:01 +0000 (21:24 +0000)]
Revert an accidental change to where "-flavor GNU" was used by intention.

llvm-svn: 325392

6 years ago[OPENMP] Do not emit messages for templates in declare target
Alexey Bataev [Fri, 16 Feb 2018 21:23:23 +0000 (21:23 +0000)]
[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

6 years agoReplace -flavor {gnu,darwin} with ld64.lld or ld.lld.
Rui Ueyama [Fri, 16 Feb 2018 21:16:57 +0000 (21:16 +0000)]
Replace -flavor {gnu,darwin} with ld64.lld or ld.lld.

llvm-svn: 325390

6 years agoTry again to fix the build.
Zachary Turner [Fri, 16 Feb 2018 21:10:34 +0000 (21:10 +0000)]
Try again to fix the build.

This doesn't repro with clang or MSVC so I'm just blindly
guessing.

llvm-svn: 325389

6 years agoTry to fix broken build with some compilers.
Zachary Turner [Fri, 16 Feb 2018 20:58:25 +0000 (20:58 +0000)]
Try to fix broken build with some compilers.

llvm-svn: 325388

6 years agoRemove `else` after `break`.
Rui Ueyama [Fri, 16 Feb 2018 20:53:53 +0000 (20:53 +0000)]
Remove `else` after `break`.

llvm-svn: 325387

6 years agoFix emission of PDB string table.
Zachary Turner [Fri, 16 Feb 2018 20:46:04 +0000 (20:46 +0000)]
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

6 years agoRemove useless comment - seems to be a copy+paste typo. NFCI
Simon Pilgrim [Fri, 16 Feb 2018 20:41:06 +0000 (20:41 +0000)]
Remove useless comment - seems to be a copy+paste typo. NFCI

llvm-svn: 325385

6 years agoUse write32le instead of write32<little>.
Rui Ueyama [Fri, 16 Feb 2018 20:38:15 +0000 (20:38 +0000)]
Use write32le instead of write32<little>.

llvm-svn: 325384

6 years agoRefactor wasm/WriterUtil.{cpp,h}.
Rui Ueyama [Fri, 16 Feb 2018 20:38:00 +0000 (20:38 +0000)]
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

6 years ago[WebAssebmly] Remove unneeded cast. NFC.
Sam Clegg [Fri, 16 Feb 2018 20:26:15 +0000 (20:26 +0000)]
[WebAssebmly] Remove unneeded cast. NFC.

llvm-svn: 325382

6 years ago[clang-include-fixer] Use add_clang_tool instead add_clang_executable
Petr Hosek [Fri, 16 Feb 2018 20:25:45 +0000 (20:25 +0000)]
[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

6 years agoELF: Stop collecting a list of symbols in ArchiveFile.
Peter Collingbourne [Fri, 16 Feb 2018 20:23:54 +0000 (20:23 +0000)]
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

6 years agoDon't depend on "call foo" producing a X86_64_PC32.
Rafael Espindola [Fri, 16 Feb 2018 20:05:58 +0000 (20:05 +0000)]
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

6 years ago[AArch64] Fix BITCAST lowering crash
Evandro Menezes [Fri, 16 Feb 2018 20:00:57 +0000 (20:00 +0000)]
[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

6 years agoStyle fix. NFC.
Rui Ueyama [Fri, 16 Feb 2018 19:53:29 +0000 (19:53 +0000)]
Style fix. NFC.

llvm-svn: 325377

6 years ago[WebAssembly] Fix bug is function signature checking
Sam Clegg [Fri, 16 Feb 2018 19:45:41 +0000 (19:45 +0000)]
[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

6 years ago[MS] Make constexpr static data members implicitly inline
Reid Kleckner [Fri, 16 Feb 2018 19:44:47 +0000 (19:44 +0000)]
[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

6 years ago[Documentation] Fix Sphinx error. Limit text width to 80 characters.
Eugene Zelenko [Fri, 16 Feb 2018 19:31:28 +0000 (19:31 +0000)]
[Documentation] Fix Sphinx error. Limit text width to 80 characters.

llvm-svn: 325374

6 years ago[OPENMP] Fix PR35873: Fix data-sharing attributes for const variables.
Alexey Bataev [Fri, 16 Feb 2018 19:16:54 +0000 (19:16 +0000)]
[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

6 years agoAMDGPU/SI: Extend promoting alloca to vector to arrays of up to 16 elements
Changpeng Fang [Fri, 16 Feb 2018 19:14:17 +0000 (19:14 +0000)]
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

6 years ago[X86] Only reorder srl/and on last DAG combiner run
Craig Topper [Fri, 16 Feb 2018 18:51:09 +0000 (18:51 +0000)]
[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

6 years ago[WebAssembly] Fix typos in comment. NFC.
Sam Clegg [Fri, 16 Feb 2018 18:37:32 +0000 (18:37 +0000)]
[WebAssembly] Fix typos in comment. NFC.

Patch by Nicholas Wilson!

llvm-svn: 325370

6 years ago[OPENMP] Fix parsing of the directives with inner directives.
Alexey Bataev [Fri, 16 Feb 2018 18:36:44 +0000 (18:36 +0000)]
[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

6 years ago[X86] Remove call to ShrinkDemandedCosntant from the SHRUNKBLEND creation code.
Craig Topper [Fri, 16 Feb 2018 18:34:46 +0000 (18:34 +0000)]
[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

6 years ago[WebAssembly] MC: Make explicit our current lack of support for relocations against...
Sam Clegg [Fri, 16 Feb 2018 18:06:05 +0000 (18:06 +0000)]
[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

6 years ago[InstCombine] clean up fdiv-with-fdiv folds; NFCI
Sanjay Patel [Fri, 16 Feb 2018 17:52:32 +0000 (17:52 +0000)]
[InstCombine] clean up fdiv-with-fdiv folds; NFCI

llvm-svn: 325366

6 years ago[InstCombine] add FMF to better show current fdiv fold behavior; NFC
Sanjay Patel [Fri, 16 Feb 2018 17:46:50 +0000 (17:46 +0000)]
[InstCombine] add FMF to better show current fdiv fold behavior; NFC

llvm-svn: 325365

6 years agoClean up 'target' attribute diagnostics
Erich Keane [Fri, 16 Feb 2018 17:31:59 +0000 (17:31 +0000)]
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

6 years agoFix signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Fri, 16 Feb 2018 17:26:59 +0000 (17:26 +0000)]
Fix signed/unsigned comparison warning. NFCI.

llvm-svn: 325363

6 years ago[ThinLTO] Fix data race in test #2
Eugene Leviant [Fri, 16 Feb 2018 17:25:03 +0000 (17:25 +0000)]
[ThinLTO] Fix data race in test #2

Switched to the right option (-thinlto-threads)

llvm-svn: 325362

6 years ago[ThinLTO] Fix data race in test
Eugene Leviant [Fri, 16 Feb 2018 16:56:33 +0000 (16:56 +0000)]
[ThinLTO] Fix data race in test

llvm-svn: 325361

6 years agoSimplify RelocationBaseSection::addReloc.
Rafael Espindola [Fri, 16 Feb 2018 16:53:04 +0000 (16:53 +0000)]
Simplify RelocationBaseSection::addReloc.

Now that we have R_ADDEND, UseSymVA was redundant. We only want to
write the symbol virtual address when using an expression other than
R_ADDEND.

llvm-svn: 325360

6 years agoFix signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Fri, 16 Feb 2018 16:52:50 +0000 (16:52 +0000)]
Fix signed/unsigned comparison warning. NFCI.

llvm-svn: 325359

6 years ago[InstCombine] remove redundant debug info setting; NFC
Sanjay Patel [Fri, 16 Feb 2018 16:42:04 +0000 (16:42 +0000)]
[InstCombine] remove redundant debug info setting; NFC

The IRBuilder sets debuginfo in Insert(), so this was duplicating what already happened.

llvm-svn: 325358

6 years ago[clangd] Include timestamps in log messages.
Sam McCall [Fri, 16 Feb 2018 16:41:42 +0000 (16:41 +0000)]
[clangd] Include timestamps in log messages.

llvm-svn: 325357

6 years ago[JumpThreading] PR36133 enable/disable DominatorTree for LVI analysis
Brian M. Rzycki [Fri, 16 Feb 2018 16:35:17 +0000 (16:35 +0000)]
[JumpThreading] PR36133 enable/disable DominatorTree for LVI analysis

Summary:
The LazyValueInfo pass caches a copy of the DominatorTree when available.
Whenever there are pending DominatorTree updates within JumpThreading's
DeferredDominance object we cannot use the cached DT for LVI analysis.
This commit adds the new methods enableDT() and disableDT() to LVI.
JumpThreading also sets the appropriate usage model before calling LVI
analysis methods.

Fixes https://bugs.llvm.org/show_bug.cgi?id=36133

Reviewers: sebpop, dberlin, kuhar

Reviewed by: sebpop, kuhar

Subscribers: uabelho, llvm-commits, aprantl, hiraditya, a.elovikov

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

llvm-svn: 325356

6 years agoAMDGPU/SI: Turn off GPR Indexing Mode immediately after the interested instruction.
Changpeng Fang [Fri, 16 Feb 2018 16:31:30 +0000 (16:31 +0000)]
AMDGPU/SI: Turn off GPR Indexing Mode immediately after the interested instruction.

Summary:
  In the current implementation of GPR Indexing Mode when the index is of non-uniform, the s_set_gpr_idx_off instruction
is incorrectly inserted after the loop. This will lead the instructions with vgpr operands (v_readfirstlane for example) to read incorrect
vgpr.
 In this patch, we fix the issue by inserting s_set_gpr_idx_on/off immediately around the interested instruction.

Reviewers:
  rampitec

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

llvm-svn: 325355

6 years ago[SelectionDAG] Enable SimplifyDemandedVectorElts support for simplifying shuffle...
Simon Pilgrim [Fri, 16 Feb 2018 16:22:14 +0000 (16:22 +0000)]
[SelectionDAG] Enable SimplifyDemandedVectorElts support for simplifying shuffle masks

Based off the DemandedElts mask the and UNDEF elements returned from the SimplifyDemandedVectorElts calls to the shuffle operands, we can attempt to simplify the shuffle mask.

I had to be very conservative here as accepting post-legalized shuffle masks could cause problems for targets that legalize UNDEF mask elements back to inrange values (PowerPC), similarly combining to identity shuffle masks could cause too much UNDEF information to disappear for later combines.

llvm-svn: 325354

6 years ago[InstCombine] reduce code duplication; NFC
Sanjay Patel [Fri, 16 Feb 2018 16:13:20 +0000 (16:13 +0000)]
[InstCombine] reduce code duplication; NFC

llvm-svn: 325353

6 years agoUse Token::isOneOf method in Parser.
Frederich Munch [Fri, 16 Feb 2018 16:07:33 +0000 (16:07 +0000)]
Use Token::isOneOf method in Parser.

Summary: Easier to read and possibly optimize.

Reviewers: rsmith, sepavloff

Reviewed By: sepavloff

Subscribers: sepavloff, cfe-commits

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

llvm-svn: 325352

6 years ago[ARM] Add tests for the vcvtr builtins
Sjoerd Meijer [Fri, 16 Feb 2018 16:01:08 +0000 (16:01 +0000)]
[ARM] Add tests for the vcvtr builtins

This adds Sema and Codegen tests for the vcvtr builtins
(because they were missing).

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

llvm-svn: 325351

6 years ago[X86][SSE] Allow float domain crossing if we are merging 2 or more shuffles and the...
Simon Pilgrim [Fri, 16 Feb 2018 14:57:25 +0000 (14:57 +0000)]
[X86][SSE] Allow float domain crossing if we are merging 2 or more shuffles and the root started as a float domain shuffle

llvm-svn: 325349

6 years ago[PowerPC] Fix transform in table gen file causing UB
Nemanja Ivanovic [Fri, 16 Feb 2018 14:49:01 +0000 (14:49 +0000)]
[PowerPC] Fix transform in table gen file causing UB

Running a bootstrap build with UBSan produces a number of instances where
we have signed integer overflow due to this transform. Change the type to
long to prevent this UB on 64-bit build machines.

llvm-svn: 325347

6 years ago[clangd] remove redundant ';' introduced in r325343
Eric Liu [Fri, 16 Feb 2018 14:47:08 +0000 (14:47 +0000)]
[clangd] remove redundant ';' introduced in r325343

llvm-svn: 325346

6 years agoAdd initial XRay support for NetBSD
Kamil Rytarowski [Fri, 16 Feb 2018 14:45:20 +0000 (14:45 +0000)]
Add initial XRay support for NetBSD

Summary:
Reuse the existing FreeBSD code as it is.

Sponsored by <The NetBSD Foundation>

Reviewers: dberris, rnk, vitalybuka

Reviewed By: dberris

Subscribers: mclow.lists, emaste, mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 325345

6 years ago[clangd] collect symbol #include & insert #include in global code completion.
Eric Liu [Fri, 16 Feb 2018 14:15:55 +0000 (14:15 +0000)]
[clangd] collect symbol #include & insert #include in global code completion.

Summary:
o Collect suitable #include paths for index symbols. This also does smart mapping
for STL symbols and IWYU pragma (code borrowed from include-fixer).
o For global code completion, add a command for inserting new #include in each code
completion item.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, mgorny, ilya-biryukov, jkorous-apple, hintonda, cfe-commits

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

llvm-svn: 325343

6 years ago[Coroutines] Use target-agnostic size_t in test
Brian Gesiak [Fri, 16 Feb 2018 14:11:27 +0000 (14:11 +0000)]
[Coroutines] Use target-agnostic size_t in test

Summary:
Fix a test failure on ARM hosts that was caused by a difference in the type of
size_t, by using a target-agnostic definiton.

Test Plan:
```
clang -cc1 -internal-isystem build/lib/clang/7.0.0/include -nostdsysteminc \
      -std=c++14 -fcoroutines-ts -verify clang/test/SemaCXX/coroutines.cpp \
      -fcxx-exceptions -fexceptions \
      -triple armeb-none-eabi
```

llvm-svn: 325342

6 years ago[mips] Remove codegen support from some 16 bit instructions
Simon Dardis [Fri, 16 Feb 2018 13:34:23 +0000 (13:34 +0000)]
[mips] Remove codegen support from some 16 bit instructions

These instructions conflict with their full length variants
for the purposes of FastISel as they cannot be distingushed
based on the number and type of operands and predicates.

Reviewers: atanasyan

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

llvm-svn: 325341

6 years agoShorten socket names in TestPlatformProcessConnect
Pavel Labath [Fri, 16 Feb 2018 12:57:35 +0000 (12:57 +0000)]
Shorten socket names in TestPlatformProcessConnect

The test was generating long unix socket names, and the addition of a
new folder in the previous patch pushed it over the limit (although
linux has a fairly generous limit for path names, this does not apply to
unix sockets).

Modify the test to use a shorter name instead.

llvm-svn: 325340

6 years agoRe-enable lang/objc/modules/TestObjCModules
Jonas Devlieghere [Fri, 16 Feb 2018 12:33:10 +0000 (12:33 +0000)]
Re-enable lang/objc/modules/TestObjCModules

The reason this test was disabled is no longer relevant. However, it
didn't turn into an unexpected success because of a syntax error in the
test itself. This commit fixes that and re-enables the test.

llvm-svn: 325339

6 years ago[SelectionDAG] Add initial SimplifyDemandedVectorElts support for simplifying VSELECT...
Simon Pilgrim [Fri, 16 Feb 2018 12:21:08 +0000 (12:21 +0000)]
[SelectionDAG] Add initial SimplifyDemandedVectorElts support for simplifying VSELECT operands

This just adds a basic pass through - we can add constant selection mask handling in a future patch to fully match InstCombine.

llvm-svn: 325338

6 years ago[clangd] Assert path is absolute when assigning to URIForFile.
Ilya Biryukov [Fri, 16 Feb 2018 12:20:47 +0000 (12:20 +0000)]
[clangd] Assert path is absolute when assigning to URIForFile.

Summary:
The assertion will point directly to misbehaving code, so that
debugging related problems (like the one fixed by r325029) is easier.

Reviewers: hokein, ioeric, sammccall

Reviewed By: sammccall

Subscribers: klimek, jkorous-apple, cfe-commits

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

llvm-svn: 325337

6 years ago[clang-format] Enable google text proto formatting in R"proto('s
Krasimir Georgiev [Fri, 16 Feb 2018 12:10:06 +0000 (12:10 +0000)]
[clang-format] Enable google text proto formatting in R"proto('s

llvm-svn: 325336

6 years agoRevert r325321 "[Sema] Take into account the current context when checking the"
Hans Wennborg [Fri, 16 Feb 2018 12:06:32 +0000 (12:06 +0000)]
Revert r325321 "[Sema] Take into account the current context when checking the"

This broke the Chromium build, see https://crbug.com/813017

> accessibility of a class member.
>
> This fixes PR32898.
>
> rdar://problem/33737747
>
> Differential revision: https://reviews.llvm.org/D36918

llvm-svn: 325335

6 years agoFix paralelization of remote tests
Pavel Labath [Fri, 16 Feb 2018 11:39:38 +0000 (11:39 +0000)]
Fix paralelization of remote tests

Since we now can run multiple tests from the same directory at once, we
need to include the test name in the remote test directory instead.

I'm not sure if the test_number in the remote path is necessary anymore
(or even if it was ever necessary), but I choose to leave it in for now.

llvm-svn: 325334

6 years ago[ELF] Extend symbol-order-warnings test case for ICF
James Henderson [Fri, 16 Feb 2018 10:49:57 +0000 (10:49 +0000)]
[ELF] Extend symbol-order-warnings test case for ICF

Reviewed by: rafael

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

There is some discussion as to the exact behaviour of combining ICF and
--symbol-ordering-file, but it seems beneficial to warn when attempting
to order the removed symbol regardless of the preferred approach.

llvm-svn: 325333

6 years ago[ELF] - Fix comment. NFC.
George Rimar [Fri, 16 Feb 2018 10:46:50 +0000 (10:46 +0000)]
[ELF] - Fix comment. NFC.

Addresses forgotten comment for D43071.

llvm-svn: 325332

6 years ago[ELF] - Support COPY, INFO, OVERLAY output sections attributes.
George Rimar [Fri, 16 Feb 2018 10:42:58 +0000 (10:42 +0000)]
[ELF] - Support COPY, INFO, OVERLAY output sections attributes.

This is PR36298.

(COPY), (INFO), (OVERLAY) all have the same effect:
section should be marked as non-allocatable.

(https://www.eecs.umich.edu/courses/eecs373/readings/Linker.pdf,
3.6.8.1 Output Section Type)

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

llvm-svn: 325331

6 years ago[Transforms] Propagate TBAA info in SROA
Ivan A. Kosarev [Fri, 16 Feb 2018 10:10:29 +0000 (10:10 +0000)]
[Transforms] Propagate TBAA info in SROA

Now that we have the new TBAA metadata format that is capable of
representing accesses to aggregates, we can propagate TBAA access
tags from memory setting and transferring intrinsics to load and
store instructions and vice versa.

Since SROA produces lots of new loads and stores on optimized
builds, this change significantly decreases the share of
undecorated memory accesses on such builds.

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

llvm-svn: 325329

6 years agoEnsure that Elf_Rel addends are always written for dynamic relocations
Alexander Richardson [Fri, 16 Feb 2018 10:01:17 +0000 (10:01 +0000)]
Ensure that Elf_Rel addends are always written for dynamic relocations

Summary:
This follows up on r321889 where writing of Elf_Rel addends was partially
moved to RelocationBaseSection. This patch ensures that the addends are
always written to the output section when a input section uses RELA but the
output is REL.

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

llvm-svn: 325328

6 years ago[ARM] Return true in enableMultipleCopyHints().
Jonas Paulsson [Fri, 16 Feb 2018 09:51:01 +0000 (09:51 +0000)]
[ARM]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: Eli Friedman
llvm-svn: 325327

6 years ago[clangd] TestFS cleanup: getVirtualBlahBlah -> testPath/testRoot. Remove SmallString...
Sam McCall [Fri, 16 Feb 2018 09:41:43 +0000 (09:41 +0000)]
[clangd] TestFS cleanup: getVirtualBlahBlah -> testPath/testRoot. Remove SmallString micro-opt for more ergonomic tests. NFC

llvm-svn: 325326

6 years ago[LegalizeDAG] Fix legalization of SETCC
Mikhail Maltsev [Fri, 16 Feb 2018 09:35:16 +0000 (09:35 +0000)]
[LegalizeDAG] Fix legalization of SETCC

Summary:
Currently when expanding a SETCC node into a SELECT_CC, LLVM uses
an incorrect type for determining BooleanContent of the result. This
patch fixes the issue.

Fixes PR36079.

Reviewers: rogfer01, javed.absar, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

llvm-svn: 325325

6 years ago[lldb][PPC64] Fixed vector and struct return value
Pavel Labath [Fri, 16 Feb 2018 09:29:41 +0000 (09:29 +0000)]
[lldb][PPC64] Fixed vector and struct return value

Summary:
The PowerPC64 ABI plugin was modified to:

- properly handle vector type return values
- implement support for struct/class return values

A refactoring in the code that handles return values was also performed, to make it possible to handle structs without repeating (when possible) code that handles its fields.

There was also an issue with CreateInstance(), that only created an instance in the first time it was called and then cached it in a static var. When restarting a process under LLDB's control, the ABI's process weak pointer would become null, and using it would result in a segmentation fault. This issue became more evident after the latest changes to PPC64 plugin, that now uses the process pointer to get the target byte order, making LLDB to seg fault when restarting a program. This was fixed by making CreateInstance() to always create a new ABI instance.

All of LLDB's ReturnValue tests are passing for PPC64le now. It should work for PPC64be too, although this was not tested.

Reviewers: labath, clayborg

Reviewed By: labath

Subscribers: lbianc, anajuliapc, llvm-commits, alexandreyy, nemanjai, kbarton

Differential Revision: https://reviews.llvm.org/D42468
Patch by Leandro Lupori <leandro.lupori@gmail.com>.

llvm-svn: 325324

6 years ago[ARM] Materialise some boolean values to avoid a branch
Roger Ferrer Ibanez [Fri, 16 Feb 2018 09:23:59 +0000 (09:23 +0000)]
[ARM] Materialise some boolean values to avoid a branch

This patch combines some cases of ARMISD::CMOV for integers that arise in comparisons of the form

  a != b ? x : 0
  a == b ? 0 : x

and that currently (e.g. in Thumb1) are emitted as branches.

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

llvm-svn: 325323

6 years ago[dosep] Run tests in a more parallel fashion
Pavel Labath [Fri, 16 Feb 2018 09:21:11 +0000 (09:21 +0000)]
[dosep] Run tests in a more parallel fashion

Summary:
Due to in-tree builds, we were parallelizing the tests at the directory
level. Now that the tests are built out-of-tree, we can remove this
limitation and paralelize at file level instead.

This decreases test suite time by about 10% for me, which is not
world-shattering, but it makes the code slightly simpler and will also
allow us to merge tests which were artificially spread over multiple
folders (TestConcurrentEvents...) to work-around this limitation.

To make this work, I've also needed to include the test file name in the
build directory name, as just the test method name is not unique enough
(plenty of tests have a test method called "test" or similar).

While doing this, I've found a couple of tests that are taking waaay longer then
they ought to (TestBreakpointCaseSensitivity -- 90 seconds), which I plan to
look into in the future.

Reviewers: aprantl

Subscribers: lldb-commits

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

llvm-svn: 325322

6 years ago[Sema] Take into account the current context when checking the
Akira Hatanaka [Fri, 16 Feb 2018 08:47:37 +0000 (08:47 +0000)]
[Sema] Take into account the current context when checking the
accessibility of a class member.

This fixes PR32898.

rdar://problem/33737747

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

llvm-svn: 325321

6 years ago[ThinLTO] Import global variables
Eugene Leviant [Fri, 16 Feb 2018 08:11:04 +0000 (08:11 +0000)]
[ThinLTO] Import global variables

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

llvm-svn: 325320

6 years ago[Coverage] Handle break/continue outside of loop bodies
Vedant Kumar [Fri, 16 Feb 2018 07:59:43 +0000 (07:59 +0000)]
[Coverage] Handle break/continue outside of loop bodies

Teach the coverage mapping logic to handle break or continue statements
within for loop increments.

Fixes llvm.org/PR36406.

llvm-svn: 325319

6 years ago[X86] Allow CMOVs of constants to be sign extended from i32.
Craig Topper [Fri, 16 Feb 2018 07:16:15 +0000 (07:16 +0000)]
[X86] Allow CMOVs of constants to be sign extended from i32.

Sign extending i32 constants only requires a REX prefix as does widening the CMOV. This is cheaper than the explicit sign extend op.

llvm-svn: 325318

6 years ago[X86] Don't zero_extend cmov up to i64, stop at i32.
Craig Topper [Fri, 16 Feb 2018 06:52:43 +0000 (06:52 +0000)]
[X86] Don't zero_extend cmov up to i64, stop at i32.

Zero extend from i32 to i64 is free. So extend from i16 to i32, and then use a free zero extend to finish.

llvm-svn: 325317

6 years agoFix an issue that weak bit is dropped when there's a lazy object symbol.
Rui Ueyama [Fri, 16 Feb 2018 04:27:46 +0000 (04:27 +0000)]
Fix an issue that weak bit is dropped when there's a lazy object symbol.

Previously, we accidentally dropped STB_WEAK bit from an undefined symbol
if there is a lazy object symbol with the same name. That caused a
compatibility issue with GNU gold.

llvm-svn: 325316

6 years agoReintroduce FreeBSD support in test/xray
Kamil Rytarowski [Fri, 16 Feb 2018 04:20:33 +0000 (04:20 +0000)]
Reintroduce FreeBSD support in test/xray

Tested by Douglas Yung.

The original patch from D43278 has been reverted.

New patch by myself.

llvm-svn: 325315

6 years ago[ELF] Fix use after free in case of using --whole-archive.
Igor Kudrin [Fri, 16 Feb 2018 03:26:53 +0000 (03:26 +0000)]
[ELF] Fix use after free in case of using --whole-archive.

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

llvm-svn: 325313

6 years ago[DOXYGEN] There was a request in the review D41507 to change the notation for hex...
Ekaterina Romanova [Fri, 16 Feb 2018 03:11:35 +0000 (03:11 +0000)]
[DOXYGEN] There was a request in the review D41507 to change the notation for hex numbers in doxygen documentation from <...>h to 0x<...>. Both of these notations were used in x86 intrinsics documentation. I promised to change them to 0x<...> for consistency.

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

llvm-svn: 325312

6 years ago[APInt] Fix extractBits to correctly handle Result.isSingleWord() case.
Tim Shen [Fri, 16 Feb 2018 01:44:36 +0000 (01:44 +0000)]
[APInt] Fix extractBits to correctly handle Result.isSingleWord() case.

Summary: extractBits assumes that `!this->isSingleWord() implies !Result.isSingleWord()`, which may not necessarily be true. Handle both cases.

Reviewers: RKSimon

Subscribers: sanjoy, llvm-commits, hiraditya

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

llvm-svn: 325311

6 years agoRemove brittle check lines from a test, NFC
Vedant Kumar [Fri, 16 Feb 2018 01:21:01 +0000 (01:21 +0000)]
Remove brittle check lines from a test, NFC

llvm-svn: 325310

6 years agoRevert part of SVN r. 325240 in lit.cfg
Kamil Rytarowski [Fri, 16 Feb 2018 01:16:06 +0000 (01:16 +0000)]
Revert part of SVN r. 325240 in lit.cfg

The original change broke a llvm-clang-lld-x86_64-debian setup.

This change will be investigated and reintroduced in future.

Original commit:

  "Add Xray instrumentation support to FreeBSD"
  https://reviews.llvm.org/D43278

llvm-svn: 325309

6 years ago[GVN] Partially revert debug info salvage change (r325063)
Vedant Kumar [Fri, 16 Feb 2018 01:15:20 +0000 (01:15 +0000)]
[GVN] Partially revert debug info salvage change (r325063)

In r325063, we salvaged debug values from dying instructions in
GVN::processBlock() and GVN::performScalarPRE().

The change in performScalarPRE(), while correct, is unhelpful. It
introduced a call to salvageDebugInfo() which was immediately followed
by a RAUW, meaning it prevented the RAUW from efficiently updating
dbg.value intrinsics.  This commit reverts the mistake and tightens up
the affected test case.

llvm-svn: 325308

6 years agoRelax relocation type checking in a non-ALLOC section.
Rui Ueyama [Fri, 16 Feb 2018 01:10:51 +0000 (01:10 +0000)]
Relax relocation type checking in a non-ALLOC section.

Even though it doesn't make sense, there seems to be multiple programs
in the wild that create PC-relative relocations in non-ALLOC sections.
I believe this is caused by the negligence of GNU linkers to not report
any errors for such relocations.

Currently, lld emits warnings against such relocations and exits.
So, you cannot link any program that contains wrong relocations until
you fix an issue in a program that generates wrong ELF files. It's often
impractical to fix a program because it's not always easy.

This patch relaxes the error checking and emit a warning instead.

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

llvm-svn: 325307

6 years ago[X86] Add the test cases that were supposed to go with r325287.
Craig Topper [Fri, 16 Feb 2018 00:39:05 +0000 (00:39 +0000)]
[X86] Add the test cases that were supposed to go with r325287.

llvm-svn: 325306

6 years ago[Modules] Extend -fmodule-name semantic for frameworks with private modules
Bruno Cardoso Lopes [Fri, 16 Feb 2018 00:12:57 +0000 (00:12 +0000)]
[Modules] Extend -fmodule-name semantic for frameworks with private modules

Assume Foo.framework with two module maps and two modules Foo and
Foo_Private.

Framework authors need to skip building both Foo and Foo_Private when
using -fmodule-name=Foo, since both are part of the framework and used
interchangeably during compilation.

rdar://problem/37500098

llvm-svn: 325305

6 years ago[OPENMP] Fix PR36399: Crash on C code with ordered doacross construct.
Alexey Bataev [Thu, 15 Feb 2018 23:39:43 +0000 (23:39 +0000)]
[OPENMP] Fix PR36399: Crash on C code with ordered doacross construct.

Codegen for ordered with doacross construct might produce incorrect code
because of missing cleanup scope for the construct. Without this scope
the final runtime function call could be emitted in the wrong order that
leads to incorrect codegen.

llvm-svn: 325304