platform/upstream/llvm.git
6 years agoFixed some rtti-options tests.
Sunil Srivastava [Tue, 15 May 2018 18:28:42 +0000 (18:28 +0000)]
Fixed some rtti-options tests.

Certain tests in rtti-options.cpp are not really testing anything because they are testing for the absence of -frtti option to the cc1 process. Since the cc1 process does not take -frtti option, these tests are passing tautologically.

The RTTI mode is enabled by default in cc1, and -fno-rtti disables it. Therefore the correct way to check for enabling of RTTI is to check for the absence of -fno-rtti to cc1, and the correct way to check for disabling of RTTI is to check for the presence of -fno-rtti to cc1.

This patch fixes those tests.

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

llvm-svn: 332384

6 years ago[Hexagon] Add driver options for subtarget features
Krzysztof Parzyszek [Tue, 15 May 2018 18:15:59 +0000 (18:15 +0000)]
[Hexagon] Add driver options for subtarget features

llvm-svn: 332383

6 years agoadd AR to acronyms of clang-tidy property check
Yan Zhang [Tue, 15 May 2018 18:13:51 +0000 (18:13 +0000)]
add AR to acronyms of clang-tidy property check

Reviewers: hokein, benhamilton

Reviewed By: benhamilton

Subscribers: klimek, cfe-commits

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

llvm-svn: 332382

6 years ago[llvm-mca] use a formatted_raw_ostream to insert padding and get rid of tabs. NFC
Andrea Di Biagio [Tue, 15 May 2018 18:11:45 +0000 (18:11 +0000)]
[llvm-mca] use a formatted_raw_ostream to insert padding and get rid of tabs. NFC

llvm-svn: 332381

6 years ago[OPENMP, NVPTX] Do not globalize variables with reference/pointer types.
Alexey Bataev [Tue, 15 May 2018 18:01:01 +0000 (18:01 +0000)]
[OPENMP, NVPTX] Do not globalize variables with reference/pointer types.

In generic data-sharing mode we do not need to globalize
variables/parameters of reference/pointer types. They already are placed
in the global memory.

llvm-svn: 332380

6 years agoAMDGPU/GlobalISel: Implement select() for G_FCONSTANT
Tom Stellard [Tue, 15 May 2018 17:57:09 +0000 (17:57 +0000)]
AMDGPU/GlobalISel: Implement select() for G_FCONSTANT

Summary: Also clean up G_CONSTANT selection.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 332379

6 years ago[clangd] Extract scoring/ranking logic, and shave yaks.
Sam McCall [Tue, 15 May 2018 17:43:27 +0000 (17:43 +0000)]
[clangd] Extract scoring/ranking logic, and shave yaks.

Summary:
Code completion scoring was embedded in CodeComplete.cpp, which is bad:
 - awkward to test. The mechanisms (extracting info from index/sema) can be
   unit-tested well, the policy (scoring) should be quantitatively measured.
   Neither was easily possible, and debugging was hard.
   The intermediate signal struct makes this easier.
 - hard to reuse. This is a bug in workspaceSymbols: it just presents the
   results in the index order, which is not sorted in practice, it needs to rank
   them!
   Also, index implementations care about scoring (both query-dependent and
   independent) in order to truncate result lists appropriately.

The main yak shaved here is the build() function that had 3 variants across
unit tests is unified in TestTU.h (rather than adding a 4th variant).

Reviewers: ilya-biryukov

Subscribers: klimek, mgorny, ioeric, MaskRay, jkorous, mgrang, cfe-commits

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

llvm-svn: 332378

6 years agoAMDGPU: Add disasm tests for deep learning instructions + fix v_fmac_f32 disasm
Konstantin Zhuravlyov [Tue, 15 May 2018 17:39:13 +0000 (17:39 +0000)]
AMDGPU: Add disasm tests for deep learning instructions + fix v_fmac_f32 disasm

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

llvm-svn: 332377

6 years ago[X86] Split WriteCvtF2F into F32->F64 and F64->F32 scheduler classes
Simon Pilgrim [Tue, 15 May 2018 17:36:49 +0000 (17:36 +0000)]
[X86] Split WriteCvtF2F into F32->F64 and F64->F32 scheduler classes

BtVer2 - Fixes schedules for (V)CVTPS2PD instructions

A lot of the Intel models still have too many InstRW overrides for these new classes - this needs cleaning up but I wanted to get the classes in first

llvm-svn: 332376

6 years ago[InstCombine] fix binop-of-shuffles to check uses
Sanjay Patel [Tue, 15 May 2018 17:14:23 +0000 (17:14 +0000)]
[InstCombine] fix binop-of-shuffles to check uses

llvm-svn: 332375

6 years ago[lld] Mitigate relocation overflow [part 1 of 2].
Han Shen [Tue, 15 May 2018 17:02:35 +0000 (17:02 +0000)]
[lld] Mitigate relocation overflow [part 1 of 2].

This CL places .dynsym and .dynstr at the beginning of SHF_ALLOC
sections. We do this to mitigate the possibility that huge .dynsym and
.dynstr sections placed between ro-data and text sections cause
relocation overflow.

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

llvm-svn: 332374

6 years ago[InstCombine] add multi-use shuffle tests and regenerate checks; NFC
Sanjay Patel [Tue, 15 May 2018 16:47:47 +0000 (16:47 +0000)]
[InstCombine] add multi-use shuffle tests and regenerate checks; NFC

llvm-svn: 332373

6 years agoRemove \brief commands from doxygen comments.
Fangrui Song [Tue, 15 May 2018 16:40:54 +0000 (16:40 +0000)]
Remove \brief commands from doxygen comments.

Summary: This is similar to D46290 D46320.

Reviewers: ruiu, grimar

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 332372

6 years ago[clang-tools-extra] Update uses of DEBUG macro to LLVM_DEBUG.
Nicola Zaghen [Tue, 15 May 2018 16:37:45 +0000 (16:37 +0000)]
[clang-tools-extra] Update uses of DEBUG macro to LLVM_DEBUG.

The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM

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

llvm-svn: 332371

6 years agoupdate two comments as suggested on https://reviews.llvm.org/D46843
Nico Weber [Tue, 15 May 2018 16:37:00 +0000 (16:37 +0000)]
update two comments as suggested on https://reviews.llvm.org/D46843

llvm-svn: 332370

6 years ago[Hexagon] Remove unused function from subtarget
Krzysztof Parzyszek [Tue, 15 May 2018 16:32:24 +0000 (16:32 +0000)]
[Hexagon] Remove unused function from subtarget

llvm-svn: 332369

6 years agoRename three cxx files in unittests to cpp.
Nico Weber [Tue, 15 May 2018 16:30:30 +0000 (16:30 +0000)]
Rename three cxx files in unittests to cpp.

LLVM uses cpp as its C++ file extension, these are the only three cxx file in
the monorepo. These files apparently were called to escape a CMake check -- use
the LLVM_OPTIONAL_SOURCES mechanism that's meant as an escape for this case
instead.

No intended behavior change.
https://reviews.llvm.org/D46843

llvm-svn: 332368

6 years ago[AArch64] Fix mir test case liveins info.
Geoff Berry [Tue, 15 May 2018 16:27:34 +0000 (16:27 +0000)]
[AArch64] Fix mir test case liveins info.

The test case added in r332265 had incomplete livein information which
was caught by the EXPENSIVE_CHECKS bot.  Fix the livein information and
add -verify-machineinstrs to the test case.

llvm-svn: 332367

6 years ago[clangd] Log error message instead write to errs(). NFC
Eric Liu [Tue, 15 May 2018 16:22:43 +0000 (16:22 +0000)]
[clangd] Log error message instead write to errs(). NFC

llvm-svn: 332366

6 years ago[Hexagon] Remove unused flag from subtarget and (non)corresponding test
Krzysztof Parzyszek [Tue, 15 May 2018 16:13:52 +0000 (16:13 +0000)]
[Hexagon] Remove unused flag from subtarget and (non)corresponding test

llvm-svn: 332365

6 years ago[mips] Mark select instructions correctly
Simon Dardis [Tue, 15 May 2018 16:05:04 +0000 (16:05 +0000)]
[mips] Mark select instructions correctly

Reviewers: atanasyan, abeserminji, smaksimovic

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

llvm-svn: 332364

6 years ago[clangd] Populate #include insertions as additional edits in completion items.
Eric Liu [Tue, 15 May 2018 15:29:32 +0000 (15:29 +0000)]
[clangd] Populate #include insertions as additional edits in completion items.

Summary:
o Remove IncludeInsertion LSP command.
o Populate include insertion edits synchromously in completion items.
o Share the code completion compiler instance and precompiled preamble to get existing inclusions in main file.
o Include insertion logic lives only in CodeComplete now.
o Use tooling::HeaderIncludes for inserting new includes.
o Refactored tests.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, ilya-biryukov, MaskRay, jkorous, cfe-commits

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

llvm-svn: 332363

6 years ago[clangd] Remove LSP command-based #include insertion.
Eric Liu [Tue, 15 May 2018 15:23:53 +0000 (15:23 +0000)]
[clangd] Remove LSP command-based #include insertion.

Summary:
clangd will populate #include insertions as addtionalEdits in completion items.

The code completion tests in ClangdServerTest will be added back in D46497.

Reviewers: ilya-biryukov, sammccall

Reviewed By: ilya-biryukov

Subscribers: klimek, MaskRay, jkorous, cfe-commits

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

llvm-svn: 332362

6 years ago[llvm-mca] Strip leading tabs and spaces from instruction strings before printing...
Andrea Di Biagio [Tue, 15 May 2018 15:18:05 +0000 (15:18 +0000)]
[llvm-mca] Strip leading tabs and spaces from instruction strings before printing. NFC

llvm-svn: 332361

6 years ago[OpenMP][libomptarget] Add function for checking SPMD mode
Gheorghe-Teodor Bercea [Tue, 15 May 2018 15:16:43 +0000 (15:16 +0000)]
[OpenMP][libomptarget] Add function for checking SPMD mode

Summary: Add function to the NVPTX libomptarget library that will return true if the current target region is being executed in SPMD mode.

Reviewers: ABataev, grokos, carlo.bertolli, caomhin

Reviewed By: grokos

Subscribers: guansong, openmp-commits

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

llvm-svn: 332360

6 years ago[SI] Create Scop Name lazily
Philip Pfaffe [Tue, 15 May 2018 14:53:25 +0000 (14:53 +0000)]
[SI] Create Scop Name lazily

Summary: Creating the Scop name is expensive, because creating the
Region name it's derived from is expensive. So create the name lazily,
because getName() is actually called rarely.

This is a reiteration of r328666, which introduced a use-after-free and
got reverted in r331363.

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

llvm-svn: 332359

6 years ago[DAG] propagate FMF for all FPMathOperators
Sanjay Patel [Tue, 15 May 2018 14:16:24 +0000 (14:16 +0000)]
[DAG] propagate FMF for all FPMathOperators

This is a simple hack based on what's proposed in D37686, but we can extend it if needed in follow-ups.
It gets us most of the FMF functionality that we want without adding any state bits to the flags. It
also intentionally leaves out non-FMF flags (nsw, etc) to minimize the patch.

It should provide a superset of the functionality from D46563 - the extra tests show propagation and
codegen diffs for fcmp, vecreduce, and FP libcalls.

The PPC log2() test shows the limits of this most basic approach - we only applied 'afn' to the last
node created for the call. AFAIK, there aren't any libcall optimizations based on the flags currently,
so that shouldn't make any difference.

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

llvm-svn: 332358

6 years ago[X86] Split off F16C WriteCvtPH2PS/WriteCvtPS2PH scheduler classes
Simon Pilgrim [Tue, 15 May 2018 14:12:32 +0000 (14:12 +0000)]
[X86] Split off F16C WriteCvtPH2PS/WriteCvtPS2PH scheduler classes

Btver2 - VCVTPH2PSYrm needs to double pump the AGU
Broadwell - missing VCVTPS2PH*mr stores extra latency

Allows us to remove the WriteCvtF2FSt conversion store class

llvm-svn: 332357

6 years ago[llvm-objcopy] Add --keep-symbol (-K) option
Paul Semel [Tue, 15 May 2018 14:09:37 +0000 (14:09 +0000)]
[llvm-objcopy] Add --keep-symbol (-K) option

This option permits to explicitly keep the specified
symbol so that it doesn't get removed.

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

llvm-svn: 332356

6 years ago[arc] Remove unittesting from arcconfig
Philip Pfaffe [Tue, 15 May 2018 13:43:42 +0000 (13:43 +0000)]
[arc] Remove unittesting from arcconfig

Summary:
Unittests aren't working, and I don't think they ever were. Just remove
them, so that we don't have  to write `arc --nounit` all the time.

Reviewers: grosser, Meinersbur, bollu

Subscribers: bollu, pollydev, llvm-commits

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

llvm-svn: 332355

6 years agoFix broken asan Support tests
Eric Liu [Tue, 15 May 2018 13:43:20 +0000 (13:43 +0000)]
Fix broken asan Support tests

The asan failures were caught in google internal asan tests after r332311
o Make StackOption support cl::list
o Rememeber to removeArguments for cl::alias in tests.

llvm-svn: 332354

6 years agoReapply "Remove Process references from the Host module"
Pavel Labath [Tue, 15 May 2018 13:42:26 +0000 (13:42 +0000)]
Reapply "Remove Process references from the Host module"

This re-lands r332250/D46395, after fixing Mac build errors.

llvm-svn: 332353

6 years ago[polly] Update uses of DEBUG macro to LLVM_DEBUG.
Nicola Zaghen [Tue, 15 May 2018 13:37:17 +0000 (13:37 +0000)]
[polly] Update uses of DEBUG macro to LLVM_DEBUG.

The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM

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

llvm-svn: 332352

6 years ago[lld] Update uses of DEBUG macro to LLVM_DEBUG.
Nicola Zaghen [Tue, 15 May 2018 13:36:20 +0000 (13:36 +0000)]
[lld] Update uses of DEBUG macro to LLVM_DEBUG.

The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM

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

llvm-svn: 332351

6 years ago[clang] Update uses of DEBUG macro to LLVM_DEBUG.
Nicola Zaghen [Tue, 15 May 2018 13:30:56 +0000 (13:30 +0000)]
[clang] Update uses of DEBUG macro to LLVM_DEBUG.

The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM

Explicitly avoided changing the strings in the clang-format tests.

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

llvm-svn: 332350

6 years agoReapply "DWARFVerifier: Check "completeness" of .debug_names section"
Pavel Labath [Tue, 15 May 2018 13:24:10 +0000 (13:24 +0000)]
Reapply "DWARFVerifier: Check "completeness" of .debug_names section"

This is a resubmit of r331868 (D46583), which was reverted due to
failures on the PS4 bot.

These have been resolved with r332246/D46748.

llvm-svn: 332349

6 years ago[llvm-exegesis] Split AsmTemplate.Name into components.
Clement Courbet [Tue, 15 May 2018 13:07:05 +0000 (13:07 +0000)]
[llvm-exegesis] Split AsmTemplate.Name into components.

Summary:
AsmTemplate becomes IntructionBenchmarkKey, which has three components.
This allows retreiving the opcode for analysis.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 332348

6 years ago[llvm-mca][x86] Add F16C instruction tests
Simon Pilgrim [Tue, 15 May 2018 12:50:06 +0000 (12:50 +0000)]
[llvm-mca][x86] Add F16C instruction tests

llvm-svn: 332347

6 years agoFix compilation under pre-c++14 gccs.
Clement Courbet [Tue, 15 May 2018 12:38:06 +0000 (12:38 +0000)]
Fix compilation under pre-c++14 gccs.

llvm-svn: 332346

6 years agoFix r332344: only the native target is linked.
Clement Courbet [Tue, 15 May 2018 12:27:36 +0000 (12:27 +0000)]
Fix r332344: only the native target is linked.

llvm-svn: 332345

6 years ago[llvm-exegesis] Add an analysis mode.
Clement Courbet [Tue, 15 May 2018 12:08:00 +0000 (12:08 +0000)]
[llvm-exegesis] Add an analysis mode.

Summary:
The analysis mode gives the user a clustered view of the measurement results.
Next steps are (requires the split ok AsmTemplate.Name into {mnemonic, mode}):
 - Show the sched class.
 - Highlight any inconsistencies with the checked-in data.

Reviewers: gchatelet

Subscribers: mgorny, llvm-commits, tschuett

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

llvm-svn: 332344

6 years ago[Solaris] Only define _REENTRANT if -pthread
Rainer Orth [Tue, 15 May 2018 11:36:00 +0000 (11:36 +0000)]
[Solaris] Only define _REENTRANT if -pthread

When looking at lib/Basic/Targets/OSTargets.h, I noticed that _REENTRANT is defined
unconditionally on Solaris, unlike all other targets and what either Studio cc (only define
it with -mt) or gcc (only define it with -pthread) do.

This patch follows that lead.

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

llvm-svn: 332343

6 years ago[MergeFunctions] Fix merging of small weak functions
whitequark [Tue, 15 May 2018 11:31:07 +0000 (11:31 +0000)]
[MergeFunctions] Fix merging of small weak functions

When two interposable functions are merged, we cannot replace
uses and have to emit calls to a common internal function. However,
writeThunk() will not actually emit a thunk if the function is too
small. This leaves us in a broken state where mergeTwoFunctions
already rewired the functions, but writeThunk doesn't do anything.

This patch changes the implementation so that:

 * writeThunk() does just that.
 * The direct replacement of calls is moved into mergeTwoFunctions()
   into the non-interposable case only.
 * isThunkProfitable() is extracted and will be called for
   the non-iterposable case always, and in the interposable case
   only if uses are still left after replacement.

This issue has been introduced in https://reviews.llvm.org/D34806,
where the code for checking thunk profitability has been moved.

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

Reviewed By: whitequark

llvm-svn: 332342

6 years ago[mips] Fix formatting of floating point conversion patterns
Simon Dardis [Tue, 15 May 2018 11:21:07 +0000 (11:21 +0000)]
[mips] Fix formatting of floating point conversion patterns

llvm-svn: 332341

6 years ago[mips] Add disassembly support for comparison instructions
Simon Dardis [Tue, 15 May 2018 11:18:24 +0000 (11:18 +0000)]
[mips] Add disassembly support for comparison instructions

llvm-svn: 332340

6 years ago[mips] Fix predicates of mfc1, mtc1 instructions
Simon Dardis [Tue, 15 May 2018 11:10:30 +0000 (11:10 +0000)]
[mips] Fix predicates of mfc1, mtc1 instructions

Reviewers: atanasyan, abeserminji, smaksimovic

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

llvm-svn: 332339

6 years ago[ASTImporter] Extend lookup logic in class templates
Aleksei Sidorin [Tue, 15 May 2018 11:09:07 +0000 (11:09 +0000)]
[ASTImporter] Extend lookup logic in class templates

During import of a class template, lookup may find a forward
declaration and structural match falsely reports equivalency
between a forward decl and a definition. The result is that
some definitions are not imported if we had imported a forward
decl previously. This patch gives a fix.

Patch by Gabor Marton!

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

llvm-svn: 332338

6 years ago[llvm-mca] Remove unused include header files. NFC
Andrea Di Biagio [Tue, 15 May 2018 10:30:39 +0000 (10:30 +0000)]
[llvm-mca] Remove unused include header files. NFC

Also, run clang-format on RetireControlUnit.cpp.

llvm-svn: 332337

6 years ago[X86] Improve unsigned saturation downconvert detection.
Artur Gainullin [Tue, 15 May 2018 10:24:12 +0000 (10:24 +0000)]
[X86] Improve unsigned saturation downconvert detection.

Summary:
New unsigned saturation downconvert patterns detection was implemented in
X86 Codegen:

(truncate (smin (smax (x, C1), C2)) to dest_type),
where C1 >= 0 and C2 is unsigned max of destination type.

(truncate (smax (smin (x, C2), C1)) to dest_type)
where C1 >= 0, C2 is unsigned max of destination type and C1 <= C2.
These two patterns are equivalent to:

(truncate (umin (smax(x, C1), unsigned_max_of_dest_type)) to dest_type)

Reviewers: RKSimon

Subscribers: llvm-commits, a.elovikov

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

llvm-svn: 332336

6 years agoMake ast-print-record-decl.c pass on Windows after r332314
Hans Wennborg [Tue, 15 May 2018 10:19:24 +0000 (10:19 +0000)]
Make ast-print-record-decl.c pass on Windows after r332314

It was failing because on Windows, -ast-print prints
__single_inheritance(1) before T1.

Adding a triple is a stop-gap fix until it can be fixed properly.

llvm-svn: 332335

6 years ago[llvm-mca] Add file header to RetireControlUnit.cpp.
Andrea Di Biagio [Tue, 15 May 2018 09:31:32 +0000 (09:31 +0000)]
[llvm-mca] Add file header to RetireControlUnit.cpp.

Strictly speaking, this is not necessary for .cpp files. However, other .cpp
files from this same tool have it. This also matches what we do in other tools.

llvm-svn: 332334

6 years ago[ELF] Implement --keep-unique option
Peter Smith [Tue, 15 May 2018 08:57:21 +0000 (08:57 +0000)]
[ELF] Implement --keep-unique option

The --keep-unique <symbol> option is taken from gold. The intention is that
<symbol> will be prevented from being folded by ICF. Although not
specifically mentioned in the documentation <symbol> only matches
global symbols, with a warning if the symbol is not found.

The implementation finds the Section defining <symbol> and removes it from
the set of sections considered for ICF.

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

llvm-svn: 332332

6 years ago[llvm-exegesis] InMemoryAssembler: handle return-less targets (e.g. arm).
Clement Courbet [Tue, 15 May 2018 07:40:21 +0000 (07:40 +0000)]
[llvm-exegesis] InMemoryAssembler: handle return-less targets (e.g. arm).

Summary: Arm does not have a ret code per se.

Reviewers: gchatelet

Subscribers: mgorny, javed.absar, kristof.beyls, tschuett, llvm-commits

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

llvm-svn: 332331

6 years ago[llvm-exegesis] Check perf event validity.
Clement Courbet [Tue, 15 May 2018 07:35:21 +0000 (07:35 +0000)]
[llvm-exegesis] Check perf event validity.

This was part of https://reviews.llvm.org/D46821.

Authored by Guillaume Chatelet

llvm-svn: 332330

6 years ago[llvm-rc] Add support for parsing memory flags
Martin Storsjo [Tue, 15 May 2018 06:35:29 +0000 (06:35 +0000)]
[llvm-rc] Add support for parsing memory flags

Most of the handling is pretty straightforward; fetch the default
memory flags for the specific resource type before parsing the flags
and apply them on top of that, except that some flags imply others
and some flags clear more than one flag.

For icons and cursors, the flags set get passed on to all individual
single icon/cursor resources, while only some flags affect the icon/cursor
group resource.

For stringtables, the behaviour is pretty simple; the first stringtable
resource of a bundle sets the flags for the whole bundle.

The output of these tests match rc.exe byte for byte.

The actual use of these memory flags is deprecated and they have no
effect since Win16, but some resource script files may still happen
to have them in place.

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

llvm-svn: 332329

6 years ago[llvm-rc] Read the Planes/BitCount fields from BITMAPINFOHEADER for icons
Martin Storsjo [Tue, 15 May 2018 06:35:20 +0000 (06:35 +0000)]
[llvm-rc] Read the Planes/BitCount fields from BITMAPINFOHEADER for icons

Previously these fields were only read from this header for cursors,
while Planes was hardcoded to 1 for icons (with a comment that it was
unknown why this was needed) and BitCount was left at the value
read originally in the RESDIRENTRY.

This fixes the single byte that was differing for the icon/cursor test
compared to rc.exe.

This is based on research/testing by Nico Weber.

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

llvm-svn: 332328

6 years ago[MinGW] Add a LLD specific option -pdb
Martin Storsjo [Tue, 15 May 2018 06:34:18 +0000 (06:34 +0000)]
[MinGW] Add a LLD specific option -pdb

This allows producing pdb debug info. This is an LLD specific option
since GCC and GNU binutils doesn't support the PDB file format.

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

llvm-svn: 332327

6 years ago[X86] Add fast isel tests for some of the avx512 truncate intrinsics to match current...
Craig Topper [Tue, 15 May 2018 04:26:27 +0000 (04:26 +0000)]
[X86] Add fast isel tests for some of the avx512 truncate intrinsics to match current clang codegen.

llvm-svn: 332326

6 years ago[NFC] pull a function into its own lambda
JF Bastien [Tue, 15 May 2018 04:23:48 +0000 (04:23 +0000)]
[NFC] pull a function into its own lambda

As requested in D46858, pulling this function into its own lambda makes it
easier to read that part of the code and reason as to what's going on because
the scope it can be called from is extremely limited. We want to keep it as a
function because it's called from the two subsequent lines.

llvm-svn: 332325

6 years agorootn: Use denormal path only
Jan Vesely [Tue, 15 May 2018 04:22:43 +0000 (04:22 +0000)]
rootn: Use denormal path only

It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Use 0.0f explicitly intead of relying on GPU to flush it.
Fixes CTS on carrizo and turks

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 332324

6 years ago[NFC] Update comments
JF Bastien [Tue, 15 May 2018 04:06:28 +0000 (04:06 +0000)]
[NFC] Update comments

Don't prepend function or data name before each comment. Split into its own NFC patch as requested in D46858.

llvm-svn: 332323

6 years ago[X86] Revert part of r332266: Use __builtin_convertvector to replace some of the...
Craig Topper [Tue, 15 May 2018 03:17:52 +0000 (03:17 +0000)]
[X86] Revert part of r332266: Use __builtin_convertvector to replace some of the avx512 truncate builtins.

The masking doesn't work right in the backend for the ones that produce byte or word elements without avx512bw.

llvm-svn: 332322

6 years ago[X86] Revert part of r332267: Remove GCCBuiltin from the intrinsics that clang stoppe...
Craig Topper [Tue, 15 May 2018 03:17:05 +0000 (03:17 +0000)]
[X86] Revert part of r332267: Remove GCCBuiltin from the intrinsics that clang stopped using in r332266.

The masking of instructions that produce byte or word elements doesn't work right without avx512bw since the generic i8/i16 select won't be legal in the SelectionDAG.

llvm-svn: 332321

6 years ago[sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
Vitaly Buka [Tue, 15 May 2018 01:39:25 +0000 (01:39 +0000)]
[sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock

Reviewers: eugenis, dvyukov

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 332320

6 years ago[asan] Workaround to avoid hangs in Chromium tests
Vitaly Buka [Tue, 15 May 2018 01:39:13 +0000 (01:39 +0000)]
[asan] Workaround to avoid hangs in Chromium tests

Summary:
For some reasons on Chromium when we start leak checking we get own pid as 1.
After that we see threads with PPID:0 assuming that thread is dead in infinite
loop.

To resolve particularly this case and possible issues like this, when IsAlive check failed to detect thread status, we need to limit the number of SuspendAllThreads
iterations.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 332319

6 years ago[RISCV] Define FeatureRelax and shouldForceRelocation for RISCV linker relaxation
Shiva Chen [Tue, 15 May 2018 01:28:50 +0000 (01:28 +0000)]
[RISCV] Define FeatureRelax and shouldForceRelocation for RISCV linker relaxation

1. Deine FeatureRelax to enable/disable linker relaxation.

2. Define shouldForceRelocation to preserve relocation types even if the fixup
   can be resolved when linker relaxation enabled. This is necessary for
   correctness as offsets may change during relaxation.

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

llvm-svn: 332318

6 years ago[NFC] Add const to method signature
Max Kazantsev [Tue, 15 May 2018 01:21:56 +0000 (01:21 +0000)]
[NFC] Add const to method signature

llvm-svn: 332317

6 years ago[libFuzzer] deprecate equivalence_server
Kostya Serebryany [Tue, 15 May 2018 01:15:47 +0000 (01:15 +0000)]
[libFuzzer] deprecate equivalence_server

llvm-svn: 332316

6 years agoFix debug build by adding missing dependencies on libBinaryFormat
Sam Clegg [Tue, 15 May 2018 00:46:43 +0000 (00:46 +0000)]
Fix debug build by adding missing dependencies on libBinaryFormat

Debug BUILD_SHARED_LIBS build was broken by rL332305

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

llvm-svn: 332315

6 years ago[AST] Fix printing tag decl groups in decl contexts
Joel E. Denny [Tue, 15 May 2018 00:44:14 +0000 (00:44 +0000)]
[AST] Fix printing tag decl groups in decl contexts

For example, given:

  struct T1 {
    struct T2 *p0;
  };

-ast-print produced:

  struct T1 {
    struct T2;
    struct T2 *p0;
  };

Compiling that produces a warning that the first struct T2 declaration
does not declare anything.

Details:

A tag decl group is one or more decls that share a type specifier that
is a tag decl (that is, a struct/union/class/enum decl).  Within
functions, the parser builds such a tag decl group as part of a
DeclStmt.  However, in decl contexts, such as file scope or a member
list, the parser does not group together the members of a tag decl
group.  Previously, detection of tag decl groups during printing was
implemented but only if the tag decl was unnamed.  Otherwise, as in
the above example, the members of the group did not print together and
so sometimes introduced warnings.

This patch extends detection of tag decl groups in decl contexts to
any tag decl that is recorded in the AST as not free-standing.

Reviewed by: rsmith

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

llvm-svn: 332314

6 years ago[XRay][profiler] Part 2: XRay Function Call Trie
Dean Michael Berris [Tue, 15 May 2018 00:42:36 +0000 (00:42 +0000)]
[XRay][profiler] Part 2: XRay Function Call Trie

Summary:
This is part of the larger XRay Profiling Mode effort.

This patch implements a central data structure for capturing statistics
about XRay instrumented function call stacks. The `FunctionCallTrie`
type does the following things:

*  It keeps track of a shadow function call stack of XRay instrumented
   functions as they are entered (function enter event) and as they are
   exited (function exit event).

*  When a function is entered, the shadow stack contains information
   about the entry TSC, and updates the trie (or prefix tree)
   representing the current function call stack. If we haven't
   encountered this function call before, this creates a unique node for
   the function in this position on the stack. We update the list of
   callees of the parent function as well to reflect this newly found
   path.

*  When a function is exited, we compute statistics (TSC deltas,
   function call count frequency) for the associated function(s) up the
   stack as we unwind to find the matching entry event.

This builds upon the XRay `Allocator` and `Array` types in Part 1 of
this series of patches.

Depends on D45756.

Reviewers: echristo, pelikan, kpw

Reviewed By: kpw

Subscribers: llvm-commits, mgorny

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

llvm-svn: 332313

6 years ago[Debugify] Add -debugify-each for testing each pass in a pipeline
Vedant Kumar [Tue, 15 May 2018 00:29:27 +0000 (00:29 +0000)]
[Debugify] Add -debugify-each for testing each pass in a pipeline

This adds a -debugify-each mode to opt which, when enabled, wraps each
{Module,Function}Pass in a pipeline with logic to add, check, and strip
synthetic debug info for testing purposes.

This mode can be used to test complex pipelines for debug info bugs, or
to collect statistics about the number of debug values & locations lost
throughout various stages of a pipeline.

Patch by Son Tuan Vu!

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

llvm-svn: 332312

6 years ago[CommandLine] Error message for incorrect PositionalEatArgs usage
Keno Fischer [Mon, 14 May 2018 23:26:06 +0000 (23:26 +0000)]
[CommandLine] Error message for incorrect PositionalEatArgs usage

Summary:
bugpoint has several options specified as `PositionalEatArgs` to pass
options through to the underlying tool, e.g. `-tool-args`. The `-help`
message suggests the usage is: `-tool-args=<string>`. However, this is
misleading, because that's not how these arguments work. Rather than taking
a value, the option consumes all positional arguments until the next
recognized option (or all arguments if `--` is specified at some point).
To make this slightly clearer, instead print the help as:
```
  -tool-args <string>...                            - <tool arguments>...
```
Additionally, add an error if the user attempts to use a `PositionalEatArgs`
argument with a value, instead of silently ignoring it. Example:
```
./bin/bugpoint -tool-args=-mpcu=skylake-avx512
bugpoint: for the -tool-args option: This argument does not take a value.
    Instead, it consumes any positional arguments until the next recognized option.
```

Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D46787

llvm-svn: 332311

6 years agoEnable control flow pruning of float overflow warnings.
Richard Trieu [Mon, 14 May 2018 23:21:48 +0000 (23:21 +0000)]
Enable control flow pruning of float overflow warnings.

Like other conversion warnings, allow float overflow warnings to be disabled
in known dead paths of template instantiation.  This often occurs when a
template template type is a numeric type and the template will check the
range of the numeric type before performing the conversion.

llvm-svn: 332310

6 years ago[SCEVAffinator] Fix handling of pwaff complexity limit.
Eli Friedman [Mon, 14 May 2018 23:05:43 +0000 (23:05 +0000)]
[SCEVAffinator] Fix handling of pwaff complexity limit.

nullptr is not a valid affine expression, and none of the callers check
for null, so we eventually hit an isl error and crash.

Instead, invalidate the scop and return a constant zero.

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

llvm-svn: 332309

6 years ago[WebAssembly] Allow signautre of entry function to be flexible
Sam Clegg [Mon, 14 May 2018 23:01:16 +0000 (23:01 +0000)]
[WebAssembly] Allow signautre of entry function to be flexible

Since we a no longer using this function for the wasm start
section we don't actually care what its signature is.

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

llvm-svn: 332308

6 years ago[c++17] Fix assertion on synthesizing deduction guides after a fatal error.
Volodymyr Sapsai [Mon, 14 May 2018 22:49:44 +0000 (22:49 +0000)]
[c++17] Fix assertion on synthesizing deduction guides after a fatal error.

After a fatal error Sema::InstantiatingTemplate doesn't allow further
instantiation and doesn't push a CodeSynthesisContext. When we tried to
synthesize implicit deduction guides from constructors we hit the
assertion

> Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack"), function SubstType, file clang/lib/Sema/SemaTemplateInstantiate.cpp, line 1580.

Fix by avoiding deduction guide synthesis if InstantiatingTemplate is invalid.

rdar://problem/39051732

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 332307

6 years ago[WebAssembly] Update to match llvm changes
Sam Clegg [Mon, 14 May 2018 22:42:33 +0000 (22:42 +0000)]
[WebAssembly] Update to match llvm changes

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 332306

6 years ago[WebAssembly] Move toString helpers to BinaryFormat
Sam Clegg [Mon, 14 May 2018 22:42:07 +0000 (22:42 +0000)]
[WebAssembly] Move toString helpers to BinaryFormat

Subscribers: dschuff, mgorny, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 332305

6 years agoRevert "[Option] Fix PR37006 prefix choice in findNearest"
Brian Gesiak [Mon, 14 May 2018 22:36:47 +0000 (22:36 +0000)]
Revert "[Option] Fix PR37006 prefix choice in findNearest"

Summary:
This revision causes build failures in PS4 and ppc64le buildbots (for example,
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/29988).
I'll revert for now and try to diagnose the issue.

Test Plan: check-llvm check-clang

llvm-svn: 332304

6 years ago[analyzer] Re-apply r331096 "CStringChecker: Add support for BSD strlcpy()...".
Artem Dergachev [Mon, 14 May 2018 22:32:24 +0000 (22:32 +0000)]
[analyzer] Re-apply r331096 "CStringChecker: Add support for BSD strlcpy()...".

Fixed after revert in r331401.

Patch by David Carlier!

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

llvm-svn: 332303

6 years ago[InstCombine] fix crash due to ignored addrspacecast
Keno Fischer [Mon, 14 May 2018 22:05:01 +0000 (22:05 +0000)]
[InstCombine] fix crash due to ignored addrspacecast

Summary:
Part of the InstCombine code for simplifying GEPs looks through
addrspacecasts. However, this was done by updating a variable
also used by the next transformation, for marking GEPs as
inbounds. This led to replacing a GEP with a similar instruction
in a different addrspace, which caused an assertion failure in RAUW.

This caused julia issue https://github.com/JuliaLang/julia/issues/27055

Patch by Jeff Bezanson <jeff@juliacomputing.com>

Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D46722

llvm-svn: 332302

6 years ago[AArch64] enhance test to show FMF loss; NFC
Sanjay Patel [Mon, 14 May 2018 21:53:21 +0000 (21:53 +0000)]
[AArch64] enhance test to show FMF loss; NFC

llvm-svn: 332301

6 years ago[analyzer] Extend the ObjCAutoreleaseWriteChecker to warn on captures as well
George Karpenkov [Mon, 14 May 2018 21:39:54 +0000 (21:39 +0000)]
[analyzer] Extend the ObjCAutoreleaseWriteChecker to warn on captures as well

A common pattern is that the code in the block does not write into the
variable explicitly, but instead passes it to a helper function which
performs the write.

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

llvm-svn: 332300

6 years ago[Option] Fix PR37006 prefix choice in findNearest
Brian Gesiak [Mon, 14 May 2018 21:35:00 +0000 (21:35 +0000)]
[Option] Fix PR37006 prefix choice in findNearest

Summary:
In https://bugs.llvm.org/show_bug.cgi?id=37006 Nico Weber points out a
flaw in `OptTable::findNearest`: if an option "foo"'s prefixes are "--"
and "-", then the nearest option for "--fob" will be "-foo". This is
incorrect, however, since the function is expected to return "--foo".

The bug is due to a naive loop that attempts to predetermines which
prefix is best. Instead, compute the edit distance for each prefix/name
pair.

Test Plan: `check-llvm`

Reviewers: thakis

Reviewed By: thakis

Subscribers: llvm-commits

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

llvm-svn: 332299

6 years ago[ARM] Back up R4 and LR if calling the stack probe function
Martin Storsjo [Mon, 14 May 2018 21:32:52 +0000 (21:32 +0000)]
[ARM] Back up R4 and LR if calling the stack probe function

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

llvm-svn: 332298

6 years ago[llvm-rc] Add missing inputs for tag-icon-cursor.test.
Martin Storsjo [Mon, 14 May 2018 21:32:47 +0000 (21:32 +0000)]
[llvm-rc] Add missing inputs for tag-icon-cursor.test.

This adds the missing input files used for this test, except for
the separate input files for specific error cases; matching
test input files were provided by Nico Weber.

The extra copying of files into the %t directory doesn't seem to
be necessary since that directory only ever is used for output here,
not for inputs.

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

llvm-svn: 332297

6 years ago[CodeView] Improve debugging of virtual base class member variables
Brock Wyma [Mon, 14 May 2018 21:21:22 +0000 (21:21 +0000)]
[CodeView] Improve debugging of virtual base class member variables

Initial support for passing the virtual base pointer offset to CodeViewDebug.

https://reviews.llvm.org/D46271

llvm-svn: 332296

6 years ago[PowerPC] add more tests for FMF propagation; NFC
Sanjay Patel [Mon, 14 May 2018 21:17:49 +0000 (21:17 +0000)]
[PowerPC] add more tests for FMF propagation; NFC

llvm-svn: 332295

6 years agoFix test fail on some buildbots, caused by r332281.
Joel E. Denny [Mon, 14 May 2018 21:06:04 +0000 (21:06 +0000)]
Fix test fail on some buildbots, caused by r332281.

llvm-svn: 332294

6 years ago[lit] Fix several tests that fail when using Python 3 or on Windows
Stella Stamenova [Mon, 14 May 2018 21:04:24 +0000 (21:04 +0000)]
[lit] Fix several tests that fail when using Python 3 or on Windows

Summary:
1) In logtest.cpp, the name of the file that is reported is not always capitalized, so split the comparison to validate the file (case insensitive) and function (case sensitive) separately
2) Update the gdb remote client tests to work with Python 3. In Python 3, socket sends/receives data as bytes rather than byte strings. This also updates the usage of .hex() - this is no longer available in Python 3, so use hexlify instead

Reviewers: asmith, labath, zturner

Reviewed By: labath

Subscribers: llvm-commits

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

llvm-svn: 332293

6 years ago[Hexagon] Add a target feature to control using small data section
Krzysztof Parzyszek [Mon, 14 May 2018 21:01:56 +0000 (21:01 +0000)]
[Hexagon] Add a target feature to control using small data section

llvm-svn: 332292

6 years agoFix regression in r332076.
Richard Smith [Mon, 14 May 2018 20:52:48 +0000 (20:52 +0000)]
Fix regression in r332076.

If the name after 'template' is an unresolved using declaration (not containing
'typename'), then we don't yet know if it's a valid template-name, so don't
reject it prior to instantiation. Instead, treat it as naming a dependent
member of the current instantiation.

llvm-svn: 332291

6 years ago[Hexagon] Add a target feature for generating new-value stores
Krzysztof Parzyszek [Mon, 14 May 2018 20:41:04 +0000 (20:41 +0000)]
[Hexagon] Add a target feature for generating new-value stores

llvm-svn: 332290

6 years ago[DWARF] Factor out a DWARFUnitHeader class. NFC
Paul Robinson [Mon, 14 May 2018 20:32:31 +0000 (20:32 +0000)]
[DWARF] Factor out a DWARFUnitHeader class. NFC

Extract information related to a "unit header" from DWARFUnit into a
new DWARFUnitHeader class, and add a DWARFUnit member for the header.
This is one step in the direction of allowing type units in the
.debug_info section for DWARF v5.

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

llvm-svn: 332289

6 years agoRemove the fixit for the diagnostics regarding capturing autoreleasing variables...
George Karpenkov [Mon, 14 May 2018 20:29:16 +0000 (20:29 +0000)]
Remove the fixit for the diagnostics regarding capturing autoreleasing variables in a block

The fixit is actively harmful, as it encourages developers to ignore the
warning and to write unsafe code.
It is almost impossible to write safe code while capturing autoreleasing
variables in the block, as in order to check that the block is never
called in the autoreleasing pool the developer has to check the
transitive closure of all potential callers of the block.

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

llvm-svn: 332288

6 years ago[Tooling] Pull #include manipulation code from clangFormat into libToolingCore.
Eric Liu [Mon, 14 May 2018 20:17:53 +0000 (20:17 +0000)]
[Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

Summary: Also pull #include related style out of FormatStyle as tooling::IncludeStyle.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: klimek, mgorny, cfe-commits, djasper

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

llvm-svn: 332287

6 years agoPR37450: Fix bug that disabled some type checks for variables with deduced types.
Richard Smith [Mon, 14 May 2018 20:15:04 +0000 (20:15 +0000)]
PR37450: Fix bug that disabled some type checks for variables with deduced types.

Also improve diagnostic for the case where a type is non-literal because it's a lambda.

llvm-svn: 332286

6 years ago[Hexagon] Add a target feature for memop generation
Krzysztof Parzyszek [Mon, 14 May 2018 20:09:07 +0000 (20:09 +0000)]
[Hexagon] Add a target feature for memop generation

llvm-svn: 332285

6 years ago[clang-format] Move #include related style to libToolingCore
Eric Liu [Mon, 14 May 2018 19:51:33 +0000 (19:51 +0000)]
[clang-format] Move #include related style to libToolingCore

Summary: This will be shared by include insertion/deletion library.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: mgorny, klimek, cfe-commits

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

llvm-svn: 332284