platform/upstream/llvm.git
6 years ago[llvm-mca][x86] Add SET/TEST instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 15:29:47 +0000 (15:29 +0000)]
[llvm-mca][x86] Add SET/TEST instruction resource tests

llvm-svn: 338576

6 years agoBump version number to 8.0.0svn
Hans Wennborg [Wed, 1 Aug 2018 15:22:27 +0000 (15:22 +0000)]
Bump version number to 8.0.0svn

llvm-svn: 338570

6 years agoAMDGPU: Allow fp32-denormals feature for r600 targets
Jan Vesely [Wed, 1 Aug 2018 15:04:36 +0000 (15:04 +0000)]
AMDGPU: Allow fp32-denormals feature for r600 targets

This was accidentally removed in r335942.

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

llvm-svn: 338569

6 years ago[ARM] Armv8.2-A FP16 vector intrinsics tests
Sjoerd Meijer [Wed, 1 Aug 2018 14:43:59 +0000 (14:43 +0000)]
[ARM] Armv8.2-A FP16 vector intrinsics tests

Clang support for the Armv8.2-A FP16 vector intrinsic was committed in
rC328277, but this was never followed up, i.e. the LLVM part is missing.

I've raised PR38404, and this is the first step to address this. I.e.,
this adds tests for the Armv8.2-A FP16 vector intrinsic, and thus shows
which intrinsics already work, and which need further work.

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

llvm-svn: 338568

6 years ago[llvm-exegesis] Provide a way to handle memory instructions.
Guillaume Chatelet [Wed, 1 Aug 2018 14:41:45 +0000 (14:41 +0000)]
[llvm-exegesis] Provide a way to handle memory instructions.

Summary:
And implement memory instructions on X86.

This fixes PR36906.

Reviewers: gchatelet

Reviewed By: gchatelet

Subscribers: lebedev.ri, filcab, mgorny, tschuett, RKSimon, llvm-commits

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

llvm-svn: 338567

6 years ago[UnrollAndJam] Add unroll_and_jam pragma handling
David Green [Wed, 1 Aug 2018 14:36:12 +0000 (14:36 +0000)]
[UnrollAndJam] Add unroll_and_jam pragma handling

This adds support for the unroll_and_jam pragma, to go with the recently
added unroll and jam pass. The name of the pragma is the same as is used
in the Intel compiler, and most of the code works the same as for unroll.

#pragma clang loop unroll_and_jam has been separated into a different
patch. This part adds #pragma unroll_and_jam with an optional count, and
#pragma no_unroll_and_jam to disable the transform.

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

llvm-svn: 338566

6 years ago[llvm-mca][x86] Add LEA instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 14:25:33 +0000 (14:25 +0000)]
[llvm-mca][x86] Add LEA instruction resource tests

We already added these to btver2, now add them to other targets, even though none of their models treat them specially (yet).

llvm-svn: 338565

6 years agoUpdate version to 8.0.0svn
Hans Wennborg [Wed, 1 Aug 2018 14:25:03 +0000 (14:25 +0000)]
Update version to 8.0.0svn

llvm-svn: 338564

6 years ago[llvm-mca][x86] Add more x86-64 system instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 14:18:09 +0000 (14:18 +0000)]
[llvm-mca][x86] Add more x86-64 system instruction resource tests

CPUID, IN/OUT, INS/OUTS, INT, PAUSE, SCAS, UD2, XLAT

llvm-svn: 338563

6 years ago[FPEnv] Widen illegal width StrictFP vector operations as needed
Cameron McInally [Wed, 1 Aug 2018 14:17:19 +0000 (14:17 +0000)]
[FPEnv] Widen illegal width StrictFP vector operations as needed

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

llvm-svn: 338562

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:14:09 +0000 (14:14 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338561

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:11:32 +0000 (14:11 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338560

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:09:00 +0000 (14:09 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338559

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:07:20 +0000 (14:07 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338558

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:01:27 +0000 (14:01 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338557

6 years agoClear release notes and update version
Hans Wennborg [Wed, 1 Aug 2018 13:58:00 +0000 (13:58 +0000)]
Clear release notes and update version

llvm-svn: 338556

6 years agoUpdate version to 8.0.0svn: cmake, includes files and docs
Hans Wennborg [Wed, 1 Aug 2018 13:54:28 +0000 (13:54 +0000)]
Update version to 8.0.0svn: cmake, includes files and docs

llvm-svn: 338555

6 years ago[AArch64] Fix FCCMP with FP16 operands
Bryan Chan [Wed, 1 Aug 2018 13:50:29 +0000 (13:50 +0000)]
[AArch64] Fix FCCMP with FP16 operands

Summary: This patch adds support for FCCMP instruction with FP16 operands, avoiding an assertion during instruction selection.

Reviewers: olista01, SjoerdMeijer, t.p.northover, javed.absar

Reviewed By: SjoerdMeijer

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 338554

6 years agoUse a dummy target so the test passes when default target is for a toolchain implemen...
Filipe Cabecinhas [Wed, 1 Aug 2018 13:41:42 +0000 (13:41 +0000)]
Use a dummy target so the test passes when default target is for a toolchain implements useIntegratedAs() -> true

llvm-svn: 338553

6 years agoAdd REQUIRES: native to a test that assumes it
Filipe Cabecinhas [Wed, 1 Aug 2018 13:41:11 +0000 (13:41 +0000)]
Add REQUIRES: native to a test that assumes it

llvm-svn: 338552

6 years ago[NFC] Silence warning about ptr-to-func to ptr-to-obj cast in clang-fuzzer/handle...
Andrei Elovikov [Wed, 1 Aug 2018 13:34:18 +0000 (13:34 +0000)]
[NFC] Silence warning about ptr-to-func to ptr-to-obj cast in clang-fuzzer/handle-llvm/handle_llvm.cpp.

Summary:
I don't have the whole list of GCC binaries available so I determined the exact
version where the warning disappeared via:

https://github.com/gcc-mirror/gcc/blob/gcc-4_9_0-release/gcc/cp/typeck.c#L6863
https://github.com/gcc-mirror/gcc/blob/gcc-4_8_5-release/gcc/cp/typeck.c#L6652

Reviewers: emmettneyman, erichkeane

Reviewed By: emmettneyman, erichkeane

Subscribers: cfe-commits

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

llvm-svn: 338551

6 years ago[llvm-mca][x86] Add CLFLUSHOPT instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 13:34:17 +0000 (13:34 +0000)]
[llvm-mca][x86] Add CLFLUSHOPT instruction resource tests

llvm-svn: 338550

6 years agoBump the trunk version to 8.0.0svn
Hans Wennborg [Wed, 1 Aug 2018 13:25:30 +0000 (13:25 +0000)]
Bump the trunk version to 8.0.0svn

llvm-svn: 338537

6 years ago[dsymutil] Convert recursion in lookForDIEsToKeep into worklist.
Jonas Devlieghere [Wed, 1 Aug 2018 13:24:39 +0000 (13:24 +0000)]
[dsymutil] Convert recursion in lookForDIEsToKeep into worklist.

The functions `lookForDIEsToKeep` and `keepDIEAndDependencies` can have
some very deep recursion. This tackles part of this problem by removing
the recursion from `lookForDIEsToKeep` by turning it into a worklist.

The difficulty in doing so is the computation of incompleteness, which
depends on the incompleteness of its children. To compute this, we
insert "continuation markers" into the worklist. This informs the work
loop to (re)compute the incompleteness property of the DIE associated
with it (i.e. the parent of the previously processed DIE).

This patch should generate byte-identical output. Unfortunately it also
has some impact of performance, regressing by about 4% when processing
clang on my machine.

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

llvm-svn: 338536

6 years agoTest: Enable exceptions for test that needs it
Filipe Cabecinhas [Wed, 1 Aug 2018 13:20:38 +0000 (13:20 +0000)]
Test: Enable exceptions for test that needs it

llvm-svn: 338535

6 years agoMake test/Frontend/clang-abi-compat.cpp pass when the version goes to 8
Hans Wennborg [Wed, 1 Aug 2018 13:19:14 +0000 (13:19 +0000)]
Make test/Frontend/clang-abi-compat.cpp pass when the version goes to 8

llvm-svn: 338534

6 years agoTest Commit
Owen Reynolds [Wed, 1 Aug 2018 13:16:48 +0000 (13:16 +0000)]
Test Commit

Removal of extra line

llvm-svn: 338533

6 years ago[llvm-mca][x86] Add CMPS/LODS/MOVS/STOS string instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 13:14:45 +0000 (13:14 +0000)]
[llvm-mca][x86] Add CMPS/LODS/MOVS/STOS string instruction resource tests

llvm-svn: 338532

6 years ago[libc++] Fix GCC 7.2.0 macro redefinition warning
Louis Dionne [Wed, 1 Aug 2018 13:13:14 +0000 (13:13 +0000)]
[libc++] Fix GCC 7.2.0 macro redefinition warning

The warning happens when LIBCXX_ENABLE_EXCEPTIONS cmake option is not set,
and it fires every time __config is included, 33 in total.

Patch by Jason Lovett
Reviewed as https://reviews.llvm.org/D49997

llvm-svn: 338531

6 years ago[X86] Use isNullConstant helper. NFCI.
Simon Pilgrim [Wed, 1 Aug 2018 13:06:14 +0000 (13:06 +0000)]
[X86] Use isNullConstant helper. NFCI.

llvm-svn: 338530

6 years agoFix "not all control paths return a value" MSVC warning.
Simon Pilgrim [Wed, 1 Aug 2018 13:00:11 +0000 (13:00 +0000)]
Fix "not all control paths return a value" MSVC warning.

llvm-svn: 338529

6 years agoUserManual: Update with the latest clang-cl flags
Hans Wennborg [Wed, 1 Aug 2018 12:58:57 +0000 (12:58 +0000)]
UserManual: Update with the latest clang-cl flags

llvm-svn: 338528

6 years ago[MC] Report fatal error for DWARF types for non-ELF object files
Jonas Devlieghere [Wed, 1 Aug 2018 12:53:06 +0000 (12:53 +0000)]
[MC] Report fatal error for DWARF types for non-ELF object files

Getting the DWARF types section is only implemented for ELF object
files. We already disabled emitting debug types in clang (r337717), but
now we also report an fatal error (rather than crashing) when trying to
obtain this section in MC. Additionally we ignore the generate debug
types flag for unsupported target triples.

See PR38190 for more information.

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

llvm-svn: 338527

6 years ago[clangd] Correct the namespace of ParsedAST forward declaration, NFC.
Haojian Wu [Wed, 1 Aug 2018 12:50:44 +0000 (12:50 +0000)]
[clangd] Correct the namespace of ParsedAST forward declaration, NFC.

llvm-svn: 338526

6 years ago[AArch64][ARM] Add Armv8.4-A tests
Sjoerd Meijer [Wed, 1 Aug 2018 12:41:10 +0000 (12:41 +0000)]
[AArch64][ARM] Add Armv8.4-A tests

This adds tests for Armv8.4-A, and also some v8.2 and v8.3 tests that were
missing.

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

llvm-svn: 338525

6 years ago[clang-format] Add some text proto functions to Google style
Krasimir Georgiev [Wed, 1 Aug 2018 12:35:23 +0000 (12:35 +0000)]
[clang-format] Add some text proto functions to Google style

Summary: Adds 2 functions taking a text proto argument.

Reviewers: djasper, klimek

Reviewed By: djasper

Subscribers: acoomans, cfe-commits

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

llvm-svn: 338524

6 years ago[AMDGPU] Optimize _L image intrinsic to _LZ when lod is zero
Ryan Taylor [Wed, 1 Aug 2018 12:12:01 +0000 (12:12 +0000)]
[AMDGPU] Optimize _L image intrinsic to _LZ when lod is zero

Summary:
Add _L to _LZ image intrinsic table mapping to table gen.
In ISelLowering check if image intrinsic has lod and if it's equal
to zero, if so remove lod and change opcode to equivalent mapped _LZ.

Change-Id: Ie24cd7e788e2195d846c7bd256151178cbb9ec71

Subscribers: arsenm, mehdi_amini, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 338523

6 years agoFix build bot after r338521
Ulrich Weigand [Wed, 1 Aug 2018 12:07:32 +0000 (12:07 +0000)]
Fix build bot after r338521

llvm-svn: 338522

6 years ago[SystemZ, TableGen] Fix shift count handling
Ulrich Weigand [Wed, 1 Aug 2018 11:57:58 +0000 (11:57 +0000)]
[SystemZ, TableGen] Fix shift count handling

The DAG combiner logic to simplify AND masks in shift counts is invalid.
While it is true that the SystemZ shift instructions ignore all but the
low 6 bits of the shift count, it is still invalid to simplify the AND
masks while the DAG still uses the standard shift operators (which are
*not* defined to match the SystemZ instruction behavior).

Instead, this patch performs equivalent operations during instruction
selection. For completely removing the AND, this now happens via
additional DAG match patterns implemented by a multi-alternative
PatFrags. For simplifying a 32-bit AND to a 16-bit AND, the existing DAG
patterns were already mostly OK, they just needed an output XForm to
actually truncate the immediate value.

Unfortunately, the latter change also exposed a bug in TableGen: it
seems XForms are currently only handled correctly for direct operands of
the outermost operation node. This patch also fixes that bug by simply
recurring through the whole pattern. This should be NFC for all other
targets.

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

llvm-svn: 338521

6 years agowrap to 80 cols, no behavior change
Nico Weber [Wed, 1 Aug 2018 11:56:20 +0000 (11:56 +0000)]
wrap to 80 cols, no behavior change

llvm-svn: 338520

6 years ago[clang-format] Add @private to the list of jsdoc annotations
Krasimir Georgiev [Wed, 1 Aug 2018 11:48:04 +0000 (11:48 +0000)]
[clang-format] Add @private to the list of jsdoc annotations

Reviewers: mprobst

Reviewed By: mprobst

Subscribers: acoomans, cfe-commits

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

llvm-svn: 338519

6 years ago[clangd] Receive compilationDatabasePath in 'initialize' request
Simon Marchi [Wed, 1 Aug 2018 11:28:49 +0000 (11:28 +0000)]
[clangd] Receive compilationDatabasePath in 'initialize' request

Summary:
That way, as soon as the "initialize" is received by the server, it can start
parsing/indexing with a valid compilation database and not have to wait for a
an initial 'didChangeConfiguration' that might or might not happen.
Then, when the user changes configuration, a didChangeConfiguration can be sent.

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

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 338518

6 years ago[clangd] Make SymbolLocation => bool conversion explicitly.
Haojian Wu [Wed, 1 Aug 2018 11:24:50 +0000 (11:24 +0000)]
[clangd] Make SymbolLocation => bool conversion explicitly.

Summary:
The implicit bool conversion could happen superisingly, e.g. when
checking `if (Loc1 == Loc2)`, the compiler will convert SymbolLocation to
bool before comparing (because we don't define operator `==` for SymbolLocation).

Reviewers: sammccall

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 338517

6 years ago[X86] Use isNullConstant helper. NFCI.
Simon Pilgrim [Wed, 1 Aug 2018 11:24:11 +0000 (11:24 +0000)]
[X86] Use isNullConstant helper. NFCI.

llvm-svn: 338516

6 years ago[llvm-mca][x86] Add STC + STD instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 11:00:11 +0000 (11:00 +0000)]
[llvm-mca][x86] Add STC + STD instruction resource tests

llvm-svn: 338514

6 years ago[llvm-mca] Improve code comments. NFC.
Andrea Di Biagio [Wed, 1 Aug 2018 10:49:01 +0000 (10:49 +0000)]
[llvm-mca] Improve code comments. NFC.

llvm-svn: 338513

6 years agoPPCG codegen
Tobias Grosser [Wed, 1 Aug 2018 10:48:38 +0000 (10:48 +0000)]
PPCG codegen

The latest version of the isl C++ bindings does not export the 'set'
method yet. Fall back to the C interface until this method can be
exported.

llvm-svn: 338512

6 years ago[DebugInfo] Remove ambiguity to fix Windows bots
Jonas Devlieghere [Wed, 1 Aug 2018 10:40:08 +0000 (10:40 +0000)]
[DebugInfo] Remove ambiguity to fix Windows bots

Should fix the MSVC bots by explicitly invoking
llvm::make_reverse_iterator to remove ambiguity with
std::make_reverse_iterator.

llvm-svn: 338511

6 years agoAdd missing semicolon.
Simon Pilgrim [Wed, 1 Aug 2018 10:34:13 +0000 (10:34 +0000)]
Add missing semicolon.

llvm-svn: 338510

6 years ago[DebugInfo] Improve consistency in DWARFDie.h (NFC)
Jonas Devlieghere [Wed, 1 Aug 2018 10:30:34 +0000 (10:30 +0000)]
[DebugInfo] Improve consistency in DWARFDie.h (NFC)

Follow-up for r338506 with some unrelated changes in formatting and
consistency.

llvm-svn: 338509

6 years agoReplace 'FALL-THROUGH' comment with LLVM_FALLTHROUGH to silence warning. NFCI.
Simon Pilgrim [Wed, 1 Aug 2018 10:26:04 +0000 (10:26 +0000)]
Replace 'FALL-THROUGH' comment with LLVM_FALLTHROUGH to silence warning. NFCI.

llvm-svn: 338508

6 years ago[X86] Improved sched models for X86 BT*rr instructions.
Andrew V. Tischenko [Wed, 1 Aug 2018 10:24:27 +0000 (10:24 +0000)]
[X86] Improved sched models for X86 BT*rr instructions.
Differential Revision: https://reviews.llvm.org/D49243

llvm-svn: 338507

6 years ago[DebugInfo] Have custom std::reverse_iterator<DWARFDie>
Jonas Devlieghere [Wed, 1 Aug 2018 10:24:17 +0000 (10:24 +0000)]
[DebugInfo] Have custom std::reverse_iterator<DWARFDie>

The DWARFDie is a lightweight utility wrapper that stores a pointer to a
compile unit and a debug info entry. Currently, its iterator (used for
walking over its children) stores a DWARFDie and returns a const
reference when dereferencing it.

When the iterator is modified (by incrementing or decrementing it), this
reference becomes invalid. This was happening when calling reverse on
it, because the std::reverse_iterator is keeping a temporary copy of the
iterator (see
https://en.cppreference.com/w/cpp/iterator/reverse_iterator for a good
illustration).

The relevant code in libcxx:

  reference operator*() const {_Iter __tmp = current; return *--__tmp;}

When dereferencing the reverse iterator, we decrement and return a
reference to a DWARFDie stored in the stack frame of this function,
resulting in UB at runtime.

This patch specifies the std::reverse_iterator for DWARFDie to do the
right thing.

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

llvm-svn: 338506

6 years ago[isl++] drop the isl namespace qualifiers [NFC]
Tobias Grosser [Wed, 1 Aug 2018 09:57:36 +0000 (09:57 +0000)]
[isl++] drop the isl namespace qualifiers [NFC]

These namespace qualifiers are not needed. Dropping them brings us
closer to the official isl namespace qualifiers.

While the delta of this change set is large, it only mechanically drops
the 'isl::' prefixes.

llvm-svn: 338505

6 years agoRebase C++ bindings on top of latest isl bindings
Tobias Grosser [Wed, 1 Aug 2018 09:57:10 +0000 (09:57 +0000)]
Rebase C++ bindings on top of latest isl bindings

The main difference in this change is that isl_stat is now always
checked by default. As we elminiated most used of isl_stat, thanks to
Philip Pfaffe's implementation of foreach, only a small set of changes
is needed.

This change does not include the following recent changes to isl's C++
bindings:

  - stricter error handling for isl_bool
  - dropping of the isl::namespace qualifiers

The former requires a larger patch in Polly and consequently should go
through a patch-review. The latter will be applied in the next commit to
keep this commit free from noise.

We also still apply a couple of other changes on top of the official isl
bindings. This delta is expected to shrink over time.

llvm-svn: 338504

6 years ago[Modules] Do not emit relocation error when -fno-validate-pch is set
Yuka Takahashi [Wed, 1 Aug 2018 09:50:02 +0000 (09:50 +0000)]
[Modules] Do not emit relocation error when -fno-validate-pch is set

Summary:
Clang emits error when implicit modules was relocated from the
first build directory. However this was biting our usecase where we copy
the contents of build directory to another directory in order to
distribute.

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

llvm-svn: 338503

6 years agoFix "not all control paths return a value" MSVC warning.
Simon Pilgrim [Wed, 1 Aug 2018 09:45:21 +0000 (09:45 +0000)]
Fix "not all control paths return a value" MSVC warning.

llvm-svn: 338502

6 years agoUpdate to isl-0.20-35-ge0a98b62
Tobias Grosser [Wed, 1 Aug 2018 09:20:03 +0000 (09:20 +0000)]
Update to isl-0.20-35-ge0a98b62

llvm-svn: 338501

6 years ago[gcov] Add test which uses fork
Marco Castelluccio [Wed, 1 Aug 2018 09:11:36 +0000 (09:11 +0000)]
[gcov] Add test which uses fork

Test for https://bugs.llvm.org/show_bug.cgi?id=38180.

llvm-svn: 338500

6 years ago[MIPS GlobalISel] Select global address
Petar Jovanovic [Wed, 1 Aug 2018 09:03:23 +0000 (09:03 +0000)]
[MIPS GlobalISel] Select global address

Select G_GLOBAL_VALUE for position dependent code.

Patch by Petar Avramovic.

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

llvm-svn: 338499

6 years ago[LLD][ELF] - Apply clang-format to InputSections.cpp. NFC.
George Rimar [Wed, 1 Aug 2018 08:11:54 +0000 (08:11 +0000)]
[LLD][ELF] - Apply clang-format to InputSections.cpp. NFC.

llvm-svn: 338498

6 years ago[LLD][ELF] - Removed excessive llvm:: prefix. NFC.
George Rimar [Wed, 1 Aug 2018 08:10:50 +0000 (08:10 +0000)]
[LLD][ELF] - Removed excessive llvm:: prefix. NFC.

llvm-svn: 338497

6 years agoRevert "Enrich inline messages", tests fail
David Bolvansky [Wed, 1 Aug 2018 08:02:40 +0000 (08:02 +0000)]
Revert "Enrich inline messages", tests fail

llvm-svn: 338496

6 years agoAdd llvm-rc to LLVM_TOOLCHAIN_TOOLS (PR38386)
Hans Wennborg [Wed, 1 Aug 2018 07:51:55 +0000 (07:51 +0000)]
Add llvm-rc to LLVM_TOOLCHAIN_TOOLS (PR38386)

This means it will be installed also in builds configured with
LLVM_INSTALL_TOOLCHAIN_ONLY, such as the Windows packages.

llvm-svn: 338495

6 years agoEnrich inline messages
David Bolvansky [Wed, 1 Aug 2018 07:37:16 +0000 (07:37 +0000)]
Enrich inline messages

Summary:
This patch improves Inliner to provide causes/reasons for negative inline decisions.
1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
4. Adjusted tests for changed printing.

Patch by: yrouban (Yevgeny Rouban)

Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00

Reviewed By: tejohnson, xbolva00

Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith

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

llvm-svn: 338494

6 years ago[AArch64] Disallow the MachO specific .loh directive for windows
Martin Storsjo [Wed, 1 Aug 2018 06:50:18 +0000 (06:50 +0000)]
[AArch64] Disallow the MachO specific .loh directive for windows

Also add a test for it being unsupported for linux.

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

llvm-svn: 338493

6 years ago[X86] When looking for (CMOV C-1, (ADD (CTTZ X), C), (X != 0)) -> (ADD (CMOV (CTTZ...
Craig Topper [Wed, 1 Aug 2018 06:36:20 +0000 (06:36 +0000)]
[X86] When looking for (CMOV C-1, (ADD (CTTZ X), C), (X != 0)) -> (ADD (CMOV (CTTZ X), -1, (X != 0)), C), make sure we really have a compare with 0.

It's not strictly required by the transform of the cmov and the add, but it makes sure we restrict it to the cases we know we want to match.

While there canonicalize the operand order of the cmov to simplify the matching and emitting code.

llvm-svn: 338492

6 years agoRemoved failing StreamTest case
Raphael Isemann [Wed, 1 Aug 2018 06:35:27 +0000 (06:35 +0000)]
Removed failing StreamTest case

The suspicious behavior is obviously because this method reads
OOB memory, so I'll remove it for now and re-add the test alongside
the fix later.

llvm-svn: 338491

6 years ago[test] Convert test for PR36720 to c89
Jonas Hahnfeld [Wed, 1 Aug 2018 06:26:55 +0000 (06:26 +0000)]
[test] Convert test for PR36720 to c89

GCC 4.8.5 defaults to this old C standard. I think we should make the
tests pass a newer -std=c99|c11 but that's too intrusive for now...

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

llvm-svn: 338490

6 years ago[AST] CastExpr: BasePathSize is not large enough.
Roman Lebedev [Wed, 1 Aug 2018 06:06:16 +0000 (06:06 +0000)]
[AST] CastExpr: BasePathSize is not large enough.

Summary:
rC337815 / D49508 had to cannibalize one bit of `CastExprBitfields::BasePathSize` in order to squeeze `PartOfExplicitCast` boolean.
That reduced the maximal value of `PartOfExplicitCast` from 9 bits (~512) down to 8 bits (~256).
Apparently, that mattered. Too bad there weren't any tests.
It caused [[ https://bugs.llvm.org/show_bug.cgi?id=38356 | PR38356 ]].

So we need to increase `PartOfExplicitCast` back at least to 9 bits, or a bit more.
For obvious reasons, we can't do that in `CastExprBitfields` - that would blow up the size of every `Expr`.
So we need to either just add a variable into the `CastExpr` (as done here),
or use `llvm::TrailingObjects`. The latter does not seem to be straight-forward.
Perhaps, that needs to be done not for the `CastExpr` itself, but for all of it's `final` children.

Reviewers: rjmccall, rsmith, erichkeane

Reviewed By: rjmccall

Subscribers: bricci, hans, cfe-commits, waddlesplash

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

llvm-svn: 338489

6 years agoAdded initial unit test for LLDB's Stream class.
Raphael Isemann [Wed, 1 Aug 2018 06:04:48 +0000 (06:04 +0000)]
Added initial unit test for LLDB's Stream class.

Summary:
This adds an initial small unit test for LLDB's Stream class, which should at least cover
most of the functions in the Stream class. StreamString is always in big endian
mode, so that's the only stream byte order path this test covers as of now. Also,
the binary mode still needs to be tested for all print methods.

Also adds some FIXMEs for wrong/strange result values of the Stream class that we hit
while testing those functions.

Reviewers: labath

Reviewed By: labath

Subscribers: probinson, labath, mgorny, lldb-commits

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

llvm-svn: 338488

6 years ago[DWARF] Basic support for producing DWARFv5 .debug_addr section
Victor Leschuk [Wed, 1 Aug 2018 05:48:06 +0000 (05:48 +0000)]
[DWARF] Basic support for producing DWARFv5 .debug_addr section

This revision implements support for generating DWARFv5 .debug_addr section.
The implementation is pretty straight-forward: we just check the dwarf version
and emit section header if needed.

Reviewers: aprantl, dblaikie, probinson

Reviewed by: dblaikie

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

llvm-svn: 338487

6 years ago[libc++] Fix build failures after merging <charconv>
Zhihao Yuan [Wed, 1 Aug 2018 05:21:26 +0000 (05:21 +0000)]
[libc++] Fix build failures after merging <charconv>

Summary:
- fix a stupid unit test typo
- add <charconv> symbols to Linux abilist

Reviewers: EricWF

Subscribers: christof, ldionne, cfe-commits

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

llvm-svn: 338486

6 years ago[InstSimplify] fold extracting from std::pair (1/2)
Hiroshi Inoue [Wed, 1 Aug 2018 04:40:32 +0000 (04:40 +0000)]
[InstSimplify] fold extracting from std::pair (1/2)

This patch intends to enable jump threading when a method whose return type is std::pair<int, bool> or std::pair<bool, int> is inlined.
For example, jump threading does not happen for the if statement in func.

std::pair<int, bool> callee(int v) {
  int a = dummy(v);
  if (a) return std::make_pair(dummy(v), true);
  else return std::make_pair(v, v < 0);
}

int func(int v) {
  std::pair<int, bool> rc = callee(v);
  if (rc.second) {
    // do something
  }

SROA executed before the method inlining replaces std::pair by i64 without splitting in both callee and func since at this point no access to the individual fields is seen to SROA.
After inlining, jump threading fails to identify that the incoming value is a constant due to additional instructions (like or, and, trunc).

This series of patch add patterns in InstructionSimplify to fold extraction of members of std::pair. To help jump threading, actually we need to optimize the code sequence spanning multiple BBs.
These patches does not handle phi by itself, but these additional patterns help NewGVN pass, which calls instsimplify to check opportunities for simplifying instructions over phi, apply phi-of-ops optimization to result in successful jump threading.
SimplifyDemandedBits in InstCombine, can do more general optimization but this patch aims to provide opportunities for other optimizers by supporting a simple but common case in InstSimplify.

This first patch in the series handles code sequences that merges two values using shl and or and then extracts one value using lshr.

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

llvm-svn: 338485

6 years ago[DebugInfo] Fix build failed in clang-x86_64-linux-selfhost-modules.
Hsiangkai Wang [Wed, 1 Aug 2018 04:17:41 +0000 (04:17 +0000)]
[DebugInfo] Fix build failed in clang-x86_64-linux-selfhost-modules.

Only generate symbol difference expression if needed.

llvm-svn: 338484

6 years ago[X86] Adding more test patterns for lea-opt (PR37939)
Jatin Bhateja [Wed, 1 Aug 2018 03:53:27 +0000 (03:53 +0000)]
[X86] Adding more test patterns for lea-opt (PR37939)

Subscribers: llvm-commits

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

llvm-svn: 338483

6 years ago[OpenEmbedded] Explicitly specify -rtlib in tests
Petr Hosek [Wed, 1 Aug 2018 03:30:06 +0000 (03:30 +0000)]
[OpenEmbedded] Explicitly specify -rtlib in tests

Tests added in r338294 implicitly assume that libgcc is the runtime library,
but that's not the case when the user configures Clang to use compiler-rt in
which case these tests will break. Explicitly request libgcc when invoking
clang in these tests to avoid that.

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

llvm-svn: 338482

6 years ago[x86] Fix a really subtle miscompile due to a somewhat glaring bug in
Chandler Carruth [Wed, 1 Aug 2018 03:01:58 +0000 (03:01 +0000)]
[x86] Fix a really subtle miscompile due to a somewhat glaring bug in
EFLAGS copy lowering.

If you have a branch of LLVM, you may want to cherrypick this. It is
extremely unlikely to hit this case empirically, but it will likely
manifest as an "impossible" branch being taken somewhere, and will be
... very hard to debug.

Hitting this requires complex conditions living across complex control
flow combined with some interesting memory (non-stack) initialized with
the results of a comparison. Also, because you have to arrange for an
EFLAGS copy to be in *just* the right place, almost anything you do to
the code will hide the bug. I was unable to reduce anything remotely
resembling a "good" test case from the place where I hit it, and so
instead I have constructed synthetic MIR testing that directly exercises
the bug in question (as well as the good behavior for completeness).

The issue is that we would mistakenly assume any SETcc with a valid
condition and an initial operand that was a register and a virtual
register at that to be a register *defining* SETcc...

It isn't though....

This would in turn cause us to test some other bizarre register,
typically the base pointer of some memory. Now, testing this register
and using that to branch on doesn't make any sense. It even fails the
machine verifier (if you are running it) due to the wrong register
class. But it will make it through LLVM, assemble, and it *looks*
fine... But wow do you get a very unsual and surprising branch taken in
your actual code.

The fix is to actually check what kind of SETcc instruction we're
dealing with. Because there are a bunch of them, I just test the
may-store bit in the instruction. I've also added an assert for sanity
that ensure we are, in fact, *defining* the register operand. =D

llvm-svn: 338481

6 years ago[x86/slh] Add unwind info to several tests to make it more obvious that
Chandler Carruth [Wed, 1 Aug 2018 03:01:10 +0000 (03:01 +0000)]
[x86/slh] Add unwind info to several tests to make it more obvious that
we aren't incorrectly generating any of it when doing SLH.

There was a bug that only occured with SLH that very much looked like it
could be caused by bad unwind info, and so this was a prime suspect.
Turns out that everything is fine, but this way we'll *see* if we end
up, for example, putting things we shouldn't inside the prolog.

llvm-svn: 338480

6 years ago[libc++][C++17] Elementary string conversions for integral types
Zhihao Yuan [Wed, 1 Aug 2018 02:38:30 +0000 (02:38 +0000)]
[libc++][C++17] Elementary string conversions for integral types

Summary:
Major QoI considerations:

- The facility is backported to C++14, same as libstdc++.
- Efforts have been made to minimize the header dependencies.
- The design is friendly to the uses of MSVC intrinsics (`__emulu`, `_umul128`, `_BitScanForward`, `_BitScanForward64`) but not implemented; future contributions are welcome.

Thanks to Milo Yip for contributing the implementation of `__u64toa` and `__u32toa`.

References:
 https://wg21.link/p0067r5
 https://wg21.link/p0682r1

Reviewers: mclow.lists, EricWF

Reviewed By: mclow.lists

Subscribers: ldionne, Quuxplusone, christof, mgorny, cfe-commits

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

llvm-svn: 338479

6 years agoWork around GCC miscompile exposed by r338464.
Richard Smith [Wed, 1 Aug 2018 02:27:18 +0000 (02:27 +0000)]
Work around GCC miscompile exposed by r338464.

See gcc.gnu.org/PR86769 for details of the bug.

llvm-svn: 338478

6 years ago[DebugInfo] Generate fixups as emitting DWARF .debug_line.
Hsiangkai Wang [Wed, 1 Aug 2018 02:18:06 +0000 (02:18 +0000)]
[DebugInfo] Generate fixups as emitting DWARF .debug_line.

It is necessary to generate fixups in .debug_line as relaxation is
enabled due to the address delta may be changed after relaxation.

DWARF will record the mappings of lines and addresses in
.debug_line section. It will encode the information using special
opcodes, standard opcodes and extended opcodes in Line Number
Program. I use DW_LNS_fixed_advance_pc to encode fixed length
address delta and DW_LNE_set_address to encode absolute address
to make it possible to generate fixups in .debug_line section.

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

llvm-svn: 338477

6 years ago[GlobalISel][IRTranslator] Use RPO traversal when visiting blocks to translate.
Amara Emerson [Wed, 1 Aug 2018 02:17:42 +0000 (02:17 +0000)]
[GlobalISel][IRTranslator] Use RPO traversal when visiting blocks to translate.

Previously we were just visiting the blocks in the function in IR order, which
is rather arbitrary. Therefore we wouldn't always visit defs before uses, but
the translation code relies on this assumption in some places.

Only codegen change seen in tests is an elision of a redundant copy.

Fixes PR38396

llvm-svn: 338476

6 years ago[libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDI...
Louis Dionne [Wed, 1 Aug 2018 02:08:59 +0000 (02:08 +0000)]
[libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY

Summary: As suggested by Marshall in https://reviews.llvm.org/D49914

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

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

llvm-svn: 338475

6 years ago[analyzer] CallEvent: Add helper methods for obtaining the callee stack frame.
Artem Dergachev [Wed, 1 Aug 2018 01:58:15 +0000 (01:58 +0000)]
[analyzer] CallEvent: Add helper methods for obtaining the callee stack frame.

Newly added methods allow reasoning about the stack frame of the call (as
opposed to the stack frame on which the call was made, which was always
available) - obtain the stack frame context, obtain parameter regions - even if
the call is not going to be (or was not) inlined, i.e. even if the analysis
has never actually entered the stack frame.

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

llvm-svn: 338474

6 years agoSpeculative fix for buildbot failures after r338464.
Richard Smith [Wed, 1 Aug 2018 01:57:49 +0000 (01:57 +0000)]
Speculative fix for buildbot failures after r338464.

llvm-svn: 338473

6 years agoFirst half of C++17's splicing maps and sets
Erik Pilkington [Wed, 1 Aug 2018 01:33:38 +0000 (01:33 +0000)]
First half of C++17's splicing maps and sets

This commit adds a node handle type, (located in __node_handle), and adds
extract() and insert() members to all map and set types, as well as their
implementations in __tree and __hash_table.

The second half of this feature is adding merge() members, which splice nodes
in bulk from one container into another. This will be committed in a follow-up.

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

llvm-svn: 338472

6 years agoAMDGPU: Add clamp bit to dot builtins
Konstantin Zhuravlyov [Wed, 1 Aug 2018 01:32:21 +0000 (01:32 +0000)]
AMDGPU: Add clamp bit to dot builtins

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

llvm-svn: 338471

6 years agoAMDGPU: Add clamp bit to dot intrinsics
Konstantin Zhuravlyov [Wed, 1 Aug 2018 01:31:30 +0000 (01:31 +0000)]
AMDGPU: Add clamp bit to dot intrinsics

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

llvm-svn: 338470

6 years agoSimplify selectELFSectionForGlobal by pulling out the entry size
Eric Christopher [Wed, 1 Aug 2018 01:29:30 +0000 (01:29 +0000)]
Simplify selectELFSectionForGlobal by pulling out the entry size
determination for mergeable sections into a small static function.

llvm-svn: 338469

6 years agoTidy up logic around unique section name creation and remove a
Eric Christopher [Wed, 1 Aug 2018 01:03:34 +0000 (01:03 +0000)]
Tidy up logic around unique section name creation and remove a
mostly unused variable.

llvm-svn: 338468

6 years agoAvoid exposing name for range-based for '__range' variables in lifetime warnings.
Richard Smith [Wed, 1 Aug 2018 01:03:33 +0000 (01:03 +0000)]
Avoid exposing name for range-based for '__range' variables in lifetime warnings.

llvm-svn: 338467

6 years ago[JSONExporter] Try to appease buildbot. NFC.
Michael Kruse [Wed, 1 Aug 2018 00:48:01 +0000 (00:48 +0000)]
[JSONExporter] Try to appease buildbot. NFC.

The compiler does not seem to able move a local variable in the
function's return statement.

llvm-svn: 338466

6 years ago[MachineOutliner] Clean up subtarget handling.
Eli Friedman [Wed, 1 Aug 2018 00:37:20 +0000 (00:37 +0000)]
[MachineOutliner] Clean up subtarget handling.

Call shouldOutlineFromFunctionByDefault, isFunctionSafeToOutlineFrom,
getOutliningType, and getMachineOutlinerMBBFlags using the correct
TargetInstrInfo. And don't create a MachineFunction for a function
declaration.

The call to getOutliningCandidateInfo is still a little weird, but at
least the weirdness is explicitly called out.

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

llvm-svn: 338465

6 years ago[P0936R0] add [[clang::lifetimebound]] attribute
Richard Smith [Wed, 1 Aug 2018 00:33:25 +0000 (00:33 +0000)]
[P0936R0] add [[clang::lifetimebound]] attribute

This patch adds support for a new attribute, [[clang::lifetimebound]], that
indicates that the lifetime of a function result is related to one of the
function arguments. When walking an initializer to make sure that the lifetime
of the initial value is at least as long as the lifetime of the initialized
object, we step through parameters (including the implicit object parameter of
a non-static member function) that are marked with this attribute.

There's nowhere to write an attribute on the implicit object parameter, so in
lieu of that, it may be applied to a function type (where it appears
immediately after the cv-qualifiers and ref-qualifier, which is as close to a
declaration of the implicit object parameter as we have). I'm currently
modeling this in the AST as the attribute appertaining to the function type.

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

llvm-svn: 338464

6 years ago[PATCH] [SLC] Test simplification of pow() for vector types (NFC)
Evandro Menezes [Wed, 1 Aug 2018 00:30:43 +0000 (00:30 +0000)]
[PATCH] [SLC] Test simplification of pow() for vector types (NFC)

Add test case for the simplification of `pow()` for vector types that D50035
enables.

llvm-svn: 338463

6 years ago[Polly-ACC] Fix compilation after r338450. NFC.
Michael Kruse [Wed, 1 Aug 2018 00:27:29 +0000 (00:27 +0000)]
[Polly-ACC] Fix compilation after r338450. NFC.

llvm-svn: 338462

6 years ago[JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC.
Michael Kruse [Wed, 1 Aug 2018 00:15:16 +0000 (00:15 +0000)]
[JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC.

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

llvm-svn: 338461

6 years agoAndroid is an environment and we were comparing the android triple
Eric Christopher [Tue, 31 Jul 2018 23:53:24 +0000 (23:53 +0000)]
Android is an environment and we were comparing the android triple
against the OS rather than the environment. Also update other
uses of OS when we meant environment in the android local code.

NFC intended.

llvm-svn: 338460

6 years agoTidy up comment.
Eric Christopher [Tue, 31 Jul 2018 23:53:24 +0000 (23:53 +0000)]
Tidy up comment.

llvm-svn: 338459