Commit Graph

277078 Commits

Author SHA1 Message Date
Sam Clegg 00e0df26c3 Fix typo in test name
llvm-svn: 319112
2017-11-27 23:09:19 +00:00
Aaron Ballman c566139632 Add an option to misc-move-const-arg to not diagnose on trivially copyable types.
Patch by Oleg Smolsky

llvm-svn: 319111
2017-11-27 22:59:33 +00:00
Craig Topper 256cc48df6 [X86] Teach getSetCCResultType to handle more than just SimpleVTs when looking at larger than 512-bit vectors.
Which VTs are considered simple is determined by the superset of the legal types of all targets in LLVM. If we're looking at VTs that are going to be split down to 512-bits we should allow any VT not just simple ones since the simple list changes over time as new targets are added.

llvm-svn: 319110
2017-11-27 22:56:10 +00:00
Petr Hosek 6163329caa [CMake] Pass LLVM_HOST_TRIPLE to external projects
LLVM runtimes rely on LLVM_HOST_TRIPLE being set in their builds
and tests so make sure it's being passed down.

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

llvm-svn: 319109
2017-11-27 22:50:48 +00:00
Sam Clegg e2ed092e01 Consistent use of <internal> when displaying internal symbol names
Differential Revision: https://reviews.llvm.org/D40510

llvm-svn: 319108
2017-11-27 22:49:16 +00:00
Petr Hosek a08d65ded2 [CMake][runtimes] Support monorepo layout with runtimes build
We introduce a new variable LLVM_ENABLE_RUNTIMES which works
similarly to LLVM_ENABLE_PROJECTS and allows specifying runtimes
that will be enabled in the runtimes build.

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

llvm-svn: 319107
2017-11-27 22:31:11 +00:00
Marshall Clow ea44ee202f Fix problems with r'890 when building on machines where sizeof(size_t) != sizeof(unsigned long long) and C++03
llvm-svn: 319106
2017-11-27 22:27:22 +00:00
Michal Gorny 8eaa8ec8fc [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
Prevent unloading shared libraries on Linux when dlclose() is called.
This is necessary since command-line option parsing API relies on
registering the global option instances in the option parser instance
which can be loaded in a different shared library.

Given that we can't reliably remove those options when a library is
unloaded, the parser ends up containing dangling references. Since glibc
has relatively complex library unloading rules, some of the LLVM
libraries can be unloaded while others (including the Support library)
stay loaded causing quite a mayhem. To reliably prevent that, just
forbid unloading all libraries -- it's a very bad idea anyway.

While the issue arguably happens only with BUILD_SHARED_LIBS, it may
affect any library reusing llvm::cl interface.

Based on patch provided Ross Hayward on https://bugs.gentoo.org/617154.
Previously hit by Fedora back in Feb 2016:
https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html

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

llvm-svn: 319105
2017-11-27 22:23:09 +00:00
Greg Clayton d6b67eb15c Fixed the ability to recursively get an attribute value from a DWARFDie.
The previous implementation would only look 1 DW_AT_specification or DW_AT_abstract_origin deep. This means DWARFDie::getName() would fail in certain cases. I ran into such a case while creating a tool that used the LLVM DWARF parser to generate a symbolication format so I have seen this in the wild.

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

llvm-svn: 319104
2017-11-27 22:12:44 +00:00
Craig Topper 4aa519507d [X86] Remove lines that set v8f32 FP_ROUND/FP_EXTEND to Legal under AVX512. NFCI
We don't do this for narrow vectors under AVX or SSE features. We also don't set them to Expand like we do for many vectors op. Nor does TargetLoweringBase.cpp. This leads me to believe these default to Legal.

llvm-svn: 319103
2017-11-27 22:01:17 +00:00
Dan Gohman 1384ee936e [WebAssemby] Enable "-mthread-model single" by default, for now.
The WebAssembly standard does not yet have threads, and while it's in the
process of being standardized, it'll take some time for it to make it
through and be available in all popular implementations. With increasing
numbers of people using the LLVM wasm backend through LLVM directly rather
than through Emscripten, it's increasingly important to have friendly
defaults.

See also https://bugs.llvm.org/show_bug.cgi?id=35411

llvm-svn: 319101
2017-11-27 21:39:16 +00:00
Peter Collingbourne c8477b8234 Revert r319090, "COFF: Do not create SectionChunks for discarded comdat sections."
Caused test failures in check-cfi on Windows.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/20284

llvm-svn: 319100
2017-11-27 21:37:51 +00:00
Kostya Kortchinsky 06b891f693 [scudo] Workaround for uninitialized Bionic globals
Summary:
Bionic doesn't initialize its globals early enough. This causes issues when
trying to access them from a preinit_array (b/25751302) or from another
constructor called before the libc one (b/68046352). __progname is initialized
after the other globals, so we can check its value to know if calling
`getauxval` is safe.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: srhines, llvm-commits

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

llvm-svn: 319099
2017-11-27 21:34:43 +00:00
Yan Zhang 2f20b36cc3 add new check to find OSSpinlock usage
Summary:
This check finds the use of methods related to OSSpinlock in Objective-C code, which should be deprecated due to livelock issues.
The following method call will be detected:

- OSSpinlockLock()
- OSSpinlockTry()
- OSSpinlockUnlcok()

Reviewers: hokein, benhamilton

Reviewed By: benhamilton

Subscribers: klimek, cfe-commits, mgorny

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

llvm-svn: 319098
2017-11-27 21:30:10 +00:00
Davide Italiano 824d71a9c5 [Mem2Reg] Clang-format unformatted parts of this file. NFCI.
llvm-svn: 319097
2017-11-27 21:25:52 +00:00
Davide Italiano b5d59e73ee [SROA] Propagate !range metadata when moving loads.
This tries to propagate !range metadata to a pre-existing load
when a load is optimized out. This is done instead of adding an
assume because converting loads to and from assumes creates a
lot of IR.

Patch by Ariel Ben-Yehuda.

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

llvm-svn: 319096
2017-11-27 21:25:13 +00:00
Stephane Sezer 2072552360 Mark UUID::GetByteSize() const
Summary:
This method doesn't modify anything in the object it's called on so we
can mark it const to make it usable in a const context.

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 319095
2017-11-27 21:16:37 +00:00
Sanjay Patel 0de1a4bc2d [PartiallyInlineLibCalls][x86] add TTI hook to allow sqrt inlining to depend on arg rather than result
This should fix PR31455:
https://bugs.llvm.org/show_bug.cgi?id=31455

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

llvm-svn: 319094
2017-11-27 21:15:43 +00:00
Daniel Sanders 7c3a89231c Add release note about TargetRegistry change from r318352
llvm-svn: 319093
2017-11-27 21:12:55 +00:00
Yaxun Liu dcb6067d9f [AMDGPU] Update test nullptr.ll to use amdgiz environment
This test needs to be manually updated since it is difficult to do it with script.

Addr space 6 to 23 are only used by r600, therefore only check them for r600.

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

llvm-svn: 319092
2017-11-27 20:48:21 +00:00
Marshall Clow a2f3c63282 Revert commit removing allocator support from packaged_task. Will investigate further
llvm-svn: 319091
2017-11-27 20:47:54 +00:00
Peter Collingbourne 3f2921f5ec COFF: Do not create SectionChunks for discarded comdat sections.
With this change, instead of creating a SectionChunk for each section
in the object file, we only create them when we encounter a prevailing
comdat section.

Also change how symbol resolution occurs between comdat symbols. Now
only the comdat leader participates in comdat resolution, and not any
other external associated symbols. This is more in line with how COFF
semantics are defined, and should allow for a more straightforward
implementation of non-ANY comdat types.

On my machine, this change reduces our runtime linking a release
build of chrome_child.dll with /nopdb from 5.65s to 4.54s (median of
50 runs).

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

llvm-svn: 319090
2017-11-27 20:42:34 +00:00
Petr Hosek 1f34379965 Use LIST_SEPARATOR rather than escaping in ExternalProject_Add
Escaping ; in list arguments passed to ExternalProject_Add doesn't seem
to be working in newer versions of CMake (see
https://public.kitware.com/Bug/view.php?id=16137 for more details). Use
a custom LIST_SEPARATOR instead which is the officially supported way.

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

llvm-svn: 319089
2017-11-27 20:41:53 +00:00
Petr Hosek 86cc84d12e [CMake][Fuchsia] Disable terminfo database in Fuchsia toolchain
It's used to determine whether terminal supports colors, but within LLVM
it's only used in handful of places and in Clang it's only used in AST
dumper, otherwise Clang relies on the -fcolor-diagnostics flag which we
pass explicitly from our build system anyway. This eliminates one of the
shared libraries dependencies making the toolchain less reliant on the
host environment.

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

llvm-svn: 319088
2017-11-27 20:29:13 +00:00
Zaara Syeda f94d58d908 [PowerPC] Remove redundant TOC saves
This patch adds a peep hole optimization to remove any redundant toc save
instructions added as part of the call sequence for indirect calls. It removes
any toc saves within a function that are dominated by another toc save.

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

llvm-svn: 319087
2017-11-27 20:26:36 +00:00
David Blaikie eef5c23305 Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables
llvm-svn: 319086
2017-11-27 19:55:16 +00:00
Craig Topper 820ce04377 [SelectionDAG] Add a debug message when vector_shuffle nodes are created.
We print a debug message when most nodes are created, but getVectorShuffle was missing.

llvm-svn: 319085
2017-11-27 19:54:57 +00:00
David Blaikie 265a03775e Fix for file renaming in LLVM (CommandFlags.h -> CommandFlags.def)
llvm-svn: 319084
2017-11-27 19:54:06 +00:00
Kostya Kortchinsky fbff7fcdf4 [fuchsia] Update Fuchsia with a new mmap implementation.
Summary:
    Now that the sanitizer_common interface for MmapNoAccess / MmapFixed
    have been refactored to allow a more OO-esque access pattern, update the
    Fuchsia mmap implementation to take advantage of this.
    
    Previously MmapNoAccess / MmapFixed relied on a global allocator_vmar,
    since the sanitizer_allocator only called MmapNoAccess once.  Now, we
    create a new VMAR per ReservedAddressRange object.
    
    This allows the sanitizer allocator to work in tandem with the Scudo
    secondary allocator.
    
    This is part 4 of a 4 part changeset:
    * part 1 https://reviews.llvm.org/D38593
    * part 2 https://reviews.llvm.org/D38592
    * part 3 https://reviews.llvm.org/D38593

Reviewers: mcgrathr, cryptoad

Reviewed By: cryptoad

Subscribers: alekseyshl, mcgrathr, kubamracek, mehdi_amini

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

llvm-svn: 319083
2017-11-27 19:53:53 +00:00
David Blaikie c14bfec487 Rename CommandFlags.h -> CommandFlags.def
Since this isn't a real header - it includes static functions and had
external linkage variables (though this change makes them static, since
that's what they should be) so can't be included more than once in a
program.

llvm-svn: 319082
2017-11-27 19:43:58 +00:00
David Blaikie 551d3af1de Fix -Werror build for signed/unsigned comparison with use of explicit unsigned literals
llvm-svn: 319081
2017-11-27 19:43:57 +00:00
Marshall Clow d42db7e083 Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.
llvm-svn: 319080
2017-11-27 19:43:28 +00:00
Alexey Bataev 0b49f9e489 [OPENMP] Codegen for `distribute parallel for simd` directive.
Initial codegen for `#pragma omp distribute parallel for simd` directive
and its clauses.

llvm-svn: 319079
2017-11-27 19:38:58 +00:00
Alexey Bataev 974acd6b13 [OPENMP] Codegen for `distribute parallel for simd` directive.
Added proper codegen for `distribute parallel for simd` directive.

llvm-svn: 319078
2017-11-27 19:38:52 +00:00
Pirama Arumuga Nainar 87ff0a7467 Switch CPU names not recognized by GNU assembler
Summary:
Switch CPU names not recognized by GNU assembler to a close CPU that it
does recognize.  In this patch, kryo, falkor and saphira all get
replaced by cortex-a57 when invoking the assembler.  In addition, krait
was already being replaced by cortex-a15.

Reviewers: weimingz

Subscribers: srhines, cfe-commits

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

llvm-svn: 319077
2017-11-27 19:18:39 +00:00
Michal Gorny 4414b08bb1 Revert r319069 - [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
This breaks one of the unit tests. Need to find a good solution.

llvm-svn: 319076
2017-11-27 19:18:36 +00:00
Arnold Schwaighofer d9e710984d Inliner: Don't mark notail calls with the 'tail' attribute
enum TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2,
                    TCK_NoTail = 3 };

TCK_NoTail is greater than TCK_Tail so taking the min does not do the
correct thing.

rdar://35639547

llvm-svn: 319075
2017-11-27 19:03:40 +00:00
Marshall Clow 14d7aac15d Fix PR#35438 - bitset constructor does not zero unused bits
llvm-svn: 319074
2017-11-27 19:03:30 +00:00
Adam Nemet cbdd238d5e Add opt-viewer testing
Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

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

llvm-svn: 319073
2017-11-27 19:00:29 +00:00
Adam Nemet ed7a932519 [opt-viewer] Fix option name
llvm-svn: 319072
2017-11-27 19:00:22 +00:00
Jake Ehrlich 6ad72d05f5 [llvm-objcopy] Add --strip-all-gnu and change --strip-all
GNU's --strip-all doesn't strip as aggressively as it could in general.
Currently llvm-objcopy copies the exact behavoir of GNU's --strip-all.
eu-strip is used as a drop in replacement for GNU strip/objcopy in many many
places without issue. eu-strip removes non-allocated sections and keeps
.gnu.warning* sections. Because --strip-all will likely be the most widely
used stripping option we should make --strip-all as aggressive as it can safely
be. Since we have evidence from eu-strip that this is a safe option we should
allow it. For those that might still have an issue afterwards I've added
--strip-all-gnu as an exact drop in replacement for GNU's --strip-all as well.

llvm-svn: 319071
2017-11-27 18:56:01 +00:00
Zachary Turner 96c6985b53 [BinaryStream] Support growable streams.
The existing library assumed that a stream's length would never
change.  This makes some things simpler, but it's not flexible
enough for what we need, especially for writable streams where
what you really want is for each call to write to actually append.

llvm-svn: 319070
2017-11-27 18:48:37 +00:00
Michal Gorny ec6e214272 [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
Prevent unloading shared libraries on Linux when dlclose() is called.
This is necessary since command-line option parsing API relies on
registering the global option instances in the option parser instance
which can be loaded in a different shared library.

Given that we can't reliably remove those options when a library is
unloaded, the parser ends up containing dangling references. Since glibc
has relatively complex library unloading rules, some of the LLVM
libraries can be unloaded while others (including the Support library)
stay loaded causing quite a mayhem. To reliably prevent that, just
forbid unloading all libraries -- it's a very bad idea anyway.

While the issue arguably happens only with BUILD_SHARED_LIBS, it may
affect any library reusing llvm::cl interface.

Based on patch provided Ross Hayward on https://bugs.gentoo.org/617154.
Previously hit by Fedora back in Feb 2016:
https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html

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

llvm-svn: 319069
2017-11-27 18:34:52 +00:00
Craig Topper 3decf89ccc [X86] Remove an unused isel pattern that looked for pshufd with v4f32 type.
I don't believe our current lowering/combining would ever produce such a node. We only produce integer typed pshufds.

llvm-svn: 319068
2017-11-27 18:25:54 +00:00
Sanjay Patel 863d494730 [InstCombine] use 'auto' with 'dyn_cast'; NFC
llvm-svn: 319067
2017-11-27 18:19:32 +00:00
Craig Topper a4120fc42c [X86] Teach combineX86ShuffleChain that AllowIntDomain requires at least SSE2.
I don't have a good test case for this at the moment. I was playing around with a change in legalizing and triggered this code to produce a PSHUFD with sse1 only.

llvm-svn: 319066
2017-11-27 18:15:14 +00:00
Simon Pilgrim 4ac95c9eba [X86][AVX512] Tag AVX512 PACKSS/PACKUS/PMADDWD/PMADDUBSW instructions with SSE_PACK/SSE_PMADD schedule classes
llvm-svn: 319065
2017-11-27 18:14:18 +00:00
Krzysztof Parzyszek ac1966e15d [Hexagon] Implement HexagonSubtarget::isHVXVectorType
llvm-svn: 319064
2017-11-27 18:12:16 +00:00
Craig Topper 51f2886f93 [X86] Add avx512bw command lines to vselect-packss.ll
This shows several places where we fail to use masked move or blendm.

llvm-svn: 319063
2017-11-27 18:00:49 +00:00
Alexander Kornienko 1f71b91254 [clang-tidy] Rename qualified references to check class + support inconsistent names
llvm-svn: 319062
2017-11-27 17:59:26 +00:00