platform/upstream/llvm.git
4 years ago[compiler-rt] Fix running tests on macOS when XCode is not installed
Alexander Richardson [Sat, 27 Jul 2019 12:30:15 +0000 (12:30 +0000)]
[compiler-rt] Fix running tests on macOS when XCode is not installed

Summary:
If XCode is not installed, `xcodebuild -version -sdk macosx Path` will give
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
In this case the variable OSX_SYSROOT will be empty and
OSX_SYSROOT_FLAG is set to "-isysroot" (without a path).
This then causes the CompilerRTUnitTestCheckCxx target failed to for me
because "${COMPILER_RT_TEST_COMPILER} ${OSX_SYSROOT_FLAG} -E" expanded to
"clang -isysroot -E". This results in a warning "sysroot -E does not exist"
and the target fails to run because the C++ headers cannot be found.

Reviewers: beanz, kubamracek

Reviewed By: beanz

Subscribers: dberris, mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 367170

4 years ago[TargetLowering] Add depth limit to SimplifyMultipleUseDemandedBits
Simon Pilgrim [Sat, 27 Jul 2019 12:23:36 +0000 (12:23 +0000)]
[TargetLowering] Add depth limit to SimplifyMultipleUseDemandedBits

We're getting reports of massive compile time increases because SimplifyMultipleUseDemandedBits was losing track of the depth and not earlying-out. No repro yet, but consider this a pre-emptive commit.

llvm-svn: 367169

4 years ago[mips] Add (dis)assembler tests for beqzl and bnezl instructions. NFC
Simon Atanasyan [Sat, 27 Jul 2019 08:13:27 +0000 (08:13 +0000)]
[mips] Add (dis)assembler tests for beqzl and bnezl instructions. NFC

llvm-svn: 367168

4 years agoclang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro.
Nico Weber [Sat, 27 Jul 2019 02:41:40 +0000 (02:41 +0000)]
clang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro.

This is like r305666 (which added support for `if constexpr`) except
that it allows a macro name after the if.

This is slightly tricky for two reasons:

1. r305666 didn't add test coverage for all cases where it added a
   kw_constexpr, so I had to figure out what all the added cases were
   for. I now added tests for all `if constexpr` bits that didn't have
   tests. (This took a while, see e.g. https://reviews.llvm.org/D65223)

2. Parsing `if <ident> (` as an if means that `#if defined(` and
   `#if __has_include(` parse as ifs too. Add some special-case code
   to prevent this from happening where it's incorrect.

Fixes PR39248.

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

llvm-svn: 367167

4 years agoRevert "[ARM] Set default alignment to 64bits"
Petr Hosek [Sat, 27 Jul 2019 01:59:23 +0000 (01:59 +0000)]
Revert "[ARM] Set default alignment to 64bits"

This reverts commit r367119.

This broke several bots:

http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/26891/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Aexception-alignment.cpp
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/245/consoleFull

llvm-svn: 367166

4 years agodriver: Don't warn about assembler flags being unused when not assembling; different...
Nico Weber [Sat, 27 Jul 2019 01:13:00 +0000 (01:13 +0000)]
driver: Don't warn about assembler flags being unused when not assembling; different approach

This morally relands r365703 (and r365714), originally reviewed at
https://reviews.llvm.org/D64527, but with a different implementation.

Relanding the same approach with a fix for the revert reason got a bit
involved (see https://reviews.llvm.org/D65108) so use a simpler approach
with a more localized implementation (that in return duplicates code
a bit more).

This approach also doesn't validate flags for the integrated assembler
if the assembler step doesn't run.

Fixes PR42066.

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

llvm-svn: 367165

4 years ago[AArch64][GlobalISel] Implement narrowing of G_SEXT.
Amara Emerson [Fri, 26 Jul 2019 23:46:38 +0000 (23:46 +0000)]
[AArch64][GlobalISel] Implement narrowing of G_SEXT.

We need this to narrow a sext to s128.

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

llvm-svn: 367164

4 years ago[AArch64][GlobalISel] Select @llvm.aarch64.stlxr for 32-bit pointers
Jessica Paquette [Fri, 26 Jul 2019 23:28:53 +0000 (23:28 +0000)]
[AArch64][GlobalISel] Select @llvm.aarch64.stlxr for 32-bit pointers

Add partial instruction selection for intrinsics like this:

```
declare i32 @llvm.aarch64.stlxr(i64, i32*)
```

(This only handles the case where a G_ZEXT is feeding the intrinsic.)

Also make sure that the added store instruction actually has the memory op from
the original G_STORE.

Update select-stlxr-intrin.mir and arm64-ldxr-stxr.ll.

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

llvm-svn: 367163

4 years ago[Remarks] Silence Wreturn-type warning
Francis Visoiu Mistrih [Fri, 26 Jul 2019 22:42:54 +0000 (22:42 +0000)]
[Remarks] Silence Wreturn-type warning

Shows up here: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/27771/steps/annotate/logs/stdio.

llvm-svn: 367162

4 years ago[Remarks] Update unit test to use StringRef::lower
Francis Visoiu Mistrih [Fri, 26 Jul 2019 22:36:20 +0000 (22:36 +0000)]
[Remarks] Update unit test to use StringRef::lower

llvm-svn: 367161

4 years agoRevert [IPSCCP] Add assertion to surface cases where we zap returns with overdefined...
Florian Hahn [Fri, 26 Jul 2019 22:14:08 +0000 (22:14 +0000)]
Revert [IPSCCP] Add assertion to surface cases where we zap returns with overdefined users.

This reverts r366998 (git commit 5354c83ece00690b4dbfa47925f8f5a8f33f1d9e)

This breaks a linux kernel build and we have reproducer to investigate.

llvm-svn: 367160

4 years agoFix remarks unit test on Windows
Reid Kleckner [Fri, 26 Jul 2019 22:10:44 +0000 (22:10 +0000)]
Fix remarks unit test on Windows

"no such file or directory" vs "No such file or directory"

llvm-svn: 367159

4 years ago[NewPM] Run avx*-builtins.c tests under the new pass manager only
Leonard Chan [Fri, 26 Jul 2019 21:19:37 +0000 (21:19 +0000)]
[NewPM] Run avx*-builtins.c tests under the new pass manager only

This patch changes the following tests to run under the new pass manager only:

```
Clang :: CodeGen/avx512-reduceMinMaxIntrin.c (1 of 4)
Clang :: CodeGen/avx512vl-builtins.c (2 of 4)
Clang :: CodeGen/avx512vlbw-builtins.c (3 of 4)
Clang :: CodeGen/avx512f-builtins.c (4 of 4)
```

The new PM added extra bitcasts that weren't checked before. For
reduceMinMaxIntrin.c, the issue was mostly the alloca's being in a different
order. Other changes involved extra bitcasts, and differently ordered loads and
stores, but the logic should still be the same.

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

llvm-svn: 367157

4 years ago[InstCombine] add tests for fsub with negated operand; NFC
Sanjay Patel [Fri, 26 Jul 2019 21:12:22 +0000 (21:12 +0000)]
[InstCombine] add tests for fsub with negated operand; NFC

llvm-svn: 367156

4 years agoReland: [Remarks] Support parsing remark metadata in the YAML remark parser
Francis Visoiu Mistrih [Fri, 26 Jul 2019 21:02:02 +0000 (21:02 +0000)]
Reland: [Remarks] Support parsing remark metadata in the YAML remark parser

This adds support to the yaml remark parser to be able to parse remarks
directly from the metadata.

This supports parsing separate metadata and following the external file
with the associated metadata, and also a standalone file containing
metadata + remarks all together.

Original llvm-svn: 367148
Revert llvm-svn: 367151

This has a fix for gcc builds.

llvm-svn: 367155

4 years ago[JumpThreading] Stop searching predecessor when the current bb is in a
Wei Mi [Fri, 26 Jul 2019 20:59:22 +0000 (20:59 +0000)]
[JumpThreading] Stop searching predecessor when the current bb is in a
unreachable loop.

updatePredecessorProfileMetadata in jumpthreading tries to find the
first dominating predecessor block for a PHI value by searching upwards
the predecessor block chain.

But jumpthreading may see some temporary IR state which contains
unreachable bb not being cleaned up. If an unreachable loop happens to
be on the predecessor block chain, keeping chasing the predecessor
block will run into an infinite loop.

The patch fixes it.

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

llvm-svn: 367154

4 years ago[CMake] Print the correct variables
Jonas Devlieghere [Fri, 26 Jul 2019 20:58:10 +0000 (20:58 +0000)]
[CMake] Print the correct variables

This didn't get updated after we decided to set PYTHON_MAJOR_VERSION and
PYTHON_MINOR_VERSION in find_python_libs_windows, instead of parsing the
variables ourselves.

llvm-svn: 367153

4 years ago[TableGen] Fix stale include paths
Jonas Devlieghere [Fri, 26 Jul 2019 20:55:07 +0000 (20:55 +0000)]
[TableGen] Fix stale include paths

This worked locally because the include files were not regenerated, but
fails when performing a clean build.

llvm-svn: 367152

4 years agoRevert "[Remarks] Support parsing remark metadata in the YAML remark parser"
Francis Visoiu Mistrih [Fri, 26 Jul 2019 20:54:44 +0000 (20:54 +0000)]
Revert "[Remarks] Support parsing remark metadata in the YAML remark parser"

This reverts r367148.

Seems to fail on
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/27768.

llvm-svn: 367151

4 years ago[CodeGen] fix test that broke with rL367146
Sanjay Patel [Fri, 26 Jul 2019 20:36:57 +0000 (20:36 +0000)]
[CodeGen] fix test that broke with rL367146

This should be fixed properly to not depend on LLVM (so much).

llvm-svn: 367149

4 years ago[Remarks] Support parsing remark metadata in the YAML remark parser
Francis Visoiu Mistrih [Fri, 26 Jul 2019 20:11:53 +0000 (20:11 +0000)]
[Remarks] Support parsing remark metadata in the YAML remark parser

This adds support to the yaml remark parser to be able to parse remarks
directly from the metadata.

This supports parsing separate metadata and following the external file
with the associated metadata, and also a standalone file containing
metadata + remarks all together.

llvm-svn: 367148

4 years agoPartially revert rC365414; `ln -n` is not portable
Hubert Tong [Fri, 26 Jul 2019 20:09:37 +0000 (20:09 +0000)]
Partially revert rC365414; `ln -n` is not portable

This restores the use of `rm` instead of the non-portable `ln -n`. Such
use being the status quo for the 12-month period between rC334972 and
rC365414.

llvm-svn: 367147

4 years ago[InstCombine] canonicalize negated operand of fdiv
Sanjay Patel [Fri, 26 Jul 2019 19:56:59 +0000 (19:56 +0000)]
[InstCombine] canonicalize negated operand of fdiv

This is a transform that we use with fmul, so use
it for fdiv too for consistency.

llvm-svn: 367146

4 years ago[InstCombine] add tests for fdiv with negated operand; NFC
Sanjay Patel [Fri, 26 Jul 2019 19:44:53 +0000 (19:44 +0000)]
[InstCombine] add tests for fdiv with negated operand; NFC

llvm-svn: 367145

4 years ago[CMake] Allow LLVM_EXTERNAL_<proj>_SOURCE_DIR to be overridden if it is
Yuanfang Chen [Fri, 26 Jul 2019 19:25:57 +0000 (19:25 +0000)]
[CMake] Allow LLVM_EXTERNAL_<proj>_SOURCE_DIR to be overridden if it is
empty.

This makes adding projects to LLVM_ENABLE_PROJECTS possible.
Also its type should be PATH.

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

Reviewers: beanz, greened, chapuni

Reviewed by: beanz

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

llvm-svn: 367144

4 years ago[MemorySSA & LoopPassManager] Analysis can be preserved only when all loop passes...
Alina Sbirlea [Fri, 26 Jul 2019 18:57:26 +0000 (18:57 +0000)]
[MemorySSA & LoopPassManager] Analysis can be preserved only when all loop passes preserve it.

llvm-svn: 367143

4 years agoadd 'a' to chmod in llvm-lipo executability tests
Bob Haarman [Fri, 26 Jul 2019 18:44:06 +0000 (18:44 +0000)]
add 'a' to chmod in llvm-lipo executability tests

Summary:
When specifying symbolic permissions with + or -, if none of
a/u/g/o are specified, bits set in the umask are not affected.
This caused the llvm-lipo executability tests to fail on some
systems, e.g. having an umask of 027 would cause chmod -x to not
clear the executable bit for others. This change instead
uses chmod a-x, which clears all the executable bits regardless
of umask.

Reviewers: smeenai, hans, anushabasana

Reviewed By: smeenai

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 367142

4 years agoRevert "[X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDem...
Vlad Tsyrklevich [Fri, 26 Jul 2019 18:14:21 +0000 (18:14 +0000)]
Revert "[X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDemandedBits handler."

This reverts r367100, it appears to be causing test failures after
Nico's revert of r367091.

llvm-svn: 367141

4 years ago[TableGen] Move core properties into a separate file (NFC)
Jonas Devlieghere [Fri, 26 Jul 2019 18:14:12 +0000 (18:14 +0000)]
[TableGen] Move core properties into a separate file (NFC)

With the plugins having their own tablgen file, it makes sense to split
off the core properties as well.

llvm-svn: 367140

4 years ago[TableGen] Move target properties into a separate file (NFC)
Jonas Devlieghere [Fri, 26 Jul 2019 18:14:08 +0000 (18:14 +0000)]
[TableGen] Move target properties into a separate file (NFC)

With the plugins having their own tablgen file, it makes sense to split
off the target properties as well.

llvm-svn: 367139

4 years ago[TableGen] Move interpreter properties into a separate file (NFC)
Jonas Devlieghere [Fri, 26 Jul 2019 18:14:04 +0000 (18:14 +0000)]
[TableGen] Move interpreter properties into a separate file (NFC)

With the plugins having their own tablgen file, it makes sense to split
off the interpreter properties as well.

llvm-svn: 367138

4 years ago[clang-format] Fix style of css file paths
Diego Astiazaran [Fri, 26 Jul 2019 18:02:42 +0000 (18:02 +0000)]
[clang-format] Fix style of css file paths

CSS files included in HTML should have a path in posix style, it should
not be different for Windows.

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

llvm-svn: 367137

4 years ago[lld-link] diagnose undefined symbols before LTO when possible
Bob Haarman [Fri, 26 Jul 2019 17:56:45 +0000 (17:56 +0000)]
[lld-link] diagnose undefined symbols before LTO when possible

Summary:
This allows reporting undefined symbols before LTO codegen is
run. Since LTO codegen can take a long time, this improves user
experience by avoiding that time spend if the link is going to
fail with undefined symbols anyway.

Fixes PR32400.

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: mehdi_amini, steven_wu, dexonsmith, mstorsjo, llvm-commits

Tags: #llvm

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

llvm-svn: 367136

4 years ago[Sema] Fix -Wuninitialized for struct assignment from GNU C statement expression
Nathan Huckleberry [Fri, 26 Jul 2019 17:29:35 +0000 (17:29 +0000)]
[Sema] Fix -Wuninitialized for struct assignment from GNU C statement expression

Summary:
Do not automatically report self references of structs in statement expression
as warnings. Instead wait for uninitialized cfg analysis.
https://bugs.llvm.org/show_bug.cgi?id=42604

Reviewers: aaron.ballman, rsmith, nickdesaulniers

Reviewed By: aaron.ballman, nickdesaulniers

Subscribers: nathanchance, cfe-commits

Tags: #clang

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

llvm-svn: 367134

4 years ago[PowerPC][AIX]Add lowering of MCSymbol MachineOperand.
Sean Fertile [Fri, 26 Jul 2019 17:25:27 +0000 (17:25 +0000)]
[PowerPC][AIX]Add lowering of MCSymbol MachineOperand.

Adds machine operand lowering for MCSymbolSDNodes to the PowerPC
backend. This is needed to produce call instructions in assembly for AIX
because the callee operand is a MCSymbolSDNode. The test is XFAIL'ed for
asserts due to a (valid) assertion in PEI that the AIX ABI isn't supported yet.

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

llvm-svn: 367133

4 years agoDocument that LLDB_LOG macros use the format_providers.
Jim Ingham [Fri, 26 Jul 2019 17:25:20 +0000 (17:25 +0000)]
Document that LLDB_LOG macros use the format_providers.

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

llvm-svn: 367132

4 years ago[AMDGPU] Fix typo.
Michael Liao [Fri, 26 Jul 2019 17:13:59 +0000 (17:13 +0000)]
[AMDGPU] Fix typo.

llvm-svn: 367131

4 years ago[llvm-objcopy] Add support for --add-section for COFF
Sergey Dmitriev [Fri, 26 Jul 2019 17:06:41 +0000 (17:06 +0000)]
[llvm-objcopy] Add support for --add-section for COFF

This patch enables support for --add-section=... option for COFF objects.

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

llvm-svn: 367130

4 years ago[CMake] Fix find_python_libs_windows
Jonas Devlieghere [Fri, 26 Jul 2019 16:32:49 +0000 (16:32 +0000)]
[CMake] Fix find_python_libs_windows

Exporting PYTHON_INCLUDE_DIR to the Python scope somehow got lost in my
last change. Add it back again. This should fix the Windows bot!

llvm-svn: 367127

4 years ago[ELF] Simplify with dyn_cast_or_null. NFC
Fangrui Song [Fri, 26 Jul 2019 16:29:15 +0000 (16:29 +0000)]
[ELF] Simplify with dyn_cast_or_null. NFC

llvm-svn: 367126

4 years ago[CMake] Print Python version on Windows
Jonas Devlieghere [Fri, 26 Jul 2019 16:15:19 +0000 (16:15 +0000)]
[CMake] Print Python version on Windows

Trying to figure out what's causing the Windows bot to fail.

llvm-svn: 367125

4 years ago[AArch64][SVE2] Rename bitperm feature to sve2-bitperm
Cullen Rhodes [Fri, 26 Jul 2019 15:57:50 +0000 (15:57 +0000)]
[AArch64][SVE2] Rename bitperm feature to sve2-bitperm

Summary:
The bitperm feature flag is now prefixed with SVE2, as it is for all other SVE2
extensions

Patch by Maciej Gabka.

Reviewers: sdesmalen, rovka, chill, SjoerdMeijer, rengolin

Reviewed By: SjoerdMeijer, rengolin

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

llvm-svn: 367124

4 years ago[llvm] [lit/tests] Replace 'env -u' with more portable construct
Michal Gorny [Fri, 26 Jul 2019 15:39:05 +0000 (15:39 +0000)]
[llvm] [lit/tests] Replace 'env -u' with more portable construct

Set environment variables to empty values rather than attempting
to unset them via 'env -u', in order to fix NetBSD test regression
caused by r366980.  POSIX does not guarantee that env(1) supports '-u'
option, and indeed NetBSD env(1) does not support it.

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

llvm-svn: 367123

4 years ago[llvm] [FileCheck] Use FILECHECK_DUMP_INPUT_ON_FAILURE only when non-empty
Michal Gorny [Fri, 26 Jul 2019 15:38:57 +0000 (15:38 +0000)]
[llvm] [FileCheck] Use FILECHECK_DUMP_INPUT_ON_FAILURE only when non-empty

Enable dumping output only if FILECHECK_DUMP_INPUT_ON_FAILURE is set to
a non-empty value.  This is necessary to support disabling it via
POSIX-compliant env(1) that does not support '-u' argument,
and therefore fix regression caused by r366980.

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

llvm-svn: 367122

4 years ago[clangd] Support extraction of binary "subexpressions" like a + [[b + c]].
Sam McCall [Fri, 26 Jul 2019 15:29:52 +0000 (15:29 +0000)]
[clangd] Support extraction of binary "subexpressions" like a + [[b + c]].

Summary:
These aren't formally subexpressions in C++, in this case + is left-associative.
However informally +, *, etc are usually (mathematically) associative and users
consider these subexpressions.

We detect these and in simple cases support extracting the partial expression.
As well as builtin associative operators, we assume that overloads of them
are associative and support those too.

Reviewers: SureYeaah

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

Tags: #clang

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

llvm-svn: 367121

4 years agoFix a bug in std::chrono::abs where it would fail when the duration's period had...
Marshall Clow [Fri, 26 Jul 2019 15:10:46 +0000 (15:10 +0000)]
Fix a bug in std::chrono::abs where it would fail when the duration's period had not been reduced.s

llvm-svn: 367120

4 years ago[ARM] Set default alignment to 64bits
Simi Pallipurath [Fri, 26 Jul 2019 15:05:19 +0000 (15:05 +0000)]
[ARM] Set default alignment to 64bits

The maximum alignment used by ARM arch
is 64bits, not 128.

This could cause overaligned memory
access for 128 bit neon vector that
have unpredictable behaviour.

This fixes: https://bugs.llvm.org/show_bug.cgi?id=42668

Patch by: Diogo Sampaio(diogo.sampaio@arm.com)

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

Change-Id: I5a62b766491f15dd51e4cfe6625929db897f67e3
llvm-svn: 367119

4 years agoRevert r367091, it caused PR42777.
Nico Weber [Fri, 26 Jul 2019 14:58:42 +0000 (14:58 +0000)]
Revert r367091, it caused PR42777.

llvm-svn: 367118

4 years ago[ELF] Detemplate maybeReportUndefined and copySectionsIntoPartitions
Fangrui Song [Fri, 26 Jul 2019 14:57:53 +0000 (14:57 +0000)]
[ELF] Detemplate maybeReportUndefined and copySectionsIntoPartitions

llvm-svn: 367117

4 years ago[OPENMP]Add support for analysis of reduction variables.
Alexey Bataev [Fri, 26 Jul 2019 14:50:05 +0000 (14:50 +0000)]
[OPENMP]Add support for analysis of reduction variables.

Summary:
Reduction variables are the variables, for which the private copies
must be created in the OpenMP regions. Then they are initialized with
the predefined values depending on the reduction operation. After exit
from the OpenMP region the original variable is updated using the
reduction value and the value of the original reduction variable.

Reviewers: NoQ

Subscribers: guansong, jdoerfert, caomhin, kkwli0, cfe-commits

Tags: #clang

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

llvm-svn: 367116

4 years ago[CMake] Loosen Python version check and ignore patch version
Jonas Devlieghere [Fri, 26 Jul 2019 14:26:33 +0000 (14:26 +0000)]
[CMake] Loosen Python version check and ignore patch version

Some versions of macOS report a different patch version for the system
provided interpreter and libraries.

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

llvm-svn: 367115

4 years ago[ARM][ParallelDSP] Combine structs
Sam Parker [Fri, 26 Jul 2019 14:11:40 +0000 (14:11 +0000)]
[ARM][ParallelDSP] Combine structs

Combine OpChain and BinOpChain structs as OpChain is a base class to
BinOpChain that is never used.

llvm-svn: 367114

4 years ago[Clangd] Disable ExtractVariable for all types of assignments
Shaurya Gupta [Fri, 26 Jul 2019 14:08:27 +0000 (14:08 +0000)]
[Clangd] Disable ExtractVariable for all types of assignments

Reviewers: sammccall, kadircet

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

Tags: #clang

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

llvm-svn: 367113

4 years ago[clangd] Fix background index not triggering on windows due to case mismatch.
Sam McCall [Fri, 26 Jul 2019 14:07:11 +0000 (14:07 +0000)]
[clangd] Fix background index not triggering on windows due to case mismatch.

Summary:
This isn't a general fix to all paths where we assume case-sensitivity, it's
a minimally-invasive fix targeting the llvm 9 branch.

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

Tags: #clang

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

llvm-svn: 367112

4 years ago[PowerPC] Add getCRSaveOffset to improve readability. [NFC]
Sean Fertile [Fri, 26 Jul 2019 14:02:17 +0000 (14:02 +0000)]
[PowerPC] Add getCRSaveOffset to improve readability. [NFC]

In preperation for AIX support in FrameLowering: replace a number of literal
'8' that represent the stack offset of the condition register save area with
a member in PPCFrameLowering.

Patch by Chris Bowler.

llvm-svn: 367111

4 years ago[lldb][NFC] Remove eDiagnosticOriginGo
Raphael Isemann [Fri, 26 Jul 2019 14:00:13 +0000 (14:00 +0000)]
[lldb][NFC] Remove eDiagnosticOriginGo

This enum value is unused as we removed Go support.

llvm-svn: 367110

4 years agogn build: Merge r367043
Nico Weber [Fri, 26 Jul 2019 13:27:19 +0000 (13:27 +0000)]
gn build: Merge r367043

llvm-svn: 367109

4 years agogn build: Merge r366956
Nico Weber [Fri, 26 Jul 2019 13:24:56 +0000 (13:24 +0000)]
gn build: Merge r366956

llvm-svn: 367108

4 years ago[MIPS GlobalISel] Fix check for void return during lowerCall
Petar Avramovic [Fri, 26 Jul 2019 13:19:37 +0000 (13:19 +0000)]
[MIPS GlobalISel] Fix check for void return during lowerCall

Void return used to have unsigned with value 0 for virtual register
but with addition of Register class and changes to arguments to lowerCall
this is no longer valid.
Check for void return by inspecting the Ty field in OrigRet.

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

llvm-svn: 367107

4 years agoDWARF: Improve type safety or range lists parsing
Pavel Labath [Fri, 26 Jul 2019 13:15:28 +0000 (13:15 +0000)]
DWARF: Improve type safety or range lists parsing

Delete the abstract GetOffset function, which is only defined for
rnglists entries. Instead fix up entries which refer to the range list
classes so that one can statically know that he is dealing with the
rnglists section and call the function that way.

llvm-svn: 367106

4 years ago[AMDGPU] Move WQM/WWM intrinsic instruction selection to AMDGPUISelDAGToDAG
Carl Ritson [Fri, 26 Jul 2019 13:11:44 +0000 (13:11 +0000)]
[AMDGPU] Move WQM/WWM intrinsic instruction selection to AMDGPUISelDAGToDAG

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367105

4 years ago[MIPS GlobalISel] Select inttoptr and ptrtoint
Petar Avramovic [Fri, 26 Jul 2019 13:08:06 +0000 (13:08 +0000)]
[MIPS GlobalISel] Select inttoptr and ptrtoint

Select G_INTTOPTR and G_PTRTOINT for MIPS32.

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

llvm-svn: 367104

4 years agoMake the CXXABIs respect the target's default calling convention.
Erich Keane [Fri, 26 Jul 2019 12:36:12 +0000 (12:36 +0000)]
Make the CXXABIs respect the target's default calling convention.

SPIR targets need to have all functions be SPIR calling convention,
however the CXXABIs were just returning CC_C in all non-'this-CC' cases.

https://reviews.llvm.org/D65294

llvm-svn: 367103

4 years ago[lldb] Don't dynamically allocate the posix option validator.
Raphael Isemann [Fri, 26 Jul 2019 11:46:21 +0000 (11:46 +0000)]
[lldb] Don't dynamically allocate the posix option validator.

We dynamically allocate the option validator which means we
can't mark this list of OptionDefinitions as constexpr. It's also
more complicated than necessary.

llvm-svn: 367102

4 years ago[InstCombine] remove flop from lerp patterns
Sanjay Patel [Fri, 26 Jul 2019 11:19:18 +0000 (11:19 +0000)]
[InstCombine] remove flop from lerp patterns

(Y * (1.0 - Z)) + (X * Z) -->
Y - (Y * Z) + (X * Z) -->
Y + Z * (X - Y)

This is part of solving:
https://bugs.llvm.org/show_bug.cgi?id=42716

Factoring eliminates an instruction, so that should be a good canonicalization.
The potential conversion to FMA would be handled by the backend based on target
capabilities.

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

llvm-svn: 367101

4 years ago[X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDemandedBit...
Simon Pilgrim [Fri, 26 Jul 2019 11:10:20 +0000 (11:10 +0000)]
[X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDemandedBits handler.

This removes a GetDemandedBits user and allows us to benefit from the DemandedElts propagated through SimplifyDemandedBits.

llvm-svn: 367100

4 years ago[NFC][ARM][ParallelDSP] Cleanup isNarrowSequence
Sam Parker [Fri, 26 Jul 2019 10:57:42 +0000 (10:57 +0000)]
[NFC][ARM][ParallelDSP] Cleanup isNarrowSequence

Remove unused logic.

llvm-svn: 367099

4 years ago[SelectionDAG] GetDemandedBits - update SIGN_EXTEND_INREG op to just call SimplifyMul...
Simon Pilgrim [Fri, 26 Jul 2019 10:03:07 +0000 (10:03 +0000)]
[SelectionDAG] GetDemandedBits - update SIGN_EXTEND_INREG op to just call SimplifyMultipleUseDemandedBits.

llvm-svn: 367098

4 years ago[AMDGPU] Add llvm.amdgcn.softwqm intrinsic
Carl Ritson [Fri, 26 Jul 2019 09:54:12 +0000 (09:54 +0000)]
[AMDGPU] Add llvm.amdgcn.softwqm intrinsic

Add llvm.amdgcn.softwqm intrinsic which behaves like llvm.amdgcn.wqm
only if there is other WQM computation in the shader.

Reviewers: nhaehnle, tpr

Reviewed By: nhaehnle

Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 367097

4 years ago[TargetLowering] SimplifyMultipleUseDemandedBits - add SIGN_EXTEND_INREG support.
Simon Pilgrim [Fri, 26 Jul 2019 09:41:08 +0000 (09:41 +0000)]
[TargetLowering] SimplifyMultipleUseDemandedBits - add SIGN_EXTEND_INREG support.

llvm-svn: 367096

4 years agoFix some "control reaches end of non-void function" warnings
Pavel Labath [Fri, 26 Jul 2019 09:38:23 +0000 (09:38 +0000)]
Fix some "control reaches end of non-void function" warnings

llvm-svn: 367095

4 years ago[ARM][ParallelDSP] Regenerate multi-use-loads.ll test checks
Simon Pilgrim [Fri, 26 Jul 2019 09:32:21 +0000 (09:32 +0000)]
[ARM][ParallelDSP] Regenerate multi-use-loads.ll test checks

llvm-svn: 367094

4 years ago[AArch64] Define ETE and TRBE system registers
Momchil Velikov [Fri, 26 Jul 2019 09:19:08 +0000 (09:19 +0000)]
[AArch64] Define ETE and TRBE system registers

Embedded Trace Extension and Trace Buffer Extension are optional
future architecture extensions.
(cf. https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools)

Their system registers are documented here:
https://developer.arm.com/docs/ddi0601/a

ETE shares register names with ETM. One exception is the ETE
TRCEXTINSELR0 register, which has the same encoding as the ETM
TRCEXTINSELR register (but different semantics). This patch treats
them as aliases: the assembler will accept both names, emitting
identical encoding, and the disassembler will keep disassembling
to TRCEXRINSELR.

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

llvm-svn: 367093

4 years ago[SelectionDAG] GetDemandedBits - update OR/XOR ops to just call SimplifyMultipleUseDe...
Simon Pilgrim [Fri, 26 Jul 2019 09:13:29 +0000 (09:13 +0000)]
[SelectionDAG] GetDemandedBits - update OR/XOR ops to just call SimplifyMultipleUseDemandedBits.

Eventually all of these will be moved over, but we create nodes in GetDemandedBits recursion at the moment which causes regressions when we try to remove them all.

llvm-svn: 367092

4 years ago[TargetLowering] SimplifyMultipleUseDemandedBits - add BITCAST pass through support.
Simon Pilgrim [Fri, 26 Jul 2019 08:38:39 +0000 (08:38 +0000)]
[TargetLowering] SimplifyMultipleUseDemandedBits - add BITCAST pass through support.

This allows us to peek through BITCASTs and attempt simplify the source operand, and then bitcast back.

llvm-svn: 367091

4 years agoObjectFileELF: Use llvm::JamCRC to refactor CRC32 computation
Fangrui Song [Fri, 26 Jul 2019 08:33:36 +0000 (08:33 +0000)]
ObjectFileELF: Use llvm::JamCRC to refactor CRC32 computation

Reviewed By: labath

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

llvm-svn: 367090

4 years ago[ARM][LowOverheadLoops] Add CPSR defs
Sam Parker [Fri, 26 Jul 2019 08:15:01 +0000 (08:15 +0000)]
[ARM][LowOverheadLoops] Add CPSR defs

Both WhileLoopStart and LoopEnd may get turned into a cmp and br pair,
so add an implicit def to these pseudo instructions in case that WLS
and LE aren't generated.

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

llvm-svn: 367089

4 years ago[WinEH] Allocate space in funclets stack to save XMM CSRs
Pengfei Wang [Fri, 26 Jul 2019 07:33:15 +0000 (07:33 +0000)]
[WinEH] Allocate space in funclets stack to save XMM CSRs

Summary:
This is an alternate approach to D57970.
Currently funclets reuse the same stack slots that are used in the
parent function for saving callee-saved xmm registers. If the parent
function modifies a callee-saved xmm register before an excpetion is
thrown, the catch handler will overwrite the original saved value.

This patch allocates space in funclets stack for saving callee-saved xmm
registers and uses RSP instead RBP to access memory.

Reviewers: andrew.w.kaylor, LuoYuanke, annita.zhang, craig.topper,
RKSimon

Subscribers: rnk, hiraditya, llvm-commits

Tags: #llvm

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

Signed-off-by: pengfei <pengfei.wang@intel.com>
llvm-svn: 367088

4 years ago[Loop Utils] Extend the scope of addStringMetadataToLoop.
Serguei Katkov [Fri, 26 Jul 2019 07:04:34 +0000 (07:04 +0000)]
[Loop Utils] Extend the scope of addStringMetadataToLoop.

To avoid duplicates in loop metadata, if the string to add is
already there, just update the value.

Reviewers: reames, Ashutosh
Reviewed By: reames
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65265

llvm-svn: 367087

4 years agoSymbolVendor: Move Symtab construction into the SymbolFile
Pavel Labath [Fri, 26 Jul 2019 07:03:28 +0000 (07:03 +0000)]
SymbolVendor: Move Symtab construction into the SymbolFile

Summary:
Instead of having SymbolVendor coordinate Symtab construction between
Symbol and Object files, make the SymbolVendor function a passthrough,
and put all of the logic into the SymbolFile.

Reviewers: clayborg, JDevlieghere, jingham, espindola

Subscribers: emaste, mgorny, arichardson, MaskRay, lldb-commits

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

llvm-svn: 367086

4 years ago[Loop Utils] Move utilty addStringMetadataToLoop to LoopUtils.cpp. NFC.
Serguei Katkov [Fri, 26 Jul 2019 06:10:08 +0000 (06:10 +0000)]
[Loop Utils] Move utilty addStringMetadataToLoop to LoopUtils.cpp. NFC.

Just move the utility function to LoopUtils.cpp to re-use it in loop peeling.

Reviewers: reames, Ashutosh
Reviewed By: reames
Subscribers: hiraditya, asbirlea, llvm-commits
Differential Revision: https://reviews.llvm.org/D65264

llvm-svn: 367085

4 years agoFix macOS build after r358716
Yi Kong [Fri, 26 Jul 2019 05:17:14 +0000 (05:17 +0000)]
Fix macOS build after r358716

COPYFILE_CLONE is only defined on newer macOS versions, using it without
check breaks build on systems running legacy OS and toolchain.

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

llvm-svn: 367084

4 years agoSome case eror for: detected memory leaks
Kang Zhang [Fri, 26 Jul 2019 03:25:58 +0000 (03:25 +0000)]
Some case eror for: detected memory leaks

llvm-svn: 367083

4 years agoAMDGPU/GlobalISel: Handle most function return types
Matt Arsenault [Fri, 26 Jul 2019 02:36:05 +0000 (02:36 +0000)]
AMDGPU/GlobalISel: Handle most function return types

handleAssignments gives up pretty easily on structs, and i8 values for
some reason. The other case that doesn't work is when an implicit sret
needs to be inserted if the return size exceeds the number of return
registers.

llvm-svn: 367082

4 years agoGlobalISel: Fold out unmerge to scalars from concat_vector
Matt Arsenault [Fri, 26 Jul 2019 02:22:23 +0000 (02:22 +0000)]
GlobalISel: Fold out unmerge to scalars from concat_vector

Removes illegal intermediate vectors if an operation was lowering to
concat_vectors, and the next operation is scalarized.

llvm-svn: 367081

4 years ago[PowerPC] Do the Simple Early Return in block-placement pass to optimize the blocks
Kang Zhang [Fri, 26 Jul 2019 01:58:53 +0000 (01:58 +0000)]
[PowerPC] Do the Simple Early Return in block-placement pass to optimize the blocks

Summary:
In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
But the `early-ret` pass is before `block-placement`, we don't want to run it again.
This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.

Below is an example
```
BB:                   | BB:
   XOR 3, 3, 4        |   XOR 3, 3, 4
   B TBB              |   B ChainBB
...                   | ...
ChainBB:              | ChainBB:
   B TBB              |   ADD 3, 3, 4
...                   |   BLR
TBB:                  |
   ADD 3, 3, 4        |
   BLR                |
```

Reviewed By: efriedma

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

llvm-svn: 367080

4 years ago[dotest] Remove dead code
Jonas Devlieghere [Fri, 26 Jul 2019 01:58:18 +0000 (01:58 +0000)]
[dotest] Remove dead code

Remove some dead code that I ran into when preparing D65311.

llvm-svn: 367079

4 years agoReland: [Remarks] Add support for serializing metadata for every remark streamer
Francis Visoiu Mistrih [Fri, 26 Jul 2019 01:33:30 +0000 (01:33 +0000)]
Reland: [Remarks] Add support for serializing metadata for every remark streamer

This allows every serializer format to implement metaSerializer() and
return the corresponding meta serializer.

Original llvm-svn: 366946
Reverted llvm-svn: 367004

This fixes the unit tests on Windows bots.

llvm-svn: 367078

4 years ago[Tests] Split inferior crashing tests
Jonas Devlieghere [Fri, 26 Jul 2019 01:00:40 +0000 (01:00 +0000)]
[Tests] Split inferior crashing tests

We noticed that TestInferiorCrashing.py and TestRecursiveInferior.py are
the second and third slowest tests in the test suite. Splitting them up
allows lit to schedule them more effectively.

llvm-svn: 367077

4 years agoRevert "[Sema] Diagnose default-initialization, destruction, and copying of"
Akira Hatanaka [Fri, 26 Jul 2019 00:02:17 +0000 (00:02 +0000)]
Revert "[Sema] Diagnose default-initialization, destruction, and copying of"

This reverts commit r365985.

Prior to r365985, clang used to mark C union fields that have
non-trivial ObjC ownership qualifiers as unavailable if the union was
declared in a system header. r365985 stopped doing so, which caused the
swift compiler to crash when it tried to import a non-trivial union.

I have a patch that fixes the crash (https://reviews.llvm.org/D65256),
but I'm temporarily reverting the original patch until we can decide on
whether it's taking the right approach.

llvm-svn: 367076

4 years ago[AArch64][GlobalISel] Simplify zext/sext selection, use MachineIRBuilder. NFC.
Amara Emerson [Fri, 26 Jul 2019 00:01:09 +0000 (00:01 +0000)]
[AArch64][GlobalISel] Simplify zext/sext selection, use MachineIRBuilder. NFC.

llvm-svn: 367075

4 years ago[clang-doc] Fix failing tests on Windows
Diego Astiazaran [Thu, 25 Jul 2019 23:22:55 +0000 (23:22 +0000)]
[clang-doc] Fix failing tests on Windows

Tests on Windows were failing due to path separator differences.
'/' was being used as separator in the expected output, paths in expected output are now changed to their native form before comparing them to the actual output.

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

llvm-svn: 367074

4 years ago[CMake] Add TableGen dependency to lldbInterpreter.
Jonas Devlieghere [Thu, 25 Jul 2019 22:56:59 +0000 (22:56 +0000)]
[CMake] Add TableGen dependency to lldbInterpreter.

lldbInterpreter depends on LLDBPropertiesGen and LLDBPropertiesEnumGen.

llvm-svn: 367073

4 years ago[clang-doc] Add option for user provided stylesheets
Diego Astiazaran [Thu, 25 Jul 2019 22:46:40 +0000 (22:46 +0000)]
[clang-doc] Add option for user provided stylesheets

An option has been added to clang-doc to provide a list of css stylesheets that the user wants to use for the generated html docs.

Depends on D64539.

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

llvm-svn: 367072

4 years ago[clang-tidy] Add a module for the Linux kernel.
Tom Roeder [Thu, 25 Jul 2019 22:32:50 +0000 (22:32 +0000)]
[clang-tidy] Add a module for the Linux kernel.

Summary:
Now that clang is going to be able to build the Linux kernel again on
x86, and we have gen_compile_commands.py upstream for generating
compile_commands.json, clang-tidy can be used on the Linux kernel
source.

To that end, this commit adds a new clang-tidy module to be used for
checks specific to Linux kernel source. The Linux kernel follows its own
style of C, and it will be useful to separate those checks into their
own module.

This also adds an initial check that makes sure that return values from
the kernel error functions like PTR_ERR and ERR_PTR are checked. It also
makes sure that any functions that directly return values from these
functions are checked.

Subscribers: xazax.hun, gribozavr, Eugene.Zelenko, lebedev.ri, mgorny, jdoerfert, cfe-commits

Tags: #clang, #clang-tools-extra

Reviewers: aaron.ballman, alexfh, hokein, JonasToth

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

llvm-svn: 367071

4 years ago[openmp] Workaround bug in old Android pthread_attr_setstacksize
Yi Kong [Thu, 25 Jul 2019 22:29:55 +0000 (22:29 +0000)]
[openmp] Workaround bug in old Android pthread_attr_setstacksize

Round the stack size to a multiple of the page size. Older versions of
Android (until KitKat) would fail pthread_attr_setstacksize with
EINVAL if the stack size was not a multiple of the page size.

Patch by Dan Albert <danalbert@google.com>.

Test: Build, copied into the NDK, passed openmp test on ICS.
Bug: https://github.com/android-ndk/ndk/issues/9
llvm-svn: 367070

4 years ago[InstCombine] add tests for lerp patterns (PR42716); NFC
Sanjay Patel [Thu, 25 Jul 2019 22:25:21 +0000 (22:25 +0000)]
[InstCombine] add tests for lerp patterns (PR42716); NFC

llvm-svn: 367069

4 years ago[CodeGen] Don't resolve the stack protector frame accesses until PEI
Francis Visoiu Mistrih [Thu, 25 Jul 2019 22:23:48 +0000 (22:23 +0000)]
[CodeGen] Don't resolve the stack protector frame accesses until PEI

Currently, stack protector loads and stores are resolved during
LocalStackSlotAllocation (if the pass needs to run). When this is the
case, the base register assigned to the frame access is going to be one
of the vregs created during LocalStackSlotAllocation. This means that we
are keeping a pointer to the stack protector slot, and we're using this
pointer to load and store to it.

In case register pressure goes up, we may end up spilling this pointer
to the stack, which can be a security concern.

Instead, leave it to PEI to resolve the frame accesses. In order to do
that, we make all stack protector accesses go through frame index
operands, then PEI will resolve this using an offset from sp/fp/bp.

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

llvm-svn: 367068

4 years ago[Sema] add -Walloca to flag uses of `alloca`
George Burgess IV [Thu, 25 Jul 2019 22:23:40 +0000 (22:23 +0000)]
[Sema] add -Walloca to flag uses of `alloca`

This CL adds an optional warning to diagnose uses of the
`__builtin_alloca` family of functions. The use of these functions is
discouraged by many, so it seems like a good idea to allow clang to warn
about it.

Patch by Elaina Guan!

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

llvm-svn: 367067

4 years ago[Docs] Remove reproducers from the project page.
Jonas Devlieghere [Thu, 25 Jul 2019 22:22:43 +0000 (22:22 +0000)]
[Docs] Remove reproducers from the project page.

Jim pointed out that this was still open on the website.

llvm-svn: 367066