platform/upstream/llvm.git
4 years ago[cmake] Emit an error for -DBUILD_SHARED_LIBS=ON on Windows
Tom Stellard [Thu, 14 Nov 2019 17:18:44 +0000 (09:18 -0800)]
[cmake] Emit an error for -DBUILD_SHARED_LIBS=ON on Windows

Summary:
The BUILD_SHARED_LIBS=ON build fails on Windows, so prevent users from
enabling it.

Reviewers: beanz, smeenai, compnerd, phosek

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

4 years agoDocument more specifically the rounding for "llvm.round".
Kevin P. Neal [Thu, 14 Nov 2019 18:11:54 +0000 (13:11 -0500)]
Document more specifically the rounding for "llvm.round".

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

4 years ago[InstCombine] remove duplicate code for simplifying a shuffle; NFCI
Sanjay Patel [Thu, 14 Nov 2019 17:06:50 +0000 (12:06 -0500)]
[InstCombine] remove duplicate code for simplifying a shuffle; NFCI

The transform is already handled by InstSimplify or earlier
in InstCombine, so trying to do it again is not necessary.

4 years agoMake the language more consistent since I'm about to commit a content
Kevin P. Neal [Thu, 10 Oct 2019 16:24:51 +0000 (12:24 -0400)]
Make the language more consistent since I'm about to commit a content
change next.

4 years ago[clang-include-fixer] Skip .rc files when finding symbols
Reid Kleckner [Wed, 13 Nov 2019 19:25:42 +0000 (11:25 -0800)]
[clang-include-fixer] Skip .rc files when finding symbols

Summary:
For some reason CMake includes entries for .rc files, but
find-all-symbols handles them improperly.

See PR43993

Reviewers: sammccall, bkramer

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[OPENMP]Add assignment operator in UDR test, NFC.
Alexey Bataev [Thu, 14 Nov 2019 17:58:49 +0000 (12:58 -0500)]
[OPENMP]Add assignment operator in UDR test, NFC.

Add assignment operator in the test to check that even if the operator
was declare explicitly, the constructor is called in the user-defined
reduction initializer anyway.

4 years agoFix incorrect comment.
Adrian Prantl [Thu, 14 Nov 2019 17:55:24 +0000 (09:55 -0800)]
Fix incorrect comment.

4 years agoConvert condition to early exit (NFC)
Adrian Prantl [Thu, 14 Nov 2019 17:38:49 +0000 (09:38 -0800)]
Convert condition to early exit (NFC)

4 years agoConvert UpdateExternalModuleListIfNeeded to use early exits.
Adrian Prantl [Thu, 14 Nov 2019 17:35:06 +0000 (09:35 -0800)]
Convert UpdateExternalModuleListIfNeeded to use early exits.

4 years agoRename DWO -> Clang module to avoid confusion. (NFC)
Adrian Prantl [Thu, 14 Nov 2019 17:13:04 +0000 (09:13 -0800)]
Rename DWO -> Clang module to avoid confusion. (NFC)

4 years ago[LLDB] Make a clear distinction between usage & development docs
Jonas Devlieghere [Thu, 14 Nov 2019 17:02:35 +0000 (09:02 -0800)]
[LLDB] Make a clear distinction between usage & development docs

This renames the "Goals & Status" section to "Project" and the
"Resources" section to "Development". To better match this layout I've
moved the releases page under "Project".

4 years agoUse ForEachExternalModule in ParseTypeFromClangModule (NFC)
Adrian Prantl [Thu, 14 Nov 2019 16:57:32 +0000 (08:57 -0800)]
Use ForEachExternalModule in ParseTypeFromClangModule (NFC)

I wanted to further simplify ParseTypeFromClangModule by replacing the
hand-rolled loop with ForEachExternalModule, and then realized that
ForEachExternalModule also had the problem of visiting the same leaf
node an exponential number of times in the worst-case. This adds a set
of searched_symbol_files set to the function as well as the ability to
early-exit from it.

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

4 years ago[AMDGPU][HIP] Change default DWARF version to 4
Scott Linder [Wed, 13 Nov 2019 17:31:50 +0000 (12:31 -0500)]
[AMDGPU][HIP] Change default DWARF version to 4

Summary:
Tooling around DWARF 5 is still not mature enough for this to be a sane
default, and the AMDGPU and HIP toolchains should agree on a single
default.

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, aprantl, dstuttard, tpr, t-tye, cfe-commits

Tags: #clang

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

4 years agoImprove VFS compatibility on Windows
Adrian McCarthy [Thu, 7 Nov 2019 18:50:33 +0000 (10:50 -0800)]
Improve VFS compatibility on Windows

Keys in a virtual file system can be in Posix or Windows form or even
a combination of the two.  Many VFS tests (and a few Clang tests) were
XFAILed on Windows because of false negatives when comparing paths.

First, we default CaseSenstive to false on Windows.  This allows
drive letters like "D:" to match "d:".  Windows filesystems are, by
default, case insensitive, so this makes sense even beyond the drive
letter.

Second, we allow slashes to match backslashes when they're used as the
root component of a path.

Both of these changes are limited to RedirectingFileSystems, so there's
little chance of affecting other path handling.

These changes allow eleven of the VFS tests to pass on Windows as well
as three other Clang tests, so they have re-enabled.

This solves the majority of PR43272.  Additional VFS test failures will
be fixed in separate patches.

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

4 years ago[clangd] Ignore more implicit nodes in computing selection.
Sam McCall [Wed, 13 Nov 2019 19:16:23 +0000 (20:16 +0100)]
[clangd] Ignore more implicit nodes in computing selection.

Summary:
The DeclRefExpr for the callee of overloaded `operator()` and `operator[]` are
assigned the range of the paren/bracket lists in the AST.
These are better thought of as implicit (at least `()` - `[] is murkier).
But there's no bit on Expr for implicit, so just ignore them on our side.

While here, deal with the case where an implicit stmt (e.g. implicit-this)
is wrapped in an implicit cast. Previously we ignored the statement but not
the cast, and so the cast ended up being selected.

Fixes https://github.com/clangd/clangd/issues/195

Reviewers: kadircet, lh123

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

Tags: #clang

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

4 years ago[clangd] Expose value of enumerators to Hover API. (not UI yet)
Sam McCall [Wed, 13 Nov 2019 21:24:17 +0000 (22:24 +0100)]
[clangd] Expose value of enumerators to Hover API. (not UI yet)

Summary: This is part of https://github.com/clangd/clangd/issues/180.

Reviewers: kadircet

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

Tags: #clang

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

4 years ago[ADT] Move drop_begin from iterator_range.h into STLExtras.
Lang Hames [Wed, 13 Nov 2019 17:13:03 +0000 (09:13 -0800)]
[ADT] Move drop_begin from iterator_range.h into STLExtras.

Summary:
drop_begin depends on adl_begin/adl_end, which are defined in STLExtras.h,
but we can't just #include STLExtras.h in iterator_range.h as that would
introduce a circular reference (STLExtras.h already depends on
iterator_range.h). The simplest solution is to move drop_begin into
STLExtras.h, which is a reasonable home for it anyway.

Reviewers: dblaikie

Subscribers: dexonsmith, ributzka, llvm-commits

Tags: #llvm

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

4 years ago[Analyzer][NFC] Separate white-box tests for iterator modelling from iterator checker...
Adam Balogh [Fri, 8 Nov 2019 11:52:09 +0000 (12:52 +0100)]
[Analyzer][NFC] Separate white-box tests for iterator modelling from iterator checker tests

The recently committed debug.IteratorDebugging checker enables
standalone white-box testing of the modelling of containers and
iterators. For the three checkers based on iterator modelling only
simple tests are needed.

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

4 years ago[lldb] Fix dwo variant of TestLibCxxFunction
Pavel Labath [Thu, 14 Nov 2019 15:16:25 +0000 (16:16 +0100)]
[lldb] Fix dwo variant of TestLibCxxFunction

The test was failing due to a bug in SymbolFileDWARF::FindFunctions --
the function was searching the main dwarf unit for DW_TAG_subprograms,
but the main unit is empty in case of split dwarf.  The fix is simple --
search the non-skeleton unit instead.

This bug went unnoticed because this function is expensive, and so one
generally avoids calling it.

4 years ago[InstCombine] regenerate test CHECKs; NFC
Sanjay Patel [Thu, 14 Nov 2019 15:20:48 +0000 (10:20 -0500)]
[InstCombine] regenerate test CHECKs; NFC

There's a discussion about changing a shufflevector
transform in:
https://bugs.llvm.org/show_bug.cgi?id=43958

It would protect against our current undef/poison
behavior, and these are all tests that could be affected.

4 years agoRevert "[ThinLTO] Add correctness check for RO/WO variable import"
Benjamin Kramer [Thu, 14 Nov 2019 15:07:13 +0000 (16:07 +0100)]
Revert "[ThinLTO] Add correctness check for RO/WO variable import"

This reverts commit a2292cc537b561416c21e8d4017715d652c144cc. Breaks
clang selfhost w/ThinLTO.

4 years agoOn FreeBSD use AT_EXECPATH from ELF auxiliary vectors for getExecutablePath
Ed Maste [Wed, 13 Nov 2019 18:24:23 +0000 (13:24 -0500)]
On FreeBSD use AT_EXECPATH from ELF auxiliary vectors for getExecutablePath

/proc/curproc/file and the KERN_PROC_PATHNAME sysctl may not return the
desired path if there are multiple hardlinks to the file, or if the path has
expired from the namecache.

Reviewed By: theraven

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

4 years agoARM: allow rewriting frame indexes for all prefetch variants.
Tim Northover [Thu, 14 Nov 2019 13:26:53 +0000 (13:26 +0000)]
ARM: allow rewriting frame indexes for all prefetch variants.

For some reason we could handle PLD but not PLDW or PLI, but all of them can
potentially refer to the stack region (if weirdly for PLI).

4 years agoGCOVProfiling - fix uninitialized variable warnings + make getFuncChecksum() const...
Simon Pilgrim [Thu, 14 Nov 2019 13:55:28 +0000 (13:55 +0000)]
GCOVProfiling - fix uninitialized variable warnings + make getFuncChecksum() const. NFCI.

4 years agoWholeProgramDevirt - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Thu, 14 Nov 2019 13:54:29 +0000 (13:54 +0000)]
WholeProgramDevirt - fix uninitialized variable warnings. NFCI.

4 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Thu, 14 Nov 2019 13:53:35 +0000 (13:53 +0000)]
Fix uninitialized variable warning. NFCI.

4 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Thu, 14 Nov 2019 13:52:46 +0000 (13:52 +0000)]
Fix uninitialized variable warning. NFCI.

4 years agoSROA - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Thu, 14 Nov 2019 13:52:02 +0000 (13:52 +0000)]
SROA - fix uninitialized variable warnings. NFCI.

4 years agoFix uninitialized variable warnings. NFCI.
Simon Pilgrim [Thu, 14 Nov 2019 13:50:38 +0000 (13:50 +0000)]
Fix uninitialized variable warnings. NFCI.

4 years agoHexagon - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Thu, 14 Nov 2019 13:47:22 +0000 (13:47 +0000)]
Hexagon - fix uninitialized variable warnings. NFCI.

4 years agoMSP430 - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Thu, 14 Nov 2019 13:32:40 +0000 (13:32 +0000)]
MSP430 - fix uninitialized variable warnings. NFCI.

4 years ago[libc++][P1872] span should have size_type, not index_type.
Louis Dionne [Thu, 14 Nov 2019 14:07:05 +0000 (09:07 -0500)]
[libc++][P1872] span should have size_type, not index_type.

Thanks to Marek Kurdej for the patch.

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

4 years ago[libc++] [P1612] Add missing feature-test macro __cpp_lib_endian.
Louis Dionne [Thu, 14 Nov 2019 13:54:23 +0000 (08:54 -0500)]
[libc++] [P1612] Add missing feature-test macro __cpp_lib_endian.

Thanks to Marek Kurdej for the patch.

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

4 years ago[AArch64][SVE] Implement floating-point comparison & reduction intrinsics
Kerry McLaughlin [Thu, 14 Nov 2019 13:29:57 +0000 (13:29 +0000)]
[AArch64][SVE] Implement floating-point comparison & reduction intrinsics

Summary:
Adds intrinsics for the following:
 - fadda & faddv
 - fminv, fmaxv, fminnmv & fmaxnmv
 - facge & facgt
 - fcmp[eq|ge|gt|ne|uo]

Reviewers: sdesmalen, huntergr, dancgr, mgudim

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Simplify the code in Index::refs
Ilya Biryukov [Thu, 14 Nov 2019 13:43:07 +0000 (14:43 +0100)]
[clangd] Simplify the code in Index::refs

Summary:
While here, also fix potential UB in MergeIndex.

Thanks Kadir for finding this!

Reviewers: hokein

Reviewed By: hokein

Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[LV] PreferPredicateOverEpilog respecting predicate loop hint
Sjoerd Meijer [Thu, 14 Nov 2019 13:10:44 +0000 (13:10 +0000)]
[LV] PreferPredicateOverEpilog respecting predicate loop hint

The vectoriser queries TTI->preferPredicateOverEpilogue to determine if
tail-folding is preferred for a loop, but it was not respecting loop hint
'predicate' that can disable this, which has now been added. This showed that
we were incorrectly initialising loop hint 'vectorize.predicate.enable' with 0
(i.e. FK_Disabled) but this should have been FK_Undefined, which has been
fixed.

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

4 years ago[DAGCombiner] Drop redundant DAG method param. NFC
Paweł Bylica [Thu, 14 Nov 2019 12:37:15 +0000 (13:37 +0100)]
[DAGCombiner] Drop redundant DAG method param. NFC

4 years ago[DAGCombiner] Use TLI field already available. NFC
Paweł Bylica [Thu, 14 Nov 2019 11:44:57 +0000 (12:44 +0100)]
[DAGCombiner] Use TLI field already available. NFC

4 years agoModernize llvm::Error handling in ExternalASTMerger
Raphael Isemann [Thu, 14 Nov 2019 12:36:09 +0000 (13:36 +0100)]
Modernize llvm::Error handling in ExternalASTMerger

4 years ago[libomptarget][nfc] Use cuda variable wrappers from support.h
JonChesterfield [Thu, 14 Nov 2019 12:43:56 +0000 (12:43 +0000)]
[libomptarget][nfc] Use cuda variable wrappers from support.h

Summary:
[libomptarget][nfc] Use cuda variable wrappers from support.h
Reimplementation of D69693, after the revert of D69885

Use the wrappers in support.h for cuda builtin variables at all call sites.
Localises use of cuda and removes WARPSIZE==32 assumption in debug.h.

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: jdoerfert

Subscribers: openmp-commits

Tags: #openmp

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

4 years ago[mips][NFC] Remove old FIXME comment
Miloš Stojanović [Thu, 14 Nov 2019 11:52:56 +0000 (12:52 +0100)]
[mips][NFC] Remove old FIXME comment

This was fixed in rL229595 but this comment was missed.

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

4 years ago[AArch64][SVE] Implement remaining floating-point arithmetic intrinsics
Kerry McLaughlin [Thu, 14 Nov 2019 11:59:00 +0000 (11:59 +0000)]
[AArch64][SVE] Implement remaining floating-point arithmetic intrinsics

Summary:
Adds intrinsics for the following:
  - fabs & fneg
  - fexpa
  - frint[a|i|m|n|p|x|z]
  - frecpe, frecps & frecpx
  - fsqrt, frsqrte & frsqrts

Reviewers: huntergr, sdesmalen, dancgr, mgudim

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[AArch64][SVE] Implement additional floating-point arithmetic intrinsics
Kerry McLaughlin [Thu, 14 Nov 2019 11:35:38 +0000 (11:35 +0000)]
[AArch64][SVE] Implement additional floating-point arithmetic intrinsics

Summary:
Adds intrinsics for the following:
  - ftssel
  - fcadd, fcmla
  - fmla, fmls, fnmla, fnmls
  - fmad, fmsb, fnmad, fnmsb

Reviewers: sdesmalen, huntergr, dancgr, mgudim

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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

4 years agoFix typos in docs. NFC
Diana Picus [Thu, 14 Nov 2019 10:53:53 +0000 (11:53 +0100)]
Fix typos in docs. NFC

4 years ago[NFC] Add one test for PowerPC to verify the sext_inreg for vector type.
QingShan Zhang [Thu, 14 Nov 2019 10:55:49 +0000 (10:55 +0000)]
[NFC] Add one test for PowerPC to verify the sext_inreg for vector type.

4 years agoFix use of add_llvm_tool in projects that build no targets
Kevin Petit [Wed, 13 Nov 2019 09:29:10 +0000 (09:29 +0000)]
Fix use of add_llvm_tool in projects that build no targets

Projects that set LLVM_TARGETS_TO_BUILD to an empty list
can't use add_llvm_tool (and probably other macros).

Here's the error that this change fixes:

list sub-command REMOVE_ITEM requires two or more arguments.

https://reviews.llvm.org/D70167

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
4 years agoRevert "[InstCombine] Fold PHIs with equal incoming pointers"
Daniil Suchkov [Thu, 14 Nov 2019 10:42:01 +0000 (17:42 +0700)]
Revert "[InstCombine] Fold PHIs with equal incoming pointers"

This reverts commit a2f6ae9abffcba260c22bb235879f0576bf3b783.
It is reverted due to clang-cmake-armv7-selfhost buildbot failure.

4 years ago[lldb] Fix that trailing backslashes in source lines break the Clang highlighter
Raphael Isemann [Thu, 14 Nov 2019 10:11:20 +0000 (11:11 +0100)]
[lldb] Fix that trailing backslashes in source lines break the Clang highlighter

Summary:
Clang's raw Lexer doesn't produce any tokens for trailing backslashes in a line. This doesn't work with
LLDB's Clang highlighter which builds the source code to display from the list of tokens the Lexer returns.
This causes that lines with trailing backslashes are lacking the backslash and the following newline when
rendering source code in LLDB.

This patch removes the trailing newline from the current line we are highlighting. This way Clang doesn't
drop the backslash token and we just restore the newline after tokenising.

Fixes rdar://57091487

Reviewers: JDevlieghere, labath

Reviewed By: JDevlieghere, labath

Subscribers: labath, lldb-commits

Tags: #lldb

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

4 years ago[InstCombine] Fold PHIs with equal incoming pointers
Daniil Suchkov [Thu, 14 Nov 2019 08:25:31 +0000 (15:25 +0700)]
[InstCombine] Fold PHIs with equal incoming pointers

This is a resubmission of bbb29738b58aaf6f6518269abdcf8f64131665a9 that
was reverted due to clang tests failures. It includes the fix and
additional IR tests for the missed case.

Summary:
In case when all incoming values of a PHI are equal pointers, this
transformation inserts a definition of such a pointer right after
definition of the base pointer and replaces with this value both PHI and
all it's incoming pointers. Primary goal of this transformation is
canonicalization of this pattern in order to enable optimizations that
can't handle PHIs. Non-inbounds pointers aren't currently supported.

Reviewers: spatel, RKSimon, lebedev.ri, apilipenko

Reviewed By: apilipenko

Tags: #llvm

Subscribers: hiraditya, llvm-commits

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

4 years ago[AArch64][DebugInfo] Fix incorrect call site param value produced by MOVZXi
Djordje Todorovic [Thu, 14 Nov 2019 07:32:03 +0000 (08:32 +0100)]
[AArch64][DebugInfo] Fix incorrect call site param value produced by MOVZXi

This resolves the problem with the truncation of the immediate operand.

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

4 years ago[NFC] Fix typo in ARMBaseRegisterInfo
Anna Welker [Thu, 14 Nov 2019 09:43:26 +0000 (09:43 +0000)]
[NFC] Fix typo in ARMBaseRegisterInfo

4 years ago[ThinLTO] Add correctness check for RO/WO variable import
evgeny [Thu, 14 Nov 2019 09:24:05 +0000 (12:24 +0300)]
[ThinLTO] Add correctness check for RO/WO variable import

This patch adds an assertion check for exported read/write-only
variables to be also in import list for module. If they aren't
we may face linker errors, because read/write-only variables are
internalized in their source modules. The patch also changes
export lists to store ValueInfo instead of GUID for performance
considerations.

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

4 years agoDWARFDebugLoclists: stricter base address handling
Pavel Labath [Tue, 12 Nov 2019 10:36:19 +0000 (11:36 +0100)]
DWARFDebugLoclists: stricter base address handling

Summary:
This removes the use of zero as a base address in section-based dumping.
Although this will often be true for (unlinked) object files with a
single compile unit, it is not true in general. This means that
section-based dumping will not be able to resolve entries referencing
the base address (DW_LLE_offset_pair) -- it wasn't able to do that
correctly before either, but now it will be more explicit about it. One
exception to that is if the location list contains an explicit
DW_LLE_base_address entry -- in this case the dumper will pick it up,
and resolve subsequent entries normally.

The patch also removes the fallback to zero in the "inline" dumping in
case the compile unit does not contain a base address.

Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb][NFC] Simplify IOHandler constructor/destructor setup
Raphael Isemann [Thu, 14 Nov 2019 08:47:10 +0000 (09:47 +0100)]
[lldb][NFC] Simplify IOHandler constructor/destructor setup

We only need a default constructor because of DISALLOW_COPY_AND_ASSIGN,
but the non-virtual destructor isn't needed.

4 years ago[LLDB] Fix whitespace/tabs mismatch in lldbsuite Makefile.rules
Muhammad Omair Javaid [Thu, 14 Nov 2019 08:53:51 +0000 (13:53 +0500)]
[LLDB] Fix whitespace/tabs mismatch in lldbsuite Makefile.rules

This patch fixes whitespace/tabs mismatch in
lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Legacy make files always used tabs though modern make version can
work with white-spaces I have chosen the legacy just to be safe.

Signed-off-by: Muhammad Omair Javaid <omair.javaid@linaro.org>
Differential Revision: https://reviews.llvm.org/D70154

4 years ago[clang][IFS][test] Reverting driver-test.c to what it was prior to e782192d5e6
Puyan Lotfi [Thu, 14 Nov 2019 08:39:16 +0000 (03:39 -0500)]
[clang][IFS][test] Reverting driver-test.c to what it was prior to e782192d5e6

My mistake. Changes I had in this test were for code changes that are
not landed yet. I am reverting driver-test.c back to what it was
originally.

4 years ago[clang][IFS][test] Removing -shared, fixing triple: driver-test.c/windows.cpp.
Puyan Lotfi [Thu, 14 Nov 2019 07:41:28 +0000 (02:41 -0500)]
[clang][IFS][test] Removing -shared, fixing triple: driver-test.c/windows.cpp.

Removing -shared as it is not used on a lot of targets in order to green failing
bots with this change. Also, tiding up the windows.cpp test as the
triple compile out can look slightly different that what you specified
on a windows bot.

4 years ago[clang][IFS][test][NFC] Tightening up clang-ifs tests to use -cc1 more often.
Puyan Lotfi [Thu, 14 Nov 2019 04:58:09 +0000 (23:58 -0500)]
[clang][IFS][test][NFC] Tightening up clang-ifs tests to use -cc1 more often.

Unless the test is explicitly testing a driver feature if clang
interface stubs I have changed the tests to use %clang_cc1. This should
make some changes I plan to make to the driver job pipeline cause fewer
test changes and breakages.

4 years agoCheck result of emitStrLen before passing it to CreateGEP
Dimitry Andric [Wed, 13 Nov 2019 21:15:30 +0000 (22:15 +0100)]
Check result of emitStrLen before passing it to CreateGEP

Summary:
This fixes PR43081, where the transformation of `strchr(p, 0) -> p +
strlen(p)` can cause a segfault, if `-fno-builtin-strlen` is used.  In
that case, `emitStrLen` returns nullptr, which CreateGEP is not designed
to handle.  Also add the minimized code from the PR as a test case.

Reviewers: xbolva00, spatel, jdoerfert, efriedma

Reviewed By: efriedma

Subscribers: lebedev.ri, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[mips] Use local variable to escape repetitive calls of `getOpcode`. NFC
Simon Atanasyan [Thu, 14 Nov 2019 06:05:24 +0000 (09:05 +0300)]
[mips] Use local variable to escape repetitive calls of `getOpcode`. NFC

4 years ago[mips] Use isInt<> call instead of explicit range checking. NFC
Simon Atanasyan [Thu, 14 Nov 2019 05:45:37 +0000 (08:45 +0300)]
[mips] Use isInt<> call instead of explicit range checking. NFC

4 years ago[cmake] Prevent building with BUILD_SHARED_LIBS and LLVM_LINK_LLVM_DYLIB
Tom Stellard [Thu, 14 Nov 2019 04:29:19 +0000 (20:29 -0800)]
[cmake] Prevent building with BUILD_SHARED_LIBS and LLVM_LINK_LLVM_DYLIB

Summary: This doesn't work, so error early if someone tries it.

Reviewers: beanz, smeenai, compnerd, phosek

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

4 years ago[ModuleUtils] Clean up header file. [NFC]
Francesco Petrogalli [Thu, 14 Nov 2019 04:29:07 +0000 (04:29 +0000)]
[ModuleUtils] Clean up header file. [NFC]

Summary:
1. Remove unused forward declaration.
2. Remove unnecessary `\defgroup` in docygen documentation.

Subscribers: llvm-commits

Tags: #llvm

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

4 years agoWarn on /align if used without /driver
Rui Ueyama [Wed, 13 Nov 2019 04:43:25 +0000 (13:43 +0900)]
Warn on /align if used without /driver

/align is not supposed to be used without /driver, so it makes sense
to warn if only /align is passed. MSVC link.exe warns on this too.

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

4 years agoImplement /driver, /driver:wdm and /driver:uponly
Rui Ueyama [Wed, 13 Nov 2019 04:53:15 +0000 (13:53 +0900)]
Implement /driver, /driver:wdm and /driver:uponly

This patch implements /driver, /driver:wdm and /driver:uponly as
described in
https://docs.microsoft.com/en-us/cpp/build/reference/driver-windows-nt-kernel-mode-driver?view=vs-2019.

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

4 years ago[WebAssembly] -fwasm-exceptions enables reference-types
Heejin Ahn [Tue, 5 Nov 2019 00:04:15 +0000 (16:04 -0800)]
[WebAssembly] -fwasm-exceptions enables reference-types

Summary:
This adds `-mreference-types` and `-mno-reference-types` flags to clang
and make `-fwasm-exceptions` enables reference types feature in clang
and the backend.

Reviewers: tlively

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

4 years ago[unittests] Add InitializePasses.h includes
Heejin Ahn [Thu, 14 Nov 2019 02:19:54 +0000 (18:19 -0800)]
[unittests] Add InitializePasses.h includes

Summary:
After D70211, Pass.h does not include InitializePasses.h anymore, so
these files need to include InitializePasses.h directly.

Reviewers: rnk

Subscribers: MatzeB, mehdi_amini, zzheng, llvm-commits

Tags: #llvm

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

4 years ago[LLDB] Don't install the pretty stack trace handler twice.
Jonas Devlieghere [Thu, 14 Nov 2019 01:23:21 +0000 (17:23 -0800)]
[LLDB] Don't install the pretty stack trace handler twice.

I noticed that currently we are printing LLVM's pretty stack trace
twice. The reason is that we're calling PrintStackTraceOnErrorSignal in
addition to InitLLVM, which besides some other useful things, also
register LLVM's pretty stack trace handler.

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

4 years agoMove CodeGenFileType enum to Support/CodeGen.h
Reid Kleckner [Wed, 13 Nov 2019 23:17:46 +0000 (15:17 -0800)]
Move CodeGenFileType enum to Support/CodeGen.h

Avoids the need to include TargetMachine.h from various places just for
an enum. Various other enums live here, such as the optimization level,
TLS model, etc. Data suggests that this change probably doesn't matter,
but it seems nice to have anyway.

4 years ago[AMDGPU] Fixed dpp test. NFC.
Stanislav Mekhanoshin [Thu, 14 Nov 2019 00:36:01 +0000 (16:36 -0800)]
[AMDGPU] Fixed dpp test. NFC.

4 years ago[cmake] Remove confusing condition argument from else() NFC
Tom Stellard [Thu, 14 Nov 2019 00:01:33 +0000 (16:01 -0800)]
[cmake] Remove confusing condition argument from else() NFC

Summary:
This makes it look like an elseif and also the variable referenced
in the condition was removed from this function in r366622.

Reviewers: dsanders, beanz, smeenai, compnerd, phosek

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

4 years agoRevert "Forward declare Optional<T> in STLExtras.h"
Reid Kleckner [Thu, 14 Nov 2019 00:36:21 +0000 (16:36 -0800)]
Revert "Forward declare Optional<T> in STLExtras.h"

This reverts commit a36f316390d4bc1bcb0e9de0f55831385ab24099.

I did not intend to push this with the InitializePasses.h change.

4 years agoSink all InitializePasses.h includes
Reid Kleckner [Wed, 13 Nov 2019 21:15:01 +0000 (13:15 -0800)]
Sink all InitializePasses.h includes

This file lists every pass in LLVM, and is included by Pass.h, which is
very popular. Every time we add, remove, or rename a pass in LLVM, it
caused lots of recompilation.

I found this fact by looking at this table, which is sorted by the
number of times a file was changed over the last 100,000 git commits
multiplied by the number of object files that depend on it in the
current checkout:
  recompiles    touches affected_files  header
  342380        95      3604    llvm/include/llvm/ADT/STLExtras.h
  314730        234     1345    llvm/include/llvm/InitializePasses.h
  307036        118     2602    llvm/include/llvm/ADT/APInt.h
  213049        59      3611    llvm/include/llvm/Support/MathExtras.h
  170422        47      3626    llvm/include/llvm/Support/Compiler.h
  162225        45      3605    llvm/include/llvm/ADT/Optional.h
  158319        63      2513    llvm/include/llvm/ADT/Triple.h
  140322        39      3598    llvm/include/llvm/ADT/StringRef.h
  137647        59      2333    llvm/include/llvm/Support/Error.h
  131619        73      1803    llvm/include/llvm/Support/FileSystem.h

Before this change, touching InitializePasses.h would cause 1345 files
to recompile. After this change, touching it only causes 550 compiles in
an incremental rebuild.

Reviewers: bkramer, asbirlea, bollu, jdoerfert

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

4 years agoForward declare Optional<T> in STLExtras.h
Reid Kleckner [Thu, 14 Nov 2019 00:28:12 +0000 (16:28 -0800)]
Forward declare Optional<T> in STLExtras.h

WIP stats

4 years ago[AMDGPU] Fixed mfma-loop test. NFC.
Stanislav Mekhanoshin [Wed, 13 Nov 2019 23:58:49 +0000 (15:58 -0800)]
[AMDGPU] Fixed mfma-loop test. NFC.

4 years ago[LLDB] Cleanup the DataEncoder utility. (NFC)
Jonas Devlieghere [Wed, 13 Nov 2019 23:38:43 +0000 (15:38 -0800)]
[LLDB] Cleanup the DataEncoder utility. (NFC)

This commit removes unused methods from the DataEncoder class and cleans
up the API by making all the internal methods private.

4 years agoRevert a hunk from 9634064cfa1b9bf7b7
Reid Kleckner [Wed, 13 Nov 2019 23:40:22 +0000 (15:40 -0800)]
Revert a hunk from 9634064cfa1b9bf7b7

This causes errors when building LLDB because the Windows implementation
doesn't implement this method:

C:\src\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\ScriptInterpreterPython.cpp(915,19): error: allocating an object of abstract class type 'lldb_private::ConnectionGenericFile'
              new ConnectionGenericFile(read_file, true));
                  ^
C:\src\llvm-project\lldb\include\lldb/Utility/Connection.h(174,28): note: unimplemented pure virtual method 'GetReadObject' in 'ConnectionGenericFile'
  virtual lldb::IOObjectSP GetReadObject() = 0;
                           ^

4 years ago[LLDB] Implement pure virtual method in MockConnection
Jonas Devlieghere [Wed, 13 Nov 2019 23:37:24 +0000 (15:37 -0800)]
[LLDB] Implement pure virtual method in MockConnection

I made GetReadObject pure virtual in the base class and forgot to add
the method to the mock class.

4 years agoSink MachineFunction private method out of line
Reid Kleckner [Wed, 13 Nov 2019 23:33:12 +0000 (15:33 -0800)]
Sink MachineFunction private method out of line

This method is private and only called from this file and doesn't need
to be inline. Saves a TargetMachine.h include in MachineFunction.h, a
popular header. The include was introduced in 98603a8153086 despite the
forward decl of LLVMTargetMachine.

4 years ago[X86] Don't treat mxcsr as a register name when parsing MS inline assembly.
Craig Topper [Wed, 13 Nov 2019 23:20:34 +0000 (15:20 -0800)]
[X86] Don't treat mxcsr as a register name when parsing MS inline assembly.

No instruction takes mxcsr as a an operand so we should always
treat it as an identifier name.

4 years ago[LLDB] Fix another set of -Wdocumentation warnings
Jonas Devlieghere [Wed, 13 Nov 2019 23:11:45 +0000 (15:11 -0800)]
[LLDB] Fix another set of -Wdocumentation warnings

At this point I'm just fixing issues as I see them pop up locally in
incremental builds.

4 years ago[LLDB] Remove dead code from StreamFile
Jonas Devlieghere [Wed, 13 Nov 2019 23:08:51 +0000 (15:08 -0800)]
[LLDB] Remove dead code from StreamFile

4 years ago[RegisterContext] Remove now unneded vestiges.
Davide Italiano [Wed, 13 Nov 2019 22:52:52 +0000 (14:52 -0800)]
[RegisterContext] Remove now unneded vestiges.

4 years ago[LLDB] Fix a bunch of -Wdocumentation warnings in ExpressionParser
Jonas Devlieghere [Wed, 13 Nov 2019 22:40:28 +0000 (14:40 -0800)]
[LLDB] Fix a bunch of -Wdocumentation warnings in ExpressionParser

4 years agoRemove redundant check. (NFC)
Adrian Prantl [Wed, 13 Nov 2019 22:19:01 +0000 (14:19 -0800)]
Remove redundant check. (NFC)

4 years agoUse cheaper, equivalent predicate. (NFC)
Adrian Prantl [Wed, 13 Nov 2019 22:16:11 +0000 (14:16 -0800)]
Use cheaper, equivalent predicate. (NFC)

4 years ago[X86] Don't set the operation action for i16 SINT_TO_FP to Promote just because SSE1...
Craig Topper [Wed, 13 Nov 2019 21:20:00 +0000 (13:20 -0800)]
[X86] Don't set the operation action for i16 SINT_TO_FP to Promote just because SSE1 is enabled.

Instead do custom promotion in the handler so that we can still
allow i16 to be used with fp80. And f64 without sse2.

4 years ago[X86] Fix typo in comment. NFC
Craig Topper [Wed, 13 Nov 2019 20:43:33 +0000 (12:43 -0800)]
[X86] Fix typo in comment. NFC

4 years ago[X86] Move all the FP_TO_XINT/XINT_TO_FP setOperationActions into the same !useSoftFl...
Craig Topper [Wed, 13 Nov 2019 20:37:02 +0000 (12:37 -0800)]
[X86] Move all the FP_TO_XINT/XINT_TO_FP setOperationActions into the same !useSoftFloat block. Qualify all of the Promote actions for these with !useSoftFloat too. NFCI

The Promote action doesn't apply until LegalizeDAG. By the time
we get there, we would have already softened all the FP operations
if useSoftFloat was true. So there wouldn't be any operation left
to Promote.

4 years agoRename clang-module-related *DWO* functions to *ClangModule* (NFC)
Adrian Prantl [Wed, 13 Nov 2019 22:05:10 +0000 (14:05 -0800)]
Rename clang-module-related *DWO* functions to *ClangModule* (NFC)

This avoids confusing them with fission-related functionality.

I also moved two accessor functions from DWARFDIE into static
functions in DWARFASTParserClang were their only use is located.

4 years ago[PGO][PGSO] Temporarily disable the large working set size behavior.
Hiroshi Yamauchi [Wed, 13 Nov 2019 21:49:33 +0000 (13:49 -0800)]
[PGO][PGSO] Temporarily disable the large working set size behavior.

Summary:
This temporarily disables the large working set size behavior in profile guided
size optimization due to internal benchmark regressions.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agolibc++ status page: Fix HTML.
Marek Kurdej [Wed, 13 Nov 2019 21:51:29 +0000 (22:51 +0100)]
libc++ status page: Fix HTML.

4 years ago[SimplifyCFG] add test for select with FMF; NFC
Sanjay Patel [Wed, 13 Nov 2019 21:45:17 +0000 (16:45 -0500)]
[SimplifyCFG] add test for select with FMF; NFC

4 years agoRename ParseTypeFromDWO to ParseTypeFromClangModule (NFC)
Adrian Prantl [Wed, 13 Nov 2019 18:52:30 +0000 (10:52 -0800)]
Rename ParseTypeFromDWO to ParseTypeFromClangModule (NFC)

Because that is what this function really does. The old name is
misleading.

4 years agoRevert "[RISCV] Use compiler-rt if no GCC installation detected"
Richard Smith [Wed, 13 Nov 2019 21:14:07 +0000 (13:14 -0800)]
Revert "[RISCV] Use compiler-rt if no GCC installation detected"

This change causes test failures for builds configured with
-DCLANG_DEFAULT_RTLIB=compiler-rt.

This reverts commit 3289352e6bb9d2949c678c625478024bf2a5fbfb.

4 years ago[SLP] fix miscompile on min/max reductions with extra uses (PR43948)
Sanjay Patel [Wed, 13 Nov 2019 20:41:26 +0000 (15:41 -0500)]
[SLP] fix miscompile on min/max reductions with extra uses (PR43948)

The bug manifests as replacing a reduction operand with an undef
value.

The problem appears to be limited to cases where a min/max reduction
has extra uses of the compare operand to the select.

In the general case, we are tracking "ExternallyUsedValues" and
an "IgnoreList" of the reduction operations, but those may not apply
to the final compare+select in a min/max reduction.

For that, we use replaceAllUsesWith (RAUW) to ensure that the new
vectorized reduction values are transferred to all subsequent users.

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

4 years ago[clang-format] refactor the use of the SMDiagnostics in replacement warnings
mydeveloperday [Wed, 13 Nov 2019 20:54:42 +0000 (20:54 +0000)]
[clang-format] refactor the use of the SMDiagnostics in replacement warnings

Summary:
Review comments in {D69854} recommended a simpler approach of creating the SMDiagnostics to remove much of the complexity. (thanks @thakis)

@vlad.tsyrklevich I've rebuilt on both Windows and Linux (running Linux with Address and Undefined sanitizers) over the clang code base

Reviewers: thakis, klimek, mitchell-stellar, vlad.tsyrklevich

Reviewed By: thakis

Subscribers: cfe-commits, thakis, vlad.tsyrklevich

Tags: #clang-format, #clang

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

4 years ago[LLD] [COFF] Fix automatically importing data symbols from DLLs with LTO
Martin Storsjö [Wed, 13 Nov 2019 07:40:30 +0000 (09:40 +0200)]
[LLD] [COFF] Fix automatically importing data symbols from DLLs with LTO

This broke in 51dcb292cc002, "[lld-link] diagnose undefined symbols
before LTO when possible" (very soon after the 9.0 branch, so
luckily the 9.0 release is unaffected).

The code for loading objects we believe might be needed for autoimport
(loadMinGWAutomaticImports()) does run before the new
reportUnresolvable() function, but it had a condition to only operate
on symbols from regular object files. This condition came from
resolveRemainingUndefines(), but as loadMinGWAutomaticImports() now
has to operate before the LTO, it has to operate on undefineds from
LTO objects as well.

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

4 years agoAdd -disable-builtin option to opt
Dimitry Andric [Wed, 13 Nov 2019 19:15:22 +0000 (20:15 +0100)]
Add -disable-builtin option to opt

Summary:
The option allows to disable specific target library builtin functions,
instead of -disable-simplify-libcalls, which disables all of them.

This is a prerequisite for D70143, which fixes PR43081.

Reviewers: xbolva00, spatel, jdoerfert, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[LLDB] Fix a bunch of -Wdocumentation warnings
Jonas Devlieghere [Wed, 13 Nov 2019 19:35:53 +0000 (11:35 -0800)]
[LLDB] Fix a bunch of -Wdocumentation warnings