Commit Graph

310316 Commits

Author SHA1 Message Date
Jonathan Peyton 7d2cfa1fd5 [OpenMP] Remove XFAIL for cancellation tests using gcc
llvm-svn: 354370
2019-02-19 19:00:29 +00:00
Jonathan Peyton 154ac075cd [OpenMP 5.0] Add omp_get_supported_active_levels()
This patch adds the new 5.0 API function omp_get_supported_active_levels().

Patch by Terry Wilmarth

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

llvm-svn: 354368
2019-02-19 18:51:11 +00:00
Jonathan Peyton 4fe5271fa0 [OpenMP] Adding GOMP compatible cancellation
Remove fatal error messages from the cancellation API for GOMP
Add __kmp_barrier_gomp_cancel() to implement cancellation of parallel regions.
This new function uses the linear barrier algorithm with a cancellable
nonsleepable wait loop.

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

llvm-svn: 354367
2019-02-19 18:47:57 +00:00
Kostya Serebryany 6bde702ac9 [sanitizer] fix a memory safety bug (!!!) in sanitizer suppressions code, discovered by Aaron Jacobs
llvm-svn: 354366
2019-02-19 18:43:24 +00:00
Daniel Sanders e1414d1760 Annotate timeline in Instruments with passes and other timed regions.
Summary:
Instruments is a useful tool for finding performance issues in LLVM but it can
be difficult to identify regions of interest on the timeline that we can use
to filter the profiler or allocations instrument. Xcode 10 and the latest
macOS/iOS/etc. added support for the os_signpost() API which allows us to
annotate the timeline with information that's meaningful to LLVM.

This patch causes timer start and end events to emit signposts. When used with
-time-passes, this causes the passes to be annotated on the Instruments timeline.
In addition to visually showing the duration of passes on the timeline, it also
allows us to filter the profile and allocations instrument down to an individual
pass allowing us to find the issues within that pass without being drowned out
by the noise from other parts of the compiler.

Using this in conjunction with the Time Profiler (in high frequency mode) and
the Allocations instrument is how I found the SparseBitVector that should have
been a BitVector and the DenseMap that could be replaced by a sorted vector a
couple months ago. I added NamedRegionTimers to TableGen and used the resulting
annotations to identify the slow portions of the Register Info Emitter. Some of
these were placed according to educated guesses while others were placed
according to hot functions from a previous profile. From there I filtered the
profile to a slow portion and the aforementioned issues stood out in the
profile.

To use this feature enable LLVM_SUPPORT_XCODE_SIGNPOSTS in CMake and run the
compiler under Instruments with -time-passes like so:
  instruments -t 'Time Profiler' bin/llc -time-passes -o - input.ll'
Then open the resulting trace in Instruments.

There was a talk at WWDC 2018 that explained the feature which can be found at
https://developer.apple.com/videos/play/wwdc2018/405/ if you'd like to know
more about it.

Reviewers: bogner

Reviewed By: bogner

Subscribers: jdoerfert, mgorny, kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 354365
2019-02-19 18:18:31 +00:00
Jordan Rupprecht d138b1266a [libObject][NFC] Use sys::path::convert_to_slash.
Summary: As suggested in rL353995

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 354364
2019-02-19 18:14:44 +00:00
Simon Pilgrim 0b3b9424ca [X86][SSE] Generalize X86ISD::BLENDI support to more value types
D42042 introduced the ability for the ExecutionDomainFixPass to more easily change between BLENDPD/BLENDPS/PBLENDW as the domains required.

With this ability, we can avoid most bitcasts/scaling in the DAG that was occurring with X86ISD::BLENDI lowering/combining, blend with the vXi32/vXi64 vectors directly and use isel patterns to lower to the float vector equivalent vectors.

This helps the shuffle combining and SimplifyDemandedVectorElts be more aggressive as we lose track of fewer UNDEF elements than when we go up/down through bitcasts.

I've introduced a basic blend(bitcast(x),bitcast(y)) -> bitcast(blend(x,y)) fold, there are more generalizations I can do there (e.g. widening/scaling and handling the tricky v16i16 repeated mask case).

The vector-reduce-smin/smax regressions will be fixed in a future improvement to SimplifyDemandedBits to peek through bitcasts and support X86ISD::BLENDV.

Reapplied after reversion at rL353699 - AVX2 isel fix was applied at rL354358, additional test at rL354360/rL354361

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

llvm-svn: 354363
2019-02-19 18:05:42 +00:00
Serge Guelton 3d13ed978a [NFC] Remove unused headers in Optional.h
llvm-svn: 354362
2019-02-19 18:03:47 +00:00
Simon Pilgrim d58cc6f9ee Fix stupid assembly comment typo
llvm-svn: 354361
2019-02-19 17:57:36 +00:00
Simon Pilgrim e31838f88b [X86][SSE] Add pblendw commuted load test case
Reduced test case for the regression caused in D57888/rL353610

llvm-svn: 354360
2019-02-19 17:56:14 +00:00
Nikita Popov 04e45e9311 [SDAG] Use shift amount type in MULO promotion; NFC
Directly use the correct shift amount type if it is possible, and
future-proof the code against vectors. The added test makes sure that
bitwidths that do not fit into the shift amount type do not assert.

Split out from D57997.

llvm-svn: 354359
2019-02-19 17:37:55 +00:00
Simon Pilgrim dce9c2a811 [X86][AVX2] Hide VPBLENDD instructions behind AVX2 predicate
This was the cause of the regression in D57888 - the commuted load pattern wasn't hidden by the predicate so once we enabled v4i32 blends on SSE41+ targets then isel was incorrectly matched against AVX2+ instructions.

llvm-svn: 354358
2019-02-19 17:23:55 +00:00
Craig Topper 51a2e88990 [X86] Bugfix for nullptr check by klocwork
klocwork critical issues in CG files:

Patch by Xiang Zhang (xiangzhangllvm)

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

llvm-svn: 354357
2019-02-19 17:16:23 +00:00
Craig Topper d8acfe69f0 X86AsmParser AVX-512: Return error instead of hitting assert
When parsing a sequence of tokens beginning with {, it will hit an assert and crash if the token afterwards is not an identifier. Instead of this, return a more verbose error as seen elsewhere in the function.

Patch by Brandon Jones (BrandonTJones)

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

llvm-svn: 354356
2019-02-19 17:13:40 +00:00
Craig Topper 236e1ce1d9 [X86] Filter out tuning feature flags and a few ISA feature flags when checking for function inline compatibility.
Tuning flags don't have any effect on the available instructions so aren't a good reason to prevent inlining.

There are also some ISA flags that don't have any intrinsics our ABI requirements that we can exclude. I've put only the most basic ones like cmpxchg16b and lahfsahf. These are interesting because they aren't present in all 64-bit CPUs, but we have codegen workarounds when they aren't present.

Loosening these checks can help with scenarios where a caller has a more specific CPU than a callee. The default tuning flags on our generic 'x86-64' CPU can currently make it inline compatible with other CPUs. I've also added an example test for 'nocona' and 'prescott' where 'nocona' is just a 64-bit capable version of 'prescott' but in 32-bit mode they should be completely compatible.

I've based the implementation here of the similar code in AMDGPU.

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

llvm-svn: 354355
2019-02-19 17:05:11 +00:00
Matt Arsenault b4c95b338b GlobalISel: Implement moreElementsVector for select
llvm-svn: 354354
2019-02-19 17:03:09 +00:00
Hans Wennborg b48b3ae589 index.rst: Remove bb-chapuni from list of IRC bots
llvm-svn: 354353
2019-02-19 17:00:34 +00:00
Hans Wennborg 05bff5a0a8 index.rst: Remove Dragonegg link
llvm-svn: 354352
2019-02-19 17:00:29 +00:00
Hans Wennborg 27a7885228 Remove extraneous space in MSVC-style diagnostic output
There was an extra space between the file location and the diagnostic
message:

  /tmp/a.c(1,12):  warning: unused parameter 'unused'

the tests didn't catch this due to FileCheck not running in --strict-whitespace mode.

Reported by Marco: http://lists.llvm.org/pipermail/cfe-dev/2019-February/061326.html

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

llvm-svn: 354351
2019-02-19 16:58:25 +00:00
Petr Hosek a94e6d70f1 [compiler-rt][CMake] Set project for the custom libc++
This is another follow up to r354212 which is broken on Darwin when
cross-compiling runtimes to Linux when it ignores the -fuse-ld=lld
linker flag and attempts to use the host linker when performing the
compiler identification. Upon investigation, I noticed that setting
the project with appropriate list of languages makes the error go
away and it shouldn't hurt either.

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

llvm-svn: 354350
2019-02-19 16:53:33 +00:00
Ilya Biryukov 93dfb45256 [clangd] Add an option in the code to not display number of fixes
Summary:
Only to the APIs, which are used by our embedders.
We do not plan to add a user-facing option for this.

Reviewers: sammccall, ioeric

Reviewed By: sammccall

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

Tags: #clang

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

llvm-svn: 354349
2019-02-19 16:50:37 +00:00
Matt Arsenault 4d88427a58 GlobalISel: Implement moreElementsVector for G_EXTRACT source
llvm-svn: 354348
2019-02-19 16:44:22 +00:00
Michael Kruse 4304e9d143 [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.
This patch implements the parsing and sema support for OpenMP map
clauses with potential user-defined mapper attached. User defined mapper
is a new feature in OpenMP 5.0. A map clause can have an explicit or
implicit associated mapper, which instructs the compiler to generate
extra data mapping. An example is shown below:

    struct S { int len; int *d; };
    #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len])
    struct S ss;
    #pragma omp target map(mapper(id) tofrom: ss) // use the mapper with name 'id' to map ss

Contributed-by: Lingda Li <lildmh@gmail.com>

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

llvm-svn: 354347
2019-02-19 16:38:20 +00:00
Simon Pilgrim 9d575db85e [X86][AVX] Update VBROADCAST folds to always use v2i64 X86vzload
The VBROADCAST combines and SimplifyDemandedVectorElts improvements mean that we now more consistently use shorter (128-bit) X86vzload input operands.

Follow up to D58053

llvm-svn: 354346
2019-02-19 16:33:17 +00:00
Matt Arsenault 26b7e859ef GlobalISel: Implement moreElementsVector for bit ops
llvm-svn: 354345
2019-02-19 16:30:19 +00:00
James Henderson d82914c8d2 [yaml2obj][obj2yaml] Remove section type range markers from allowed mappings and support hex values
yaml2obj/obj2yaml previously supported SHT_LOOS, SHT_HIOS, and
SHT_LOPROC for section types. These are simply values that delineate a
range and don't really make sense as valid values. For example if a
section has type value 0x70000000, obj2yaml shouldn't print this value
as SHT_LOPROC. Additionally, this was missing the three other range
markers (SHT_HIPROC, SHT_LOUSER and SHT_HIUSER).

This change removes these three range markers. It also adds support for
specifying the type as an integer, to allow section types that LLVM
doesn't know about.

Reviewed by: grimar

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

llvm-svn: 354344
2019-02-19 16:22:21 +00:00
Simon Pilgrim d6add74915 Cast from SDValue directly instead of superfluous getNode(). NFCI.
llvm-svn: 354343
2019-02-19 16:20:09 +00:00
Matt Arsenault 267601455e GlobalISel: Verify g_insert
llvm-svn: 354342
2019-02-19 16:10:16 +00:00
Simon Atanasyan 2fdd159715 [mips] Fix indentations in the test. NFC
llvm-svn: 354341
2019-02-19 16:00:07 +00:00
Simon Pilgrim 952abcefe4 [X86][AVX] EltsFromConsecutiveLoads - Add BROADCAST lowering support
This patch adds scalar/subvector BROADCAST handling to EltsFromConsecutiveLoads.

It mainly shows codegen changes to 32-bit code which failed to handle i64 loads, although 64-bit code is also using this new path to more efficiently combine to a broadcast load.

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

llvm-svn: 354340
2019-02-19 15:57:09 +00:00
George Rimar baff199877 [ELF] - Update test case after yaml2obj format change.
yaml2obj was changed in r354338("[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.")

llvm-svn: 354339
2019-02-19 15:29:25 +00:00
George Rimar 646af08e2b [yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.
This patch adds support for parsing dumping the .gnu.version section.
Description of the section is: https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symversion.html#SYMVERTBL

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

llvm-svn: 354338
2019-02-19 15:29:07 +00:00
Alexey Bader 24fa0c18e6 [OpenCL] Change type of block pointer for OpenCL
Summary:

For some reason OpenCL blocks in LLVM IR are represented as function pointers.
These pointers do not point to any real function and never get called. Actually
they point to some structure, which in turn contains pointer to the real block
invoke function.
This patch changes represntation of OpenCL blocks in LLVM IR from function
pointers to pointers to `%struct.__block_literal_generic`.
Such representation allows to avoid unnecessary bitcasts and simplifies
further processing (e.g. translation to SPIR-V ) of the module for targets
which do not support function pointers.

Patch by: Alexey Sotkin.

Reviewers: Anastasia, yaxunl, svenvh

Reviewed By: Anastasia

Subscribers: alexbatashev, cfe-commits

Tags: #clang

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

llvm-svn: 354337
2019-02-19 15:19:06 +00:00
Simon Atanasyan 37a1d6eca3 Convert the eh-frame-hdr-abs-fde.s test to use x86 as a target architecture
The test checks common functionality. Let's use `x86` (generic LLD target)
as a target architecture.

llvm-svn: 354336
2019-02-19 15:17:43 +00:00
George Rimar 0621b79587 Recommit r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section."
Fix:
Replace
assert(!IO.getContext() && "The IO context is initialized already");
with
assert(IO.getContext() && "The IO context is not initialized");
(this was introduced in r354329, where I tried to quickfix the darwin BB
and seems copypasted the assert from the wrong place).

Original commit message:

The section is described here:
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverrqmts.html

Patch just teaches obj2yaml/yaml2obj to dump and parse such sections.

We did the finalization of string tables very late,
and I had to move the logic to make it a bit earlier.
That was needed in this patch since .gnu.version_r adds strings to .dynstr.
This might also be useful for implementing other special sections.

Everything else changed in this patch seems to be straightforward.

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

llvm-svn: 354335
2019-02-19 14:53:48 +00:00
Alex Bradbury 6aae216109 [RISCV][NFC] Move some std::string to StringRef
llvm-svn: 354333
2019-02-19 14:42:00 +00:00
George Rimar aa735de65f Revert r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section."
Something went wrong. Bots are unhappy:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/44113/steps/test/logs/stdio

llvm-svn: 354332
2019-02-19 14:38:25 +00:00
Eric Liu 4df070a5e3 [clangd] Handle unresolved scope specifier when fixing includes.
Summary:
In the following examples, "clangd" is unresolved, and the fixer will try to fix
include for `clang::clangd`; however, clang::clangd::X is usually intended. So
when handling a qualifier that is unresolved, we change the unresolved name and
scopes so that the fixer will fix "clang::clangd::X" in the following example.
```
  namespace clang {
  	clangd::X
	~~~~~~
  }
  // or
  clang::clangd::X
         ~~~~~~
```

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

llvm-svn: 354330
2019-02-19 14:32:22 +00:00
George Rimar 12b283dfa6 Fix BB after r354328.
Bot:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/30188/steps/build_Lld/logs/stdio

Error:
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1013:15: error: unused variable 'Object' [-Werror,-Wunused-variable]
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
              ^
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1023:15: error: unused variable 'Object' [-Werror,-Wunused-variable]
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());

Fix:
change 
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
  assert(Object && "The IO context is not initialized");
to
  assert(!IO.getContext() && "The IO context is initialized already");

llvm-svn: 354329
2019-02-19 14:22:10 +00:00
George Rimar c09f2cd0cb [obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section.
The section is described here:
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverrqmts.html

Patch just teaches obj2yaml/yaml2obj to dump and parse such sections.

We did the finalization of string tables very late,
and I had to move the logic to make it a bit earlier.
That was needed in this patch since .gnu.version_r adds strings to .dynstr.
This might also be useful for implementing other special sections.

Everything else changed in this patch seems to be straightforward.

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

llvm-svn: 354328
2019-02-19 14:03:14 +00:00
Pavel Labath 95e29763d4 Revert "minidump: Add ability to attach (breakpad) symbol files to placeholder modules"
This reverts r354263, because it uncovered a problem in handling of the
minidumps with conflicting UUIDs. If a minidump contains two files with
the same UUID, we will not create to placeholder modules for them, but
instead reuse the first one for the second instance. This creates a
problem because these modules have their load address hardcoded in them
(and I've added an assert to verify that).

Technically this is not a problem with this patch, as the same issue
existed in the previous implementation, but it did not have the assert
which would diagnose that. Nonetheless, I am reverting this until I
figure out what's the best course of action in this situation.

llvm-svn: 354324
2019-02-19 13:52:31 +00:00
Alex Bradbury 1f0c1215ae [RISCV] Re-organise calling convention tests
Re-organise calling convention tests to prepare for ilp32f and ilp32d hard
float ABI tests. It's also clear that we need to introduce similar tests for
lp64.

llvm-svn: 354323
2019-02-19 13:47:19 +00:00
George Rimar d560744e48 Fix BB after r354319 "[yaml2obj] - Do not skip zeroes blocks if there are relocations against them."
Fix: move the test to x86 folder. 
Seems it is needed, because llvm-objdump invocation used in test has -D (disasm) flag.

BB: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/23016

/local/buildbot/slaves/hexagon-build-02/clang-hexagon-elf/stage1/bin/llvm-objdump: 
error: '/local/buildbot/slaves/hexagon-build-02/clang-hexagon-elf/stage1/test/tools/llvm-objdump/Output/disasm-zeroes-relocations.test.tmp': 
can't find target: : error: unable to get target for 'x86_64--', see --version and --triple.
.

llvm-svn: 354322
2019-02-19 13:27:06 +00:00
George Rimar c5f2920038 [yaml2obj] - Do not skip zeroes blocks if there are relocations against them.
This is for -D -reloc combination.

With this patch, we do not skip the zero bytes that have a relocation against
them when -reloc is used. If -reloc is not used, then the behavior will be the same.

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

llvm-svn: 354319
2019-02-19 12:38:36 +00:00
George Rimar 6947acd9da [yaml2obj] - Do not ignore explicit addresses for .dynsym and .dynstr
This fixes https://bugs.llvm.org/show_bug.cgi?id=40339

Previously if the addresses were set in YAML they were ignored for
.dynsym and .dynstr sections. The patch fixes that.

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

llvm-svn: 354318
2019-02-19 12:15:04 +00:00
Diana Picus 55d41a78ac Fix obsolete comment. NFC
Both files mentioned in the comment now include TargetOpcodes.def. Just
mention that directly.

llvm-svn: 354316
2019-02-19 11:34:36 +00:00
Simon Atanasyan 40fb1c95ee [mips] Remove trailing whitespaces from the test case. NFC
llvm-svn: 354315
2019-02-19 11:15:28 +00:00
Max Kazantsev ebd95ea86e [NFC] API for signaling that the current loop is being deleted
We are planning to be able to delete the current loop in LoopSimplifyCFG
in the future. Add API to notify the loop pass manager that it happened.

llvm-svn: 354314
2019-02-19 11:14:05 +00:00
Max Kazantsev 30095d9795 [NFC] Store loop header in a local to keep it available after the loop is deleted
llvm-svn: 354313
2019-02-19 11:13:58 +00:00
Simon Atanasyan a6012a65d4 [mips] Create LA25 thunks for MIPS R6 code
MIPS R6 code uses the `R_MIPS_PC26_S2` relocation for calls which might
cross boundaries of non-PIC-to-PIC code. We need to create a LA25 thunks
for that case.

llvm-svn: 354312
2019-02-19 11:11:12 +00:00