Commit Graph

277066 Commits

Author SHA1 Message Date
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
Jonas Hahnfeld a8efe6d9a5 Delete obsolete function mergeUseListsImpl
mergeUseLists is implemented iteratively since r243590.

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

llvm-svn: 319061
2017-11-27 17:55:47 +00:00
Kamil Rytarowski 27fb9cc994 Build more sanitizers for NetBSD
Summary:
Enable for NetBSD:

 - MSan,
 - TSan,
 - LSan.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, eugenis, dvyukov, vitalybuka

Reviewed By: eugenis

Subscribers: srhines, mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 319060
2017-11-27 17:54:26 +00:00
Craig Topper 62189f7ab3 [X86] Make getSetCCResultType return vXi1 for any vXi32/vXi64 vector over 512 bits long when AVX512 is enabled.
Similar for vXi16/vXi8 with BWI.

Any vector larger than 512 bits will be split to 512 bits during legalization. But without this we will fold sexts with them before that making it difficult to recover leading to scalarization.

llvm-svn: 319059
2017-11-27 17:51:55 +00:00
Artem Dergachev 052436f768 [analyzer] pr34766: Fix a crash on explicit std::initializer_list constructor.
We didn't support the following syntax:

  (std::initializer_list<int>){12}

which suddenly produces CompoundLiteralExpr that contains
CXXStdInitializerListExpr.

Lift the assertion and instead pass the value through CompoundLiteralExpr
transparently, as it doesn't add much.

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

llvm-svn: 319058
2017-11-27 17:37:09 +00:00
Ben Hamilton 85db2bf7b6 [polly] Set up .arcconfig to point to new Diffusion PLO repository
Summary: We want to automatically copy the appropriate mailing list
for review requests to the polly repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40179, I set up a new Diffusion repository with callsign
"PLO" for polly:

https://reviews.llvm.org/source/polly/

This explicitly updates polly's .arcconfig to point to the new C
repository in Diffusion, which will let us use Herald rule H270.

llvm-svn: 319056
2017-11-27 17:34:03 +00:00
Artem Dergachev db9a5954d4 [analyzer] pr34404: Fix a crash on modeling pointers to indirect members.
We were crashing whenever a C++ pointer-to-member was taken, that was pointing
to a member of an anonymous structure field within a class, eg.

  struct A {
    struct {
     int x;
    };
  };
  // ...
  &A::x;

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

llvm-svn: 319055
2017-11-27 17:31:16 +00:00
Simon Pilgrim 18fc7ff93a [X86][SSE] Fix roundpd instructions to correctly use IIC_SSE_ROUNDPD_* itineraries
llvm-svn: 319054
2017-11-27 17:29:49 +00:00
Ben Hamilton e15d09c999 [clang] Set up .arcconfig to point to new Diffusion C repository
Summary:
We want to automatically copy cfe-commits@ on review requests
to the clang repository.

Similar to D40179, I set up a new Diffusion repository with callsign
"C" for clang:

https://reviews.llvm.org/source/clang/

This explicitly updates clang's .arcconfig to point to the new C
repository in Diffusion, which will let us use Herald rule H268.

Reviewers: klimek, sammccall

Reviewed By: klimek

Subscribers: dlj, bkramer

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

llvm-svn: 319052
2017-11-27 17:21:24 +00:00
Rafael Espindola 1fea1e326e Add a missing test.
We were not testing that we correctly handled a .o with a weak symbol
after a .so.

llvm-svn: 319051
2017-11-27 17:18:09 +00:00
Dmitry Preobrazhensky 16608e67d3 [AMDGPU][MC][DISASSEMBLER][GFX9] Corrected decoding of GLOBAL/SCRATCH opcodes
See bug 35433: https://bugs.llvm.org/show_bug.cgi?id=35433

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

Reviewers: artem.tamazov, SamWot, arsenm
llvm-svn: 319050
2017-11-27 17:14:35 +00:00
Zaara Syeda 48cb3c1557 [Power9] Improvements to vector extract with variable index exploitation
This patch extends on to rL307174 to not use the power9 vector extract with
variable index instructions when extracting word element 1. For such cases,
the existing selection of MFVSRWZ provides a better sequence.

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

llvm-svn: 319049
2017-11-27 17:11:03 +00:00
Pavel Labath 11479d1bab Remove custom TimePoint-formatting code
This was a temporary thing, until llvm has proper support for formatting
time. That time has come, so we can remove the relevant code. There
should be no change in the format of the time.

llvm-svn: 319048
2017-11-27 17:06:42 +00:00