Commit Graph

322834 Commits

Author SHA1 Message Date
Simon Pilgrim 603f94aa2a [TargetLowering] SimplifyMultipleUseDemandedBits - add BITCAST pass through support (Reapplied)
This allows us to peek through BITCASTs, attempt to simplify the source operand, and then bitcast back.

This reapplies rL367091 which was reverted at rL367118 - we were inconsistently peeking through the bitcasts to the source value.

Fixes PR42777

llvm-svn: 367174
2019-07-27 14:11:59 +00:00
Sanjay Patel 02b9e45a7e [InstSimplify] remove quadratic time looping (PR42771)
The test case from:
https://bugs.llvm.org/show_bug.cgi?id=42771
...shows a ~30x slowdown caused by the awkward loop iteration (rL207302) that is
seemingly done just to avoid invalidating the instruction iterator. We can instead
delay instruction deletion until we reach the end of the block (or we could delay
until we reach the end of all blocks).

There's a test diff here for a degenerate case with llvm.assume that is not
meaningful in itself, but serves to verify this change in logic.

This change probably doesn't result in much overall compile-time improvement
because we call '-instsimplify' as a standalone pass only once in the standard
-O2 opt pipeline currently.

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

llvm-svn: 367173
2019-07-27 14:05:51 +00:00
Simon Pilgrim 353a848473 [X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDemandedBits handler (Reapplied)
Recommit rL367100 which was reverted at rL367141. Until PR42777 is fixed, we no longer get the benefits of peeking through bitcasts but it does still remove a GetDemandedBits user and gives us the equivalent combines.

llvm-svn: 367172
2019-07-27 13:30:29 +00:00
Simon Pilgrim 8a52671782 [SelectionDAG] Check for any recursion depth greater than or equal to limit instead of just equal the limit.
If anything called the recursive isKnownNeverNaN/computeKnownBits/ComputeNumSignBits/SimplifyDemandedBits/SimplifyMultipleUseDemandedBits with an incorrect depth then we could continue to recurse if we'd already exceeded the depth limit.

This replaces the limit check (Depth == 6) with a (Depth >= 6) to make sure that we don't circumvent it. 

This causes a couple of regressions as a mixture of calls (SimplifyMultipleUseDemandedBits + combineX86ShufflesRecursively) were calling with depths that were already over the limit. I've fixed SimplifyMultipleUseDemandedBits to not do this. combineX86ShufflesRecursively is trickier as we get a lot of regressions if we reduce its own limit from 8 to 6 (it also starts at Depth == 1 instead of Depth == 0 like the others....) - I'll see what I can do in future patches.

llvm-svn: 367171
2019-07-27 12:48:46 +00:00
Alexander Richardson 51bfb84852 [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
2019-07-27 12:30:15 +00:00
Simon Pilgrim 3ff6126487 [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
2019-07-27 12:23:36 +00:00
Simon Atanasyan 6faac434ed [mips] Add (dis)assembler tests for beqzl and bnezl instructions. NFC
llvm-svn: 367168
2019-07-27 08:13:27 +00:00
Nico Weber 1361a4c2d8 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
2019-07-27 02:41:40 +00:00
Petr Hosek 92a2e1bbb9 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
2019-07-27 01:59:23 +00:00
Nico Weber b28ffd8f35 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
2019-07-27 01:13:00 +00:00
Amara Emerson 7bc4fad0fb [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
2019-07-26 23:46:38 +00:00
Jessica Paquette aa8b9993c2 [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
2019-07-26 23:28:53 +00:00
Francis Visoiu Mistrih f5a338369b [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
2019-07-26 22:42:54 +00:00
Francis Visoiu Mistrih ec63dc2c35 [Remarks] Update unit test to use StringRef::lower
llvm-svn: 367161
2019-07-26 22:36:20 +00:00
Florian Hahn d89f6cb299 Revert [IPSCCP] Add assertion to surface cases where we zap returns with overdefined users.
This reverts r366998 (git commit 5354c83ece)

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

llvm-svn: 367160
2019-07-26 22:14:08 +00:00
Reid Kleckner 95ed4c3835 Fix remarks unit test on Windows
"no such file or directory" vs "No such file or directory"

llvm-svn: 367159
2019-07-26 22:10:44 +00:00
Leonard Chan 01ba91e6af [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
2019-07-26 21:19:37 +00:00
Sanjay Patel d20a0fe203 [InstCombine] add tests for fsub with negated operand; NFC
llvm-svn: 367156
2019-07-26 21:12:22 +00:00
Francis Visoiu Mistrih 64a5f9e112 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
2019-07-26 21:02:02 +00:00
Wei Mi 55a68a2400 [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
2019-07-26 20:59:22 +00:00
Jonas Devlieghere fe4b12b4de [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
2019-07-26 20:58:10 +00:00
Jonas Devlieghere d4044aad66 [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
2019-07-26 20:55:07 +00:00
Francis Visoiu Mistrih cdc74e2197 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
2019-07-26 20:54:44 +00:00
Sanjay Patel c0fc24bb8e [CodeGen] fix test that broke with rL367146
This should be fixed properly to not depend on LLVM (so much).

llvm-svn: 367149
2019-07-26 20:36:57 +00:00
Francis Visoiu Mistrih a41f61625a [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
2019-07-26 20:11:53 +00:00
Hubert Tong e3a0fc72d7 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
2019-07-26 20:09:37 +00:00
Sanjay Patel a9ab31558c [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
2019-07-26 19:56:59 +00:00
Sanjay Patel 487e957775 [InstCombine] add tests for fdiv with negated operand; NFC
llvm-svn: 367145
2019-07-26 19:44:53 +00:00
Yuanfang Chen f184ce53a7 [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
2019-07-26 19:25:57 +00:00
Alina Sbirlea deea000c91 [MemorySSA & LoopPassManager] Analysis can be preserved only when all loop passes preserve it.
llvm-svn: 367143
2019-07-26 18:57:26 +00:00
Bob Haarman 6baac18a76 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
2019-07-26 18:44:06 +00:00
Vlad Tsyrklevich 485b8789de 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
2019-07-26 18:14:21 +00:00
Jonas Devlieghere 01f277e2db [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
2019-07-26 18:14:12 +00:00
Jonas Devlieghere 463a48e416 [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
2019-07-26 18:14:08 +00:00
Jonas Devlieghere 7070a0b02a [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
2019-07-26 18:14:04 +00:00
Diego Astiazaran d6cdd98a25 [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
2019-07-26 18:02:42 +00:00
Bob Haarman 51dcb292cc [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
2019-07-26 17:56:45 +00:00
Nathan Huckleberry 2e040398f8 [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
2019-07-26 17:29:35 +00:00
Sean Fertile 9df6177d38 [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
2019-07-26 17:25:27 +00:00
Jim Ingham be4a78af46 Document that LLDB_LOG macros use the format_providers.
Differential Revision: https://reviews.llvm.org/D65293

llvm-svn: 367132
2019-07-26 17:25:20 +00:00
Michael Liao 711556e6a8 [AMDGPU] Fix typo.
llvm-svn: 367131
2019-07-26 17:13:59 +00:00
Sergey Dmitriev cdeaac5dce [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
2019-07-26 17:06:41 +00:00
Jonas Devlieghere 81dab368bf [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
2019-07-26 16:32:49 +00:00
Fangrui Song d6c448244b [ELF] Simplify with dyn_cast_or_null. NFC
llvm-svn: 367126
2019-07-26 16:29:15 +00:00
Jonas Devlieghere ac4a5c15fe [CMake] Print Python version on Windows
Trying to figure out what's causing the Windows bot to fail.

llvm-svn: 367125
2019-07-26 16:15:19 +00:00
Cullen Rhodes 2cde8b5db6 [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
2019-07-26 15:57:50 +00:00
Michal Gorny 40a10446c0 [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
2019-07-26 15:39:05 +00:00
Michal Gorny ffc722a358 [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
2019-07-26 15:38:57 +00:00
Sam McCall 91e8eac73a [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
2019-07-26 15:29:52 +00:00
Marshall Clow 736e8aa8ed Fix a bug in std::chrono::abs where it would fail when the duration's period had not been reduced.s
llvm-svn: 367120
2019-07-26 15:10:46 +00:00