Commit Graph

331355 Commits

Author SHA1 Message Date
Raphael Isemann 87bc320b51 [lldb] Add -m option to 'target modules dump symtab' to disable demangling
Summary: This option was added downstream in swift-lldb. This upstreams this option as it seems useful and also adds the missing tests.

Reviewers: #lldb, kwk, labath

Reviewed By: kwk, labath

Subscribers: labath, kwk, abidh, JDevlieghere, lldb-commits

Tags: #lldb, #upstreaming_lldb_s_downstream_patches

Differential Revision: https://reviews.llvm.org/D69944
2019-11-07 15:47:01 +01:00
Simon Pilgrim e58985a5ec SampleProfWriter - fix uninitialized variable warnings. NFCI. 2019-11-07 14:18:44 +00:00
Tim Northover 10e0d64337 CodeGen: set correct result for atomic compound expressions
Atomic compound expressions try to use atomicrmw if possible, but this
path doesn't set the Result variable, leaving it to crash in later code
if anything ever tries to use the result of the expression. This fixes
that issue by recalculating the new value based on the old one
atomically loaded.
2019-11-07 13:36:44 +00:00
Louis Dionne 0ec6a4882e [libc++] Fix potential OOB in poisson_distribution
See details in the original Chromium bug report:
    https://bugs.chromium.org/p/chromium/issues/detail?id=994957
2019-11-07 13:29:40 +00:00
Roman Lebedev 69ce2ae990
[ConstantRange][LVI] Use overflow flags from `sub` to constrain the range
Summary:
This notably improves non-negativity deduction:
```
| statistic                              |     old |     new | delta | % change |
| correlated-value-propagation.NumAShrs  |     209 |     227 |    18 |  8.6124% |
| correlated-value-propagation.NumAddNSW |    4972 |    4988 |    16 |  0.3218% |
| correlated-value-propagation.NumAddNUW |    7141 |    7148 |     7 |  0.0980% |
| correlated-value-propagation.NumAddNW  |   12113 |   12136 |    23 |  0.1899% |
| correlated-value-propagation.NumAnd    |     442 |     445 |     3 |  0.6787% |
| correlated-value-propagation.NumNSW    |    7160 |    7176 |    16 |  0.2235% |
| correlated-value-propagation.NumNUW    |   13306 |   13316 |    10 |  0.0752% |
| correlated-value-propagation.NumNW     |   20466 |   20492 |    26 |  0.1270% |
| correlated-value-propagation.NumSDivs  |     207 |     212 |     5 |  2.4155% |
| correlated-value-propagation.NumSExt   |    6279 |    6679 |   400 |  6.3704% |
| correlated-value-propagation.NumSRems  |      28 |      29 |     1 |  3.5714% |
| correlated-value-propagation.NumShlNUW |    2793 |    2796 |     3 |  0.1074% |
| correlated-value-propagation.NumShlNW  |    3964 |    3967 |     3 |  0.0757% |
| correlated-value-propagation.NumUDivs  |     353 |     358 |     5 |  1.4164% |
| instcount.NumAShrInst                  |   13763 |   13741 |   -22 | -0.1598% |
| instcount.NumAddInst                   |  277349 |  277348 |    -1 | -0.0004% |
| instcount.NumLShrInst                  |   27437 |   27463 |    26 |  0.0948% |
| instcount.NumOrInst                    |  102677 |  102678 |     1 |  0.0010% |
| instcount.NumSDivInst                  |    8732 |    8727 |    -5 | -0.0573% |
| instcount.NumSExtInst                  |   80872 |   80468 |  -404 | -0.4996% |
| instcount.NumSRemInst                  |    1679 |    1678 |    -1 | -0.0596% |
| instcount.NumTruncInst                 |   62154 |   62153 |    -1 | -0.0016% |
| instcount.NumUDivInst                  |    2526 |    2527 |     1 |  0.0396% |
| instcount.NumURemInst                  |    1589 |    1590 |     1 |  0.0629% |
| instcount.NumZExtInst                  |   69405 |   69809 |   404 |  0.5821% |
| instcount.TotalInsts                   | 7439575 | 7439574 |    -1 |  0.0000% |
```

Reviewers: nikic, reames, spatel

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69942
2019-11-07 16:18:03 +03:00
Sven van Haastregt 6fc73f6366 [OpenCL] Add math and common builtin functions
Add the remaining math and common builtin functions from the OpenCL C
specification.

Patch by Pierre Gondois and Sven van Haastregt.

Differential Revision: https://reviews.llvm.org/D69883
2019-11-07 13:16:04 +00:00
Louis Dionne 83901cbe5e [libc++] Fixed copy/copy_n/copy_backward for compilers that do not support is_constant_evaluated.
Differential Revision: https://reviews.llvm.org/D69940
2019-11-07 12:39:10 +00:00
Louis Dionne e9612e9e85 [libc++] Fix some constexpr tests broken by D68837
This doesn't fix all the issues with D68837
2019-11-07 12:29:17 +00:00
evgeny dde589389f [ThinLTO] Import readonly vars with refs
Patch allows importing declarations of functions and variables, referenced
by the initializer of some other readonly variable.
Differential revision: https://reviews.llvm.org/D69561
2019-11-07 15:13:35 +03:00
Sanjay Patel 7ff57705ba [SLP] allow forming 2-way reduction patterns
We have a vector compare reduction problem seen in PR39665 comment 2:
https://bugs.llvm.org/show_bug.cgi?id=39665#c2

Or slightly reduced here:

define i1 @cmp2(<2 x double> %a0) {
  %a = fcmp ogt <2 x double> %a0, <double 1.0, double 1.0>
  %b = extractelement <2 x i1> %a, i32 0
  %c = extractelement <2 x i1> %a, i32 1
  %d = and i1 %b, %c
  ret i1 %d
}

SLP would not attempt to turn this into a vector reduction because there is an
artificial lower limit on that transform. We can not completely remove that limit
without inducing regressions though, so this patch just hacks an extra attempt at
creating a 2-way reduction to the end of the analysis.

As shown in the test file, we are still not getting some of the motivating cases,
so follow-on patches will be needed to solve those cases.

Differential Revision: https://reviews.llvm.org/D59710
2019-11-07 06:08:42 -05:00
Roman Lebedev 55b445150d
[NFC][CVP] Add some tests for `sub` with preexisting no-wrap flags
We can use those to further limit the ranges in LVI.
2019-11-07 13:59:51 +03:00
Simon Atanasyan a751f557d8 [mips] Set macros for Octeon+ CPU 2019-11-07 13:58:51 +03:00
Simon Atanasyan 3552d3e0f7 [mips] Add `octeon+` to the list of CPUs accepted by the driver 2019-11-07 13:58:50 +03:00
Simon Atanasyan bf996f761b [mips] Write `AFL_EXT_OCTEONP` flag to the `.MIPS.abiflags` section
Differential Revision: https://reviews.llvm.org/D69851
2019-11-07 13:58:50 +03:00
Simon Atanasyan 3718102d40 [mips] Support `octeon+` CPU in the `.set arch=` directive
Differential Revision: https://reviews.llvm.org/D69850
2019-11-07 13:58:50 +03:00
Simon Atanasyan 7bed381eae [mips] Implement Octeon+ `saa` and `saad` instructions
`saa` and `saad` are 32-bit and 64-bit store atomic add instructions.

   memory[base] = memory[base] + rt

These instructions are available for "Octeon+" CPU. The patch adds support
for both instructions to MIPS assembler and diassembler and introduces new
CPU type - "octeon+".

Next patches will implement `.set arch=octeon+` directive and `AFL_EXT_OCTEONP`
ISA extension flag support.

Differential Revision: https://reviews.llvm.org/D69849
2019-11-07 13:58:50 +03:00
Hans Wennborg eaff300401 Revert f0c2a5a "[LV] Generalize conditions for sinking instrs for first order recurrences."
It broke Chromium, causing "Instruction does not dominate all uses!" errors.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1022297#c1 for a
reproducer.

> If the recurrence PHI node has a single user, we can sink any
> instruction without side effects, given that all users are dominated by
> the instruction computing the incoming value of the next iteration
> ('Previous'). We can sink instructions that may cause traps, because
> that only causes the trap to occur later, but not on any new paths.
>
> With the relaxed check, we also have to make sure that we do not have a
> direct cycle (meaning PHI user == 'Previous), which indicates a
> reduction relation, which potentially gets missed by
> ReductionDescriptor.
>
> As follow-ups, we can also sink stores, iff they do not alias with
> other instructions we move them across and we could also support sinking
> chains of instructions and multiple users of the PHI.
>
> Fixes PR43398.
>
> Reviewers: hsaito, dcaballe, Ayal, rengolin
>
> Reviewed By: Ayal
>
> Differential Revision: https://reviews.llvm.org/D69228
2019-11-07 11:00:02 +01:00
Haojian Wu c5e4cf40ac [clangd] NFC, hide the internal-only utility function lex.
To avoid any potential ODR violations.
2019-11-07 10:58:09 +01:00
Guilherme Andrade b1b70f6761 [lldb-server] Add setting to force 'g' packet use
Following up on https://reviews.llvm.org/D62221, this change introduces
the settings plugin.process.gdb-remote.use-g-packet-for-reading.  When
they are on, 'g' packets are used for reading registers.

Using 'g' packets can improve performance by reducing the number of
packets exchanged between client and server when a large number of
registers needs to be fetched.

Differential revision: https://reviews.llvm.org/D62931
2019-11-07 10:48:54 +01:00
Haojian Wu 118f7836a6 [clang-rename] Respect the traversal scope when traversing the entire AST.
Summary:
This should be NFC to clang-rename, by default the traversal scope is
TUDecl. Traversing the TUDecl in clangd is a performance cliff, we should
avoid it.

Reviewers: ilya-biryukov

Subscribers: kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69892
2019-11-07 10:43:54 +01:00
Hans Wennborg 5b9a072c39 Revert a5c8ec4 "[CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood"
This caused Chromium builds to fail with "inlinable function call in a function
with debug info must have a !dbg location" errors. See
https://bugs.chromium.org/p/chromium/issues/detail?id=1022296#c1 for a
reproducer.

> Currently, clang emits subprograms for declared functions when the
> target debugger or DWARF standard is known to support entry values
> (DW_OP_entry_value & the GNU equivalent).
>
> Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU
> tail calls.
>
> Pre-patch debug session with a cross-TU tail call:
>
> ```
>   * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
>     frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt]
> ```
>
> Post-patch (note that the tail-calling frame, "helper", is visible):
>
> ```
>   * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
>     frame #1: 0x0000000100000f80 main`helper [opt] [artificial]
>     frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt]
> ```
>
> rdar://46577651
>
> Differential Revision: https://reviews.llvm.org/D69743
2019-11-07 10:30:07 +01:00
Ilya Biryukov dec8d8d3f2 [clangd] Add unit tests for comments in system headers 2019-11-07 10:24:27 +01:00
Anders Waldenborg 86825dbe33 [clang-format] Make '.clang-format' variants finding a loop (NFC)
This simplifies logic making it trivial to add searching for other
files later.

Differential revision: https://reviews.llvm.org/D68568
2019-11-07 10:00:04 +01:00
Ilya Biryukov 0019684900 [clangd] Set RetainCommentsFromSystemHeaders to true
clangd should retain comments from system headers.

fixes https://github.com/clangd/clangd/issues/96

Patch by lh123!

Differential revision: https://reviews.llvm.org/D69928
2019-11-07 09:54:20 +01:00
dfukalov 6e8251046b [AMDGPU] Fix bug introduced in 47a5c36b37
Summary: [AMDGPU] Fix bug introduced in 47a5c36b37

Reviewers: foad, arsenm

Reviewed By: arsenm

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69915
2019-11-07 11:50:14 +03:00
Ilya Biryukov 96065cf79f [Syntax] Silence "unused function" warning in no-assert builds. NFC
A helper `isImpicitExpr` is only used inside assert.
2019-11-07 09:37:25 +01:00
Georgii Rymar c44a9b538d [llvm-readobj] - Simplify elf-hash-symbols.test. NFCI.
It converts binary contents of .hash and .gnu.hash that were generated by a linker
to YAML descriptions.
I've also dropped Shift2 and BloomFilter values because they are not needed here.

Differential revision: https://reviews.llvm.org/D69881
2019-11-07 10:32:37 +03:00
Craig Topper 17eb12fa6d [X86] Remove unused variable. NFC 2019-11-06 22:53:48 -08:00
Craig Topper 1c8460d6e1 [X86] Remove dead code from combineStore.
Leftovers from before we switched to widening legalization.

Fixes PR43919.
2019-11-06 22:24:47 -08:00
kristina 79c89033fd [Clang] Add ENABLE_LINKER_BUILD_ID to Hurd driver.
This was added for Linux toolchains in rC271692, this
patch extends this to the Hurd toolchain.

Patch by sthibaul (Samuel Thibault)

Differential Revision: https://reviews.llvm.org/D69754
2019-11-07 06:10:14 +00:00
Eric Christopher 009e032634 Temporarily Revert "[LV] Apply sink-after & interleave-groups as VPlan transformations (NFC)"
as it's causing assert failures.

This reverts commit 100e797adb.
2019-11-06 21:58:28 -08:00
Kelvin Li 9f10cc2d12 [OPENMP] [DOCS] fix section formatting issues [NFC]
Differential Revision: https://reviews.llvm.org/D69909
2019-11-06 22:03:09 -05:00
Wenlei He ba1dfae054 Keep import function list for inlinee profile update
Summary:
When adjusting function entry counts after inlining, Funciton::setEntryCount is called without providing an import function list. The side effect of that is the previously set import function list will be dropped. The import function list is used by ThinLTO to help import hot cross module callee for LTO inlining, so dropping that during ThinLTO pre-link may adversely affect LTO inlining. The fix is to keep the list while updating entry counts for inlining.

Reviewers: wmi, davidxl, tejohnson

Subscribers: mehdi_amini, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69736
2019-11-06 18:36:00 -08:00
Danilo Carvalho Grael e55b536d7d [AArch64][SVE] Add remaining patterns and intrinsics for add/sub/mad patterns
Add pattern matching and intrinsics for the following instructions:

predicated orr, eor, and, bic
predicated mul, smulh, umulh, sdiv, udiv, sdivr, udivr
predicated smax, umax, smin, umin, sabd, uabd
mad, msb, mla, mls

https://reviews.llvm.org/D69588
2019-11-06 21:11:43 -05:00
Nico Weber fe6fee9445 Revert "gn build: (manually) merge b5913e6d2f"
This reverts commit c52efdc52c,
because b5913e6d2f got reverted.
2019-11-06 20:52:29 -05:00
Alexander Shaposhnikov 7d83c29890 Revert "Introduce llvm-install-name-tool"
This reverts commit b5913e6d2f.
2019-11-06 17:04:04 -08:00
Matt Arsenault e16a71382d AMDGPU: Select global atomicrmw fadd
This only works if there is no use of the return value.
2019-11-06 16:06:38 -08:00
Matt Arsenault 9f9f42dbc5 TableGen: Remove assert that pattern results match input number
AMDGPU has some atomic instructions that do not return the previous
result, and can only be selected if there are no uses. The source
pattern will only match if the use is empty, so it should be safe to
discard the result.
2019-11-06 16:06:37 -08:00
Eric Christopher e511c4b0df Temporarily Revert:
"[SLP] Generalization of stores vectorization."
 "[SLP] Fix -Wunused-variable. NFC"
 "[SLP] Vectorize jumbled stores."

As they're causing significant (10-30x) compile time regressions on
vectorizable code.

The primary cause of the compile-time regression is f228b53716.

This reverts commits:

f228b53716
5503455ccb
21d498c9c0
2019-11-06 16:06:15 -08:00
shafik e18f4db208 [LLDB] Adding caching to libc++ std::function formatter for lookups that require scanning symbols
Performance issues lead to the libc++ std::function formatter to be disabled.
This change is the first of two changes that should address the performance issues and allow us to enable the formatter again.
In some cases we end up scanning the symbol table for the callable wrapped by std::function for those cases we will now cache the results and used the cache in subsequent look-ups. This still leaves a large cost for the initial lookup which will be addressed in the next change.

Differential Revision: https://reviews.llvm.org/D67111
2019-11-06 16:02:56 -08:00
Stanislav Mekhanoshin d17bcf2bb9 [AMDGPU] Add handling of 160 bit registers in analyzeResourceUsage
This was omitted. Also SReg_96Reg missed IsSGPR assignment.

Differential Revision: https://reviews.llvm.org/D69919
2019-11-06 15:47:32 -08:00
Saleem Abdulrasool e74e61ff29 unwind: restore the LINKER_LANGUAGE
Have CMake treat the unwind libraries as C libraries rather than C++.
There is no C++ runtime dependency at runtime.  This ensures that we do
not accidentally end up with a link against the C++ runtime.

We need to explicitly reset the implicitly linked libraries for C++ to
ensure that we do not have CMake force the link against the C++ runtime.
This adjustment should enable the NetBSD bots to be happy with this
change.
2019-11-06 15:42:09 -08:00
Saleem Abdulrasool aa582e3648 unwind: reflow some of the build rules (NFC)
Reflow the CMake properties to take less vertical space.  This just
makes it easier to read.  NFC.
2019-11-06 15:42:09 -08:00
Philip Reames 8748be7750 [LoopPred] Enable new transformation by default
The basic idea of the transform is to convert variant loop exit conditions into invariant exit conditions by changing the iteration on which the exit is taken when we know that the trip count is unobservable.  See the original patch which introduced the code for a more complete explanation.

The individual parts of this have been reviewed, the result has been fuzzed, and then further analyzed by hand, but despite all of that, I will not be suprised to see breakage here.  If you see problems, please don't hesitate to revert - though please do provide a test case.  The most likely class of issues are latent SCEV bugs and without a reduced test case, I'll be essentially stuck on reducing them.

(Note: A bunch of tests were opted out of the new transform to preserve coverage.  That landed in a previous commit to simplify revert cycles if they turn out to be needed.)
2019-11-06 15:41:57 -08:00
Philip Reames 20cbb6cdf8 [LoopPred] Selectively disable to preserve test cases
I'm about to enable the new loop predication transform by default.  It has the effect of completely destroying many read only loops - which happen to be a super common idiom in our test cases.  So as to preserve test coverage of other transforms, disable the new transform where it would cause sharp test coverage regressions.

(This is semantically part of the enabling commit.  It's committed separate to ease revert if the actual flag flip gets reverted.)
2019-11-06 15:41:57 -08:00
Nico Weber c52efdc52c gn build: (manually) merge b5913e6d2f 2019-11-06 18:26:56 -05:00
Eric Christopher 8d694a45ab When lowering calls and tail calls in AArch64, the register mask and
return value location depends on the calling convention of the callee.
`F.getCallingConv()`, however, is the caller CC. Correct it to the
callee CC from `CallLoweringInfo`.

Fixes PR43449

Patch by Shu-Chun Weng!
2019-11-06 15:25:10 -08:00
Jonas Devlieghere 703c97be24 [lldb] Mark ASan & TSan as test dependencies
Without asan and tsan as test dependencies, you might end up with a
clang that points to sanitizer runtime library that hasn't been build
yet.
2019-11-06 15:24:49 -08:00
Alex Langford a6b5daa701 [test] Fix apple_simulator_test decorator when simulators are unavailable
In the case where xcodebuild fails as you set up simulator tests, you
would fail because `feature` is never defined.
2019-11-06 15:14:01 -08:00
Jonas Devlieghere cfca0056f0 [lldb] Remove dead code from STLUtils.h 2019-11-06 15:06:29 -08:00