Commit Graph

331322 Commits

Author SHA1 Message Date
Simon Pilgrim d5c4881a56 ManagedStringPool - pre-increment iterator. NFC. 2019-11-07 16:56:16 +00:00
Simon Pilgrim f083240679 X86CondBrFolding - remove non-existent fixBranchProb function. NFC. 2019-11-07 16:56:16 +00:00
Simon Pilgrim bcd7674e06 AsmWriterOperand - fix uninitialized variable warning. NFCI. 2019-11-07 16:56:15 +00:00
diggerlin c63c1a72da Using crtp to refactor the xcoff section header
SUMMARY:
According to https://reviews.llvm.org/D68575#inline-617586, Create a NFC patch for it.

Using crtp to refactor the xcoff section header
Move the define of SectionFlagsReservedMask and SectionFlagsTypeMask from XCOFFDumper.cpp to XCOFFObjectFile.h

Reviewers: hubert.reinterpretcast,jasonliu
Subscribers: rupprecht, seiyai,hiraditya

Differential Revision: https://reviews.llvm.org/D69131
2019-11-07 11:51:34 -05:00
Jan Kratochvil 44f43461c0 [lldb] Comment typo fix 2019-11-07 17:48:25 +01:00
joanlluch 0d3d3822f5 comment shiftamountthreshold 2019-11-07 17:41:05 +01:00
Michał Górny 6f8ee2c575 [openmp] [test] Skip one more test that kills NetBSD buildbot 2019-11-07 17:29:57 +01:00
Alexey Bataev bcf754a321 [OPENMP][DOCS] Update OpenMP status (NFC)
Summary: This is updating the OpenMP status table. Cray has volunteered for `defaultmap` and supporting `in_reduction` on the `target` construct, so the status on those entries from was changed from "unclaimed". Also, a new entry was added for supporting non-contiguous arrays sections on the `target update` directive.

Reviewers: ABataev, hfinkel, jdoerfert, kkwli0

Reviewed By: ABataev

Subscribers: guansong, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69923
2019-11-07 11:07:56 -05:00
Edward Jones 7adab7719e [Sema] Suppress -Wchar-subscripts if the index is a literal char
Assume that the user knows what they're doing if they provide a char
literal as an array index. This more closely matches the behavior of
GCC.

Differential Revision: https://reviews.llvm.org/D58896
2019-11-07 15:45:44 +00:00
Mitch Phillips 343597789e [GWP-ASan] Respect compiler-rt's -fno-lto
https://bugs.llvm.org/show_bug.cgi?id=43722

GWP-ASan didn't include SANITIZER_COMMON_CFLAGS, and thus would produce
LLVM bitcode files, when compiler-rt is generally built without LTO.
2019-11-07 07:43:02 -08:00
Edward Jones dd25880010 [RISCV] Add riscv{32,64} to ALL_CRT_SUPPORTED_ARCH list
This allows crtbegin and crtend to be built, allowing RISC-V
to no longer rely on implementations from libgcc.

Differential revision: https://reviews.llvm.org/D68393
2019-11-07 15:32:52 +00:00
Sanjay Patel 777d1d1d98 [SDAG] reduce code duplication; NFC 2019-11-07 10:28:45 -05:00
Melanie Blower af57dbf12e Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior=
Add options to control floating point behavior: trapping and
    exception behavior, rounding, and control of optimizations that affect
    floating point calculations. More details in UsersManual.rst.

    Reviewers: rjmccall

    Differential Revision: https://reviews.llvm.org/D62731
2019-11-07 07:22:45 -08:00
Edward Jones de61aa3118 [RISCV] Improve sysroot computation if no GCC install detected
If a GCC installed is not detected, the driver would default to
the root of the filesystem. This is not ideal when this doesn't
match the install directory of the toolchain and can cause
undesireable behavior such as picking up system libraries or
the system linker when cross-compiling.

Differential Revision: https://reviews.llvm.org/D68391
2019-11-07 15:17:40 +00:00
Sanjay Patel 2fdd58c506 [SDAG] reduce code duplication; NFC 2019-11-07 10:15:17 -05:00
Sven van Haastregt 3d30f2cff7 [OpenCL] Add geometric and relational builtin functions
Add the geometric and relational builtin functions from the OpenCL C
specification.

Patch by Pierre Gondois and Sven van Haastregt.

Differential Revision: https://reviews.llvm.org/D69908
2019-11-07 15:00:19 +00:00
Sven van Haastregt 0e70c35094 [OpenCL] Add integer builtin functions
This patch adds the integer builtin functions from the OpenCL C
specification.

Patch by Pierre Gondois and Sven van Haastregt.

Differential Revision: https://reviews.llvm.org/D69901
2019-11-07 14:59:33 +00:00
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