Commit Graph

277481 Commits

Author SHA1 Message Date
Craig Topper 56a41d4b3a [X86] Remove some questionable looking code that seems to be looking through a VZEXT to create a larger VSEXT.
If the input the vzext was signed this would do the wrong thing.

Not sure how to test this.

llvm-svn: 319382
2017-11-29 23:08:25 +00:00
Joerg Sonnenberger 4b1acff9b3 First step towards more human-friendly PPC assembler output:
- add -ppc-reg-with-percent-prefix option to use %r3 etc as register
  names
- split off logic for Darwinish verbose conditional codes into a helper
  function
- be explicit about Darwin vs AIX vs GNUish assembler flavors

Based on the patch from Alexandre Yukio Yamashita

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

llvm-svn: 319381
2017-11-29 23:05:56 +00:00
Sam Clegg da8d83f911 [WebAssembly] Update test expectations for gcc torture tests
I believe these were recently fixed by:
https://reviews.llvm.org/rL319186

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

llvm-svn: 319380
2017-11-29 23:05:50 +00:00
Jonathan Peyton ba55a7b958 Make kmp_r_sched_t into a union
This change makes kmp_r_sched_t type into a union for simpler
comparisons and assignments

Patch by Terry Wilmarth

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

llvm-svn: 319379
2017-11-29 22:47:52 +00:00
Rafael Espindola dfebd3601d Use Symbol::File directly.
We are already paying the cost of storing a InputFile in every
Symbol, so use it uniformly.

llvm-svn: 319378
2017-11-29 22:47:35 +00:00
Zachary Turner 52d036e693 [CodeView] Factor some code out of TypeTableBuilder.
This class had some code that would automatically remap type
indices before hashing and serializing.  The only caller of
this method was the TypeStreamMerger anyway, and the method
doesn't make general sense, and prevents making certain future
improvements to the class.  So, factoring this up one level
into the TypeStreamMerger where it belongs.

llvm-svn: 319377
2017-11-29 22:41:56 +00:00
Eugene Zelenko 421e89094b [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 319376
2017-11-29 22:39:22 +00:00
Jonathan Peyton 62da55020b Fix aligned memory allocation in the stub library
kmp_aligned_malloc() always returned NULL on Windows (stub library only)
that may cause Fortran application crash.  With this change all memory
allocation functions were fixed to use aligned{m,re,rec}alloc() to
allocate/reallocate memory. To deallocate that memory _aligned_free() is
used in kmp_free().

Patch by Olga Malysheva

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

llvm-svn: 319375
2017-11-29 22:29:38 +00:00
Jonathan Peyton 64249504b5 Warning is emitted when tiles are requested but cannot be used
Added two warnings:
1) Before building the topology map check if tiles are requested but the
   topo method is not hwloc;
2) After building the topology map check if tiles are requested but not
   detected by the library.

Patch by Olga Malysheva

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

llvm-svn: 319374
2017-11-29 22:27:18 +00:00
Vedant Kumar fa8fa044ec [Coverage] Emit gap areas in braces-optional statements (PR35387)
Emit a gap area starting after the r-paren location and ending at the
start of the body for the braces-optional statements (for, for-each,
while, etc). The count for the gap area equal to the body's count. This
extends the fix in r317758.

Fixes PR35387, rdar://35570345

Testing: stage2 coverage-enabled build of clang, check-clang
llvm-svn: 319373
2017-11-29 22:25:14 +00:00
Jonathan Peyton 92ce4bcfd8 Fix types of Fortran array elements
Fortran array elements made default integer in OMP_GET_PLACE_PROC_IDS and
OMP_GET_PARTITION_PLACE_NUMS subroutines, otherwise call to them produces
incorrect result.

Patch by Olga Malysheva

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

llvm-svn: 319372
2017-11-29 22:23:44 +00:00
Rui Ueyama 7d5a13799a Use llvm::StringSet instead of std::set.
std::set is pretty slow. We generally prefer llvm::StringSet if we don't
need an sorted set.

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

llvm-svn: 319371
2017-11-29 22:21:37 +00:00
Rafael Espindola 07b7ee4394 Simplify. NFC.
llvm-svn: 319370
2017-11-29 22:20:03 +00:00
Eugene Zelenko ca3563ca73 [Documentation] Sort Clang-tidy changes next way: new modules, new checks, renamed checks, extended checks, new check aliases.
Sort checks in each section alphabetically.

llvm-svn: 319369
2017-11-29 22:17:39 +00:00
Craig Topper cf461a0a32 [SelectionDAG][X86] Teach promotion legalization for fp_to_sint/fp_to_uint to insert an assertsext/assertzext based on the original type
If we put in an assertsext/zext here, we're able to generate better truncate code using pack on pre-avx512 targets.

Similar is already done during type legalization. This is the equivalent for op legalization

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

llvm-svn: 319368
2017-11-29 22:15:43 +00:00
Rafael Espindola f893396d1b Don't crash on broken debug info.
llvm-svn: 319367
2017-11-29 22:09:16 +00:00
Dean Michael Berris 0e508d69fd [XRay][compiler-rt][Darwin] Use dynamic initialisation as an alternative
Summary:
In cases where we can't use the .preinit_array section (as in Darwin for
example) we instead use dynamic initialisation. We know that this
alternative approach will race with the initializers of other objects at
global scope, but this is strictly better than nothing.

Reviewers: kubamracek, nglevin

Subscribers: llvm-commits

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

llvm-svn: 319366
2017-11-29 22:06:12 +00:00
Kuba Mracek ceea5466eb [sanitizer] Add 'strip_env' flag to enable/disable removing sanitizer dylib from DYLD_INSERT_LIBRARIES
On macOS, we usually don't require launching the target with DYLD_INSERT_LIBRARIES anymore. However, it is still necessary when running a target that is not instrumented (and e.g. dlopen's an instrument library later). In any case, ASan and TSan currently remove themselves from the DYLD_INSERT_LIBRARIES environment variable to avoid passing it onto children. This works well e.g. when instrumenting a shell. A problem arises when the target is a non-instrumented shim (e.g. "xcrun") that either re-execs or launches a child that is supposed to get DYLD_INSERT_LIBRARIES propagated. To support this mode, this patch introduces 'strip_env' flag that can be used to keep DYLD_INSERT_LIBRARIES untouched.

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

llvm-svn: 319365
2017-11-29 21:42:48 +00:00
Reid Kleckner 7383b8e4fe Reformat switch statement added in r319297, NFC
llvm-svn: 319364
2017-11-29 21:36:00 +00:00
Reid Kleckner 9dae73b9db [EH] Use __CxxFrameHandler3 for C++ EH in MS environments
Fixes regression introduced by r319297. MSVC environments still use SEH
unwind opcodes but they should use the Microsoft C++ EH personality, not
the mingw one.

llvm-svn: 319363
2017-11-29 21:35:34 +00:00
Alexey Bataev 2b86f21ce5 [OPENMP] Allow only loop control variables in distribute simd
directives.

According to the OpenMP standard, only loop control variables can be
used in linear clauses of distribute-based simd directives.

llvm-svn: 319362
2017-11-29 21:31:48 +00:00
Rafael Espindola cf5dc9f24c Replace a dyn_cast with a cast. NFC.
llvm-svn: 319361
2017-11-29 21:29:52 +00:00
Aaron Ballman 813e36c2c1 Add the hasDefinition() AST matcher to match class declarations that also have a definition.
Patch by Julie Hockett.

llvm-svn: 319360
2017-11-29 21:21:51 +00:00
Jan Kratochvil ca9c2b290c refactor: Unify+simplify DWARFCompileUnit ctor+Clear() into in-class initializers + Extract()
It has no functionality effect.

I was concerned about the worse performance of DWARFDebugInfo::Parse this way
of allocating+destroying a CU for each iteration but I see it is now used only
by DWARFDebugInfo::Dump so that is no longer a problem.

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

llvm-svn: 319359
2017-11-29 21:13:11 +00:00
Mandeep Singh Grang fa51e1d184 [SourceLocations] Use stronger sort predicate to remove non-deterministic ordering
Summary:
This fixes the following failure uncovered by D39245:
  Clang :: Index/getcursor-preamble.m

Reviewers: gbenyei, akyrtzi, bkramer, arphaman

Reviewed By: arphaman

Subscribers: arphaman, cfe-commits

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

llvm-svn: 319357
2017-11-29 20:55:13 +00:00
Rui Ueyama 215286f2a4 [LLD] [COFF] Support ENTRY and SUBSYSTEM in .drectve sections
Adds support for "/ENTRY" and "/SUBSYSTEM" linker options in .drectve
sections. Some Mozilla binaries were using these directives and MSVC
link.exe appears to allow them. No attempt is made to reconcile these
with the options on the command line.

Patch by David Major!

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

llvm-svn: 319356
2017-11-29 20:46:13 +00:00
Rui Ueyama e48f223ed6 Remove `else` or `break` after `fatal`. NFC.
fatal() does not return, so we don't need `else` or `break` after a call
of fatal.

llvm-svn: 319355
2017-11-29 20:45:58 +00:00
Dan Gohman 580c102ab8 [WebAssembly] Fix fptoui lowering bounds
To fully avoid trapping on wasm, fptoui needs a second check to ensure that
the operand isn't below the supported range.

llvm-svn: 319354
2017-11-29 20:20:11 +00:00
Sam Clegg 51d90c8c6b Add libstd++-4.8 exceptions to ubsan_blacklist.txt
Differential Revision: https://reviews.llvm.org/D40589

llvm-svn: 319353
2017-11-29 20:10:14 +00:00
Krzysztof Parzyszek f4dcc42e7b [Hexagon] Remove HexagonISD::PACKHL
llvm-svn: 319352
2017-11-29 19:59:29 +00:00
Krzysztof Parzyszek 6a8e5f4b0f [Hexagon] Create helpers extractVector and insertVector in lowering
llvm-svn: 319351
2017-11-29 19:58:10 +00:00
Kostya Kortchinsky cf5b4af820 [scudo] Allow for compile-time choice of the SizeClassMap
Summary:
With this change, we allow someone to chose the `SizeClassMap` they want to use
at compile time via a define.

I feel somewhat unimaginative with the name of the defines, so if someone has a
better idea, let me know. I have been alternating between those and
`SCUDO_USE_xxx_SIZECLASSMAP` which is clearer but also longer. The issue with
those is that it wouldn't be consistent with `SCUDO_TSD_EXCLUSIVE` that should
probably become `SCUDO_USE_EXCLUSIVE_TSD` maybe?

Anyway, naming is hard, and I am not sure what makes more sense!

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

Subscribers: llvm-commits, srhines

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

llvm-svn: 319350
2017-11-29 19:52:09 +00:00
Kuba Mracek 2183c32444 [compiler-rt] Switch from deprecated TARGET_IPHONE_SIMULATOR to TARGET_OS_SIMULATOR
Differential Revision: https://reviews.llvm.org/D39987

llvm-svn: 319349
2017-11-29 19:47:14 +00:00
Kuba Mracek d102535cf8 [asan] Fix macOS FindDynamicShadowStart to consider the last gap in the VM map
It looks FindDynamicShadowStart has a bug: When iterating over the memory map, we will not consider the very last gap in the address space. Let's fix that.

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

llvm-svn: 319348
2017-11-29 19:44:52 +00:00
Kuba Mracek e73d1f13b6 [asan] Don't crash on fclose(NULL)
It's explicitly forbidden to call fclose with NULL, but at least on Darwin, this succeeds and doesn't segfault. To maintain binary compatibility, ASan should survice fclose(NULL) as well.

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

llvm-svn: 319347
2017-11-29 19:43:11 +00:00
Simon Pilgrim 4d2c703492 [X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes (REVERSION)
Accidental commit of incomplete patch

llvm-svn: 319346
2017-11-29 19:37:38 +00:00
Zachary Turner 3e3936da93 Make TypeTableBuilder inherit from TypeCollection.
A couple of places in LLD were passing references to
TypeTableCollections around, which makes it hard to change the
implementation at runtime.  However, these cases only needed to
iterate over the types in the collection, and TypeCollection
already provides a handy abstract interface for this purpose.

By implementing this interface, we can get rid of the need to
pass TypeTableBuilder references around, which should allow us
to swap the implementation at runtime in subsequent patches.

llvm-svn: 319345
2017-11-29 19:35:21 +00:00
Kuba Mracek 21e6efcb51 [asan] Allow getpwnam(NULL) for binary compatibility
Calling getpwnam(NULL) is probably a bug, but at least on Darwin, such a call succeeds without segfaulting. I have some existing code that relies on that. To maintain binary compatibility, ASan should also survive a call to getpwnam with NULL.

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

llvm-svn: 319344
2017-11-29 19:33:35 +00:00
Jonas Hahnfeld 18bec60bc2 [CMake] Refactor testing infrastructure
The code for the two OpenMP runtime libraries was very similar.
Move to common CMake file that is included and provides a simple
interface for adding testsuites. Also add a common check-openmp
target that runs all testsuites that have been registered.

Note that this renames all test options to the common OPENMP
namespace, for example OPENMP_TEST_C_COMPILER instead of
LIBOMP_TEST_COMPILER and so on.

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

llvm-svn: 319343
2017-11-29 19:31:52 +00:00
Jonas Hahnfeld 5af381acad [CMake] Refactor common settings and flags
These are needed by both libraries, so we can do that in a
common namespace and unify configuration parameters.
Also make sure that the user isn't requesting libomptarget
if the library cannot be built on the system. Issue an error
in that case.

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

llvm-svn: 319342
2017-11-29 19:31:48 +00:00
Jonas Hahnfeld 3e921d3c52 [CMake] Disallow direct configuration
As a first step, this allows us to generalize the detection of
standalone builds and make it fully compatible when building in
llvm/runtimes/ which automatically sets OPENMP_STANDLONE_BUILD.

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

llvm-svn: 319341
2017-11-29 19:31:43 +00:00
Zachary Turner 85082013e6 Fix line endings in llvm-pdbutil.cpp
llvm-svn: 319340
2017-11-29 19:29:25 +00:00
Kuba Mracek aa4d9e2a66 [sanitizer] Refactor how assembly files are handled
This renames ASM_TSAN_SYMBOL and ASM_TSAN_SYMBOL_INTERCEPTOR to just ASM_SYMBOL and ASM_SYMBOL_INTERCEPTOR, because they can be useful in more places than just TSan. Also introduce a CMake function to add ASM sources to a target.

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

llvm-svn: 319339
2017-11-29 19:27:25 +00:00
Simon Pilgrim 87034cb498 [X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes
llvm-svn: 319338
2017-11-29 19:19:59 +00:00
Simon Pilgrim 36be852cee [X86][AVX512] Tag 3OP (shuffles, double-shifts and GFNI) instructions scheduler classes
llvm-svn: 319337
2017-11-29 18:52:20 +00:00
Reid Kleckner 820ccee4e1 [clang-cl] Alias /wd4018 to -Wno-sign-compare
This warning is known to be noisy and projects frequently disable it. In
particular, this should make building isl as bundled in polly with
clang-cl a lot quieter.

llvm-svn: 319336
2017-11-29 18:45:03 +00:00
Rafael Espindola ea5610648c Replace another dyn_cast with a cast.
llvm-svn: 319335
2017-11-29 18:43:34 +00:00
Rafael Espindola d42f7e5cae Replace a dyn_cast with a cast.
It is always accessed, so there is no value in a dyn_cast.

llvm-svn: 319334
2017-11-29 18:32:57 +00:00
Devin Coughlin 9a2c14a73a [analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=true
In the original design of the analyzer, it was assumed that a BlockEntrance
doesn't create a new binding on the Store, but this assumption isn't true when
'widen-loops' is set to true. Fix this by finding an appropriate location
BlockEntrace program points.

Patch by Henry Wong!

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

llvm-svn: 319333
2017-11-29 18:25:37 +00:00
Alexey Bataev a1f6fbd9ed [OPENMP] Do not allow `linear` clauses on non-simd distribute
directives.

`linear` clause is not allowed on non-simd distribute-based directives.

llvm-svn: 319332
2017-11-29 18:20:04 +00:00