platform/upstream/llvm.git
5 years ago[AArch64][GlobalISel] Add an optimization to select vector DUP instructions.
Amara Emerson [Tue, 19 Mar 2019 21:43:05 +0000 (21:43 +0000)]
[AArch64][GlobalISel] Add an optimization to select vector DUP instructions.

This adds pattern matching for the insert+shufflevector sequence so we can
generate dup instructions instead of the current TBL sequence.

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

llvm-svn: 356526

5 years ago[AArch64][GlobalISel] Make v4s32 G_IMPLICIT_DEF legal.
Amara Emerson [Tue, 19 Mar 2019 21:43:02 +0000 (21:43 +0000)]
[AArch64][GlobalISel] Make v4s32 G_IMPLICIT_DEF legal.

llvm-svn: 356525

5 years agoRemove MSVC compat hack since the inline keyword was added in 2015
Reid Kleckner [Tue, 19 Mar 2019 21:40:59 +0000 (21:40 +0000)]
Remove MSVC compat hack since the inline keyword was added in 2015

Our minimum MSVC toolchain requirement is greater than 2015, so we don't
need this conditional macro anymore.  New versions of MSVC apparently
have a header, xkeycheck.h, to check that keywords haven't been
redefined.

Fixes PR41144

llvm-svn: 356524

5 years ago[libc++] Complete the ABI changelog after landing <filesystem> in the dylib
Louis Dionne [Tue, 19 Mar 2019 21:32:37 +0000 (21:32 +0000)]
[libc++] Complete the ABI changelog after landing <filesystem> in the dylib

llvm-svn: 356523

5 years ago[Remarks] Fix gcc build for r356519
Francis Visoiu Mistrih [Tue, 19 Mar 2019 21:32:03 +0000 (21:32 +0000)]
[Remarks] Fix gcc build for r356519

Fails here:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/20046/steps/build%20stage%201/logs/stdio

llvm-svn: 356522

5 years ago[DwarfDebug] Add triple to test.
Florian Hahn [Tue, 19 Mar 2019 21:18:59 +0000 (21:18 +0000)]
[DwarfDebug] Add triple to test.

llvm-svn: 356521

5 years ago[InstSimplify] Add additional cmp of abs without nsw tests; NFC
Nikita Popov [Tue, 19 Mar 2019 21:12:21 +0000 (21:12 +0000)]
[InstSimplify] Add additional cmp of abs without nsw tests; NFC

llvm-svn: 356520

5 years agoReland "[Remarks] Add a new Remark / RemarkParser abstraction"
Francis Visoiu Mistrih [Tue, 19 Mar 2019 21:11:07 +0000 (21:11 +0000)]
Reland "[Remarks] Add a new Remark / RemarkParser abstraction"

This adds a Remark class that allows us to share code when working with
remarks.

The C API has been updated to reflect this. Instead of the parser
generating C structs, it's now using a C++ object that is used through
opaque pointers in C. This gives us much more flexibility on what
changes we can make to the internal state of the object and interacts
much better with scenarios where the library is used through dlopen.

* C API updates:
  * move from C structs to opaque pointers and functions
  * the remark type is now an enum instead of a string
* unit tests updates:
  * use mostly the C++ API
  * keep one test for the C API
  * rename to YAMLRemarksParsingTest
* a typo was fixed: AnalysisFPCompute -> AnalysisFPCommute.
* a new error message was added: "expected a remark tag."
* llvm-opt-report has been updated to use the C++ parser instead of the
C API

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

Original llvm-svn: 356491

llvm-svn: 356519

5 years ago[libc++] Build <filesystem> support as part of the dylib
Louis Dionne [Tue, 19 Mar 2019 20:56:13 +0000 (20:56 +0000)]
[libc++] Build <filesystem> support as part of the dylib

Summary:
This patch treats <filesystem> as a first-class citizen of the dylib,
like all other sub-libraries (e.g. <chrono>). As such, it also removes
all special handling for installing the filesystem library separately
or disabling part of the test suite from the lit command line.

Unlike the previous attempt (r356500), this doesn't remove all the
filesystem tests.

Reviewers: mclow.lists, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits

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

llvm-svn: 356518

5 years agoFix CodeGen/arm64-microsoft-status-reg.cpp test
Jordan Rupprecht [Tue, 19 Mar 2019 20:55:14 +0000 (20:55 +0000)]
Fix CodeGen/arm64-microsoft-status-reg.cpp test

Summary: This test is failing after r356499 (verified with `ninja check-clang-codegen`). Update the register selection used in the test from x0 to x8.

Reviewers: arsenm, MatzeB, efriedma

Reviewed By: efriedma

Subscribers: efriedma, wdng, javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

llvm-svn: 356517

5 years agoRevert r356511 "[TailCallElim] Add tailcall elimination pass to LTO pipelines"
Robert Lougher [Tue, 19 Mar 2019 20:54:20 +0000 (20:54 +0000)]
Revert r356511 "[TailCallElim] Add tailcall elimination pass to LTO pipelines"

Due to buildbot failures (LLD tests).

llvm-svn: 356516

5 years agoAdd a spelling of pass_object_size that uses __builtin_dynamic_object_size
Erik Pilkington [Tue, 19 Mar 2019 20:44:18 +0000 (20:44 +0000)]
Add a spelling of pass_object_size that uses __builtin_dynamic_object_size

The attribute pass_dynamic_object_size(n) behaves exactly like
pass_object_size(n), but instead of evaluating __builtin_object_size on calls,
it evaluates __builtin_dynamic_object_size, which has the potential to produce
runtime code when the object size can't be determined statically.

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

llvm-svn: 356515

5 years ago[DwarfDebug] Skip entries to big for 16 bit size field in Dwarf < 5.
Florian Hahn [Tue, 19 Mar 2019 20:37:06 +0000 (20:37 +0000)]
[DwarfDebug] Skip entries to big for 16 bit size field in Dwarf < 5.

Nothing prevents entries from being bigger than the 16 bit size field in
Dwarf < 5. For entries that are too big, just emit an empty entry
instead of crashing.

This fixes PR41038.

Reviewers: probinson, aprantl, davide

Reviewed By: probinson

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

llvm-svn: 356514

5 years ago[OPENMP]Warn if the different allocator is used for the variable.
Alexey Bataev [Tue, 19 Mar 2019 20:33:44 +0000 (20:33 +0000)]
[OPENMP]Warn if the different allocator is used for the variable.

If the allocator was specified for the variable and next one is found
with the different allocator, the warning is emitted, and the allocator
is ignored.

llvm-svn: 356513

5 years ago[libc++] Speed up certain locale functions on Windows
Thomas Anderson [Tue, 19 Mar 2019 20:30:58 +0000 (20:30 +0000)]
[libc++] Speed up certain locale functions on Windows

The issue is that __libcpp_locale_guard makes some slow calls to setlocale().
This change avoids using __libcpp_locale_guard in snprintf_l().

Fixes https://bugs.llvm.org/show_bug.cgi?id=41131

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

llvm-svn: 356512

5 years ago[TailCallElim] Add tailcall elimination pass to LTO pipelines
Robert Lougher [Tue, 19 Mar 2019 20:24:28 +0000 (20:24 +0000)]
[TailCallElim] Add tailcall elimination pass to LTO pipelines

LTO provides additional opportunities for tailcall elimination due to
link-time inlining and visibility of nocapture attribute. Testing showed
negligible impact on compilation times.

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

llvm-svn: 356511

5 years agoDemanded elements support for masked.load and masked.gather
Philip Reames [Tue, 19 Mar 2019 20:10:00 +0000 (20:10 +0000)]
Demanded elements support for masked.load and masked.gather

Teach instcombine to propagate demanded elements through a masked load or masked gather instruction. This is in the broader context of improving vector pointer instcombine under https://reviews.llvm.org/D57140.

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

llvm-svn: 356510

5 years agoDelete more dead code.
Zachary Turner [Tue, 19 Mar 2019 20:08:56 +0000 (20:08 +0000)]
Delete more dead code.

All of this is code that is unreferenced.  Removing as much of
this as possible makes it more easy to determine what functionality
is missing and/or shared between LLVM and LLDB's DWARF interfaces.

llvm-svn: 356509

5 years agoAdd --unwindlib=[libgcc|compiler-rt] to parallel --rtlib= [take 2]
Sterling Augustine [Tue, 19 Mar 2019 20:01:59 +0000 (20:01 +0000)]
Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib= [take 2]

"clang++ hello.cc --rtlib=compiler-rt"

now can works without specifying additional unwind or exception
handling libraries.

This reworked version of the feature no longer modifies today's default
unwind library for compiler-rt: which is nothing. Rather, a user
can specify -DCLANG_DEFAULT_UNWINDLIB=libunwind when configuring
the compiler.

This should address the issues from the previous version.

Update tests for new --unwindlib semantics.

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

llvm-svn: 356508

5 years agoMove options to separate checks that do not need to immediately follow the previous...
Douglas Yung [Tue, 19 Mar 2019 19:34:15 +0000 (19:34 +0000)]
Move options to separate checks that do not need to immediately follow the previous option. NFCI

llvm-svn: 356507

5 years agoCodeGen: Refactor regallocator command line and target selection
Matt Arsenault [Tue, 19 Mar 2019 19:33:12 +0000 (19:33 +0000)]
CodeGen: Refactor regallocator command line and target selection

This will allow targets more flexibility to replace the
register allocator core passes. In a future commit,
AMDGPU will run the core register assignment passes
twice, and will also want to disallow using the
standard -regalloc option.

llvm-svn: 356506

5 years agoRevert "[libc++] Build <filesystem> support as part of the dylib"
Louis Dionne [Tue, 19 Mar 2019 19:27:29 +0000 (19:27 +0000)]
Revert "[libc++] Build <filesystem> support as part of the dylib"

When I applied r356500 (https://reviews.llvm.org/D59152), I somehow
deleted all of filesystem's tests. I will revert r356500 and re-apply
it properly.

llvm-svn: 356505

5 years agoFix char.traits.specializations.char8_t main return
JF Bastien [Tue, 19 Mar 2019 19:25:07 +0000 (19:25 +0000)]
Fix char.traits.specializations.char8_t main return

llvm-svn: 356504

5 years agoFixup ABI lists on Linux after adding <filesystem> to the dylib.
Eric Fiselier [Tue, 19 Mar 2019 19:20:43 +0000 (19:20 +0000)]
Fixup ABI lists on Linux after adding <filesystem> to the dylib.

llvm-svn: 356503

5 years agoAdd visibility attributes and inline to some vector methods.
Eric Fiselier [Tue, 19 Mar 2019 19:19:44 +0000 (19:19 +0000)]
Add visibility attributes and inline to some vector methods.

Adding filesystem to the dylib caused some vector symbols to leak
into the set of exported symbols. This patch hides those symbols.

llvm-svn: 356502

5 years agoRegAllocFast: Do not allocate registers for undef uses
Matt Arsenault [Tue, 19 Mar 2019 19:16:04 +0000 (19:16 +0000)]
RegAllocFast: Do not allocate registers for undef uses

Do not actually allocate a register for an undef use. Previously we we
would create unnecessary reload instruction for undef uses where the
register wasn't live.

Patch by Matthias Braun

llvm-svn: 356501

5 years ago[libc++] Build <filesystem> support as part of the dylib
Louis Dionne [Tue, 19 Mar 2019 19:09:33 +0000 (19:09 +0000)]
[libc++] Build <filesystem> support as part of the dylib

Summary:
This patch treats <filesystem> as a first-class citizen of the dylib,
like all other sub-libraries (e.g. <chrono>). As such, it also removes
all special handling for installing the filesystem library separately
or disabling part of the test suite from the lit command line.

Reviewers: mclow.lists, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits

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

llvm-svn: 356500

5 years agoRegAllocFast: Remove early selection loop, the spill calculation will report cost...
Matt Arsenault [Tue, 19 Mar 2019 19:01:34 +0000 (19:01 +0000)]
RegAllocFast: Remove early selection loop, the spill calculation will report cost 0 anyway for free regs

The 2nd loop calculates spill costs but reports free registers as cost
0 anyway, so there is little benefit from having a separate early
loop.

Surprisingly this is not NFC, as many register are marked regDisabled
so the first loop often picks up later registers unnecessarily instead
of the first one available in the allocation order...

Patch by Matthias Braun

llvm-svn: 356499

5 years agoFix for ABS legalization on PPC buildbot.
Simon Pilgrim [Tue, 19 Mar 2019 18:55:46 +0000 (18:55 +0000)]
Fix for ABS legalization on PPC buildbot.

llvm-svn: 356498

5 years agoFix unused variable warning. NFCI.
Simon Pilgrim [Tue, 19 Mar 2019 18:39:46 +0000 (18:39 +0000)]
Fix unused variable warning. NFCI.

llvm-svn: 356497

5 years ago[OPENMP]Check that global vars require predefined allocator.
Alexey Bataev [Tue, 19 Mar 2019 18:39:11 +0000 (18:39 +0000)]
[OPENMP]Check that global vars require predefined allocator.

According to OpenMP, 2.11.3 allocate Directive, Restrictions, C / C++,
if a list item has a static storage type, the allocator expression in
  the allocator clause must be a constant expression that evaluates to
  one of the predefined memory allocator values. Added check for this
  restriction.

llvm-svn: 356496

5 years agoRemove some dead DWARF enum -> string conversion functions.
Zachary Turner [Tue, 19 Mar 2019 18:32:43 +0000 (18:32 +0000)]
Remove some dead DWARF enum -> string conversion functions.

llvm-svn: 356495

5 years agoAllow unordered loads to be considered invariant in CodeGen
Philip Reames [Tue, 19 Mar 2019 18:27:18 +0000 (18:27 +0000)]
Allow unordered loads to be considered invariant in CodeGen

The actual code change is fairly straight forward, but exercising it isn't. First, it turned out we weren't adding the appropriate flags in SelectionDAG. Second, it turned out that we've got some optimization gaps, so obvious test cases don't work.

My first attempt (in atomic-unordered.ll) points out a deficiency in our peephole-opt folding logic which I plan to fix separately. Instead, I'm exercising this through MachineLICM.

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

llvm-svn: 356494

5 years agoFix fenv.pass.cpp signature for main
JF Bastien [Tue, 19 Mar 2019 18:24:11 +0000 (18:24 +0000)]
Fix fenv.pass.cpp signature for main

And make main return.

llvm-svn: 356493

5 years agoRevert "[Remarks] Add a new Remark / RemarkParser abstraction"
Francis Visoiu Mistrih [Tue, 19 Mar 2019 18:21:43 +0000 (18:21 +0000)]
Revert "[Remarks] Add a new Remark / RemarkParser abstraction"

This reverts commit 51dc6a8c84cd6a58562e320e1828a0158dbbf750.

Breaks
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/20034/steps/build%20stage%201/logs/stdio.

llvm-svn: 356492

5 years ago[Remarks] Add a new Remark / RemarkParser abstraction
Francis Visoiu Mistrih [Tue, 19 Mar 2019 18:09:51 +0000 (18:09 +0000)]
[Remarks] Add a new Remark / RemarkParser abstraction

This adds a Remark class that allows us to share code when working with
remarks.

The C API has been updated to reflect this. Instead of the parser
generating C structs, it's now using a C++ object that is used through
opaque pointers in C. This gives us much more flexibility on what
changes we can make to the internal state of the object and interacts
much better with scenarios where the library is used through dlopen.

* C API updates:
  * move from C structs to opaque pointers and functions
  * the remark type is now an enum instead of a string
* unit tests updates:
  * use mostly the C++ API
  * keep one test for the C API
  * rename to YAMLRemarksParsingTest
* a typo was fixed: AnalysisFPCompute -> AnalysisFPCommute.
* a new error message was added: "expected a remark tag."
* llvm-opt-report has been updated to use the C++ parser instead of the
C API

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

llvm-svn: 356491

5 years agoDelete dead code.
Zachary Turner [Tue, 19 Mar 2019 18:06:32 +0000 (18:06 +0000)]
Delete dead code.

Most of these are Dump functions that are never called, but there
is one instance of entire unused classes (DWARFDebugMacinfo and
DWARFDebugMacinfoEntry) which are also unreferenced in the codebase).

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

llvm-svn: 356490

5 years ago[ValueTracking] Use computeConstantRange() for unsigned add/sub overflow
Nikita Popov [Tue, 19 Mar 2019 17:53:56 +0000 (17:53 +0000)]
[ValueTracking] Use computeConstantRange() for unsigned add/sub overflow

Improve computeOverflowForUnsignedAdd/Sub in ValueTracking by
intersecting the computeConstantRange() result into the ConstantRange
created from computeKnownBits(). This allows us to detect some
additional never/always overflows conditions that can't be determined
from known bits.

This revision also adds basic handling for constants to
computeConstantRange(). Non-splat vectors will be handled in a followup.

The signed case will also be handled in a followup, as it needs some
more groundwork.

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

llvm-svn: 356489

5 years ago[libc++] Mark internal types of std::filesystem as hidden
Louis Dionne [Tue, 19 Mar 2019 17:47:53 +0000 (17:47 +0000)]
[libc++] Mark internal types of std::filesystem as hidden

Summary:
Otherwise, implicit instantiations of templates with these types can
cause the dylib to start exporting the vtable/RTTI of the instantiation.
Giving hidden visibility to those types causes the compiler to understand
that they are not used outside the dylib, and as a result implicitly
instantiated vtables/RTTI of templates with those internal types will
get hidden visibility.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits

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

llvm-svn: 356488

5 years ago[ScriptInterpreterPython] Remove dead code.
Davide Italiano [Tue, 19 Mar 2019 17:35:40 +0000 (17:35 +0000)]
[ScriptInterpreterPython] Remove dead code.

llvm-svn: 356487

5 years ago[StackFrameRecognizer] Remove unneeded LLDB_DISABLE_PYTHON.
Davide Italiano [Tue, 19 Mar 2019 17:35:37 +0000 (17:35 +0000)]
[StackFrameRecognizer] Remove unneeded LLDB_DISABLE_PYTHON.

llvm-svn: 356486

5 years agogn build: Merge r356387.
Peter Collingbourne [Tue, 19 Mar 2019 17:30:59 +0000 (17:30 +0000)]
gn build: Merge r356387.

llvm-svn: 356485

5 years agogn build: Merge r356451.
Peter Collingbourne [Tue, 19 Mar 2019 17:30:50 +0000 (17:30 +0000)]
gn build: Merge r356451.

llvm-svn: 356484

5 years ago[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - handle repeated shift amounts
Simon Pilgrim [Tue, 19 Mar 2019 17:23:25 +0000 (17:23 +0000)]
[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - handle repeated shift amounts

If a value with multiple uses is only ever used for SSE shift amounts then we know that only the bottom 64-bits are needed.

llvm-svn: 356483

5 years ago[AtomicExpand] Fix a crash bug when lowering unordered loads to cmpxchg
Philip Reames [Tue, 19 Mar 2019 17:20:49 +0000 (17:20 +0000)]
[AtomicExpand] Fix a crash bug when lowering unordered loads to cmpxchg

Add tests for wider atomic loads and stores.  In the process, fix a crasher where we appearently handled unorder stores, but not loads, when lowering to cmpxchg idioms.

llvm-svn: 356482

5 years ago[lldb] [Reproducer] Move SBRegistry registration into declaring files
Michal Gorny [Tue, 19 Mar 2019 17:13:13 +0000 (17:13 +0000)]
[lldb] [Reproducer] Move SBRegistry registration into declaring files

Move SBRegistry method registrations from SBReproducer.cpp into files
declaring the individual APIs, in order to reduce the memory consumption
during build and improve maintainability.  The current humongous
SBRegistry constructor exhausts all memory on a NetBSD system with 4G
RAM + 4G swap, therefore making it impossible to build LLDB.

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

llvm-svn: 356481

5 years ago[OPENMP]Remove unused parameter, NFC.
Alexey Bataev [Tue, 19 Mar 2019 17:09:52 +0000 (17:09 +0000)]
[OPENMP]Remove unused parameter, NFC.

Parameter CodeGenModule &CGM is not required for CGOpenMPRuntime member
functions, since class holds the reference to the CGM.

llvm-svn: 356480

5 years ago[OpenCL] Minor improvements in default header testing
Anastasia Stulova [Tue, 19 Mar 2019 17:09:06 +0000 (17:09 +0000)]
[OpenCL] Minor improvements in default header testing

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

llvm-svn: 356479

5 years ago[MIPS][microMIPS] Enable dynamic stack realignment
Simon Atanasyan [Tue, 19 Mar 2019 17:01:24 +0000 (17:01 +0000)]
[MIPS][microMIPS] Enable dynamic stack realignment

Dynamic stack realignment was disabled on micromips by checking if
target has standard encoding. We simply change the condition to skip
Mips16 only.

Patch by Mirko Brkusanin.

Differential Revision: http://reviews.llvm.org/D59499

llvm-svn: 356478

5 years ago[NFC] Fix unused variable in release builds
Jordan Rupprecht [Tue, 19 Mar 2019 16:52:40 +0000 (16:52 +0000)]
[NFC] Fix unused variable in release builds

This was introduced in rL356468.

llvm-svn: 356477

5 years ago[DAGCombine] Fix a miscompile when reducing BUILD_VECTORs to a shuffle
Justin Bogner [Tue, 19 Mar 2019 16:52:00 +0000 (16:52 +0000)]
[DAGCombine] Fix a miscompile when reducing BUILD_VECTORs to a shuffle

In r311255 we added a case where we split vectors whose elements are
all derived from the same input vector so that we could shuffle it
more efficiently. In doing so, createBuildVecShuffle was taught to
adjust for the fact that all indices would be based off of the first
vector when this happens, but it's possible for the code that checked
that to fire incorrectly if we happen to have a BUILD_VECTOR of
extracts from subvectors and don't hit this new optimization.

Instead of trying to detect if we've split the vector by checking if
we have extracts from the same base vector, we can just pass that
information into createBuildVecShuffle, avoiding the miscompile.

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

llvm-svn: 356476

5 years ago[Sema] Adjust addr space of reference operand in compound assignment
Anastasia Stulova [Tue, 19 Mar 2019 16:50:21 +0000 (16:50 +0000)]
[Sema] Adjust addr space of reference operand in compound assignment

When we create overloads for the builtin compound assignment operators
we need to preserve address space for the reference operand taking it
from the argument that is passed in.

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

llvm-svn: 356475

5 years agoFix unused variable warning. NFCI.
Simon Pilgrim [Tue, 19 Mar 2019 16:49:59 +0000 (16:49 +0000)]
Fix unused variable warning. NFCI.

llvm-svn: 356474

5 years ago[Tests] Update to newer ISA
Philip Reames [Tue, 19 Mar 2019 16:46:56 +0000 (16:46 +0000)]
[Tests] Update to newer ISA

There are some issues w/missed opts on older platforms, but that's not the purpose of this test.  Using a newer API points out that some TODOs are already handled, and allows addition of tests to exercise other issues (future patch.)

llvm-svn: 356473

5 years ago[OPENMP] Codegen for local variables with the allocate pragma.
Alexey Bataev [Tue, 19 Mar 2019 16:41:16 +0000 (16:41 +0000)]
[OPENMP] Codegen for local variables with the allocate pragma.

Added initial codegen for the local variables with the #pragma omp
allocate directive. Instead of allocating the variables on the stack,
__kmpc_alloc|__kmpc_free functions are used for memory (de-)allocation.

llvm-svn: 356472

5 years ago[InstCombine] fold logic-of-nan-fcmps (PR41069)
Sanjay Patel [Tue, 19 Mar 2019 16:39:17 +0000 (16:39 +0000)]
[InstCombine] fold logic-of-nan-fcmps (PR41069)

Combine 2 fcmps that are checking for nan-ness:
   and (fcmp ord X, 0), (and (fcmp ord Y, 0), Z) --> and (fcmp ord X, Y), Z
   or  (fcmp uno X, 0), (or  (fcmp uno Y, 0), Z) --> or  (fcmp uno X, Y), Z

This is an exact match for a minimal reassociation pattern.
If we want to handle this more generally that should go in
the reassociate pass and allow removing this code.

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=41069

llvm-svn: 356471

5 years ago[AMDGPU] Add convergent attribute to WWM.
Neil Henning [Tue, 19 Mar 2019 16:32:24 +0000 (16:32 +0000)]
[AMDGPU] Add convergent attribute to WWM.

Add the convergent attribute to the WWM intrinsic to stop it ever being
sunk out of cfg.

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

llvm-svn: 356470

5 years agoRemove a couple of log statements.
Zachary Turner [Tue, 19 Mar 2019 16:26:08 +0000 (16:26 +0000)]
Remove a couple of log statements.

These log statements have questionable value, and hinder the effort
of separating the high and low level DWARF parsing interfaces inside
of LLDB.  Removing them for now, and if/when we need such log statements
again in the future, we can add them back (if possible) or introduce a
mechanism for logging from the low-level interface in such a way that it
isn't coupled to the high level interface.

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

llvm-svn: 356469

5 years ago[SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder...
Simon Pilgrim [Tue, 19 Mar 2019 16:24:55 +0000 (16:24 +0000)]
[SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder::visitSelect

These changes are related to PR37743 and include:

    SelectionDAGBuilder::visitSelect handles the unary SelectPatternFlavor::SPF_ABS case to build ABS node.

    Delete the redundant recognizer of the integer ABS pattern from the DAGCombiner.

    Add promoting the integer ABS node in the LegalizeIntegerType.

    Expand-based legalization of integer result for the ABS nodes.

    Expand-based legalization of ABS vector operations.

    Add some integer abs testcases for different typesizes for Thumb arch

    Add the custom ABS expanding and change the SAD pattern recognizer for X86 arch: The i64 result of the ABS is expanded to:
        tmp = (SRA, Hi, 31)
        Lo = (UADDO tmp, Lo)
        Hi = (XOR tmp, (ADDCARRY tmp, hi, Lo:1))
        Lo = (XOR tmp, Lo)

    The "detectZextAbsDiff" function is changed for the recognition of pattern with the ABS node. Given a ABS node, detect the following pattern:
        (ABS (SUB (ZERO_EXTEND a), (ZERO_EXTEND b))).

    Change integer abs testcases for codegen with the ABS node support for AArch64.
        Indicate that the ABS is legal for the i64 type when the NEON is supported.
        Change the integer abs testcases to show changing of codegen.

    Add combine and legalization of ABS nodes for Thumb arch.

    Extend 'matchSelectPattern' to recognize the ABS patterns with ICMP_SGE condition.

For discussion, see https://bugs.llvm.org/show_bug.cgi?id=37743

Patch by: @ikulagin (Ivan Kulagin)

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

llvm-svn: 356468

5 years ago[TSan][libdispatch] Avoid infinite recursion in dispatch_apply[_f] interceptors
Julian Lettner [Tue, 19 Mar 2019 16:12:59 +0000 (16:12 +0000)]
[TSan][libdispatch] Avoid infinite recursion in dispatch_apply[_f] interceptors

In libdispatch, dispatch_apply is implemented in terms of
dispatch_apply_f. Unfortunately, this means that we can't implement the
interceptor for dispatch_apply_f by forwarding to the dispatch_apply
interceptor.

In the interceptor dispatch_apply_f, we can't use WRAP(dispatch_apply).
WRAP(dispatch_apply) -> REAL(dispatch_apply_f). Requires duplication of
some setup code.

Reviewed By: kubamracek

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

llvm-svn: 356467

5 years ago[llvm-ar] Support N [count] modifier
Jordan Rupprecht [Tue, 19 Mar 2019 16:09:54 +0000 (16:09 +0000)]
[llvm-ar] Support N [count] modifier

Summary:
GNU ar supports the 'N' count modifier for the extract (x) and delete (d) operations. When an archive contains multiple members with the same name, this can be used to extract (or delete) them individually. For example:

```
$ llvm-ar t archive.a
foo
foo
$ llvm-ar x archive.a
-> Writes foo twice, overwriting it the second time :( :(
$ llvm-ar xN 1 archive.a foo && mv foo foo.1
$ llvm-ar xN 2 archive.a foo && mv foo foo.2
-> Write foo twice, renaming it in between invocations to preserve all versions
```

Reviewers: ruiu, MaskRay

Reviewed By: ruiu, MaskRay

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356466

5 years ago[AMDGPU] Add buffer/load 8/16 bit overloaded intrinsics
Ryan Taylor [Tue, 19 Mar 2019 16:07:00 +0000 (16:07 +0000)]
[AMDGPU] Add buffer/load 8/16 bit overloaded intrinsics

Summary:
Add buffer store/load 8/16 overloaded intrinsics for buffer, raw_buffer and struct_buffer

Change-Id: I166a29f071b2ff4e4683fb0392564b1f223ac61d

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 356465

5 years ago[AMDGPU] Ban i8 min3 promotion.
Neil Henning [Tue, 19 Mar 2019 15:50:24 +0000 (15:50 +0000)]
[AMDGPU] Ban i8 min3 promotion.

I found this really weird WWM-related case whereby through the WWM
transformations our isel lowering was trying to promote 2 min's into a
min3 for the i8 type, which our hardware doesn't support.

The new min3_i8.ll test case would previously spew the error:

PromoteIntegerResult #0: t69: i8 = SMIN3 t70, Constant:i8<0>, t68

Before the simple fix to our isel lowering to not do it for i8 MVT's.

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

llvm-svn: 356464

5 years ago[InstCombine] Add missing test for icmp transformation (NFC)
Teresa Johnson [Tue, 19 Mar 2019 15:43:56 +0000 (15:43 +0000)]
[InstCombine] Add missing test for icmp transformation (NFC)

This was split out of D59378. There was no testing for the EQ case in
foldICmpWithDominatingICmp, add one here.

llvm-svn: 356463

5 years agoImprove error handling for Clang module imports.
Adrian Prantl [Tue, 19 Mar 2019 15:38:26 +0000 (15:38 +0000)]
Improve error handling for Clang module imports.

rdar://problem/48883558

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

llvm-svn: 356462

5 years ago[mips] Fix crash on recursive using of .set
Simon Atanasyan [Tue, 19 Mar 2019 15:15:35 +0000 (15:15 +0000)]
[mips] Fix crash on recursive using of .set

Switch to the `MCParserUtils::parseAssignmentExpression` for parsing
assignment expressions in the `.set` directive reduces code and allows
to print an error message instead of crashing in case of incorrect
recursive using of the `.set`.

Fix for the bug https://bugs.llvm.org/show_bug.cgi?id=41053.

Differential Revision: http://reviews.llvm.org/D59452

llvm-svn: 356461

5 years ago[DebugInfo] Move test files added in r356451
Markus Lavin [Tue, 19 Mar 2019 15:15:28 +0000 (15:15 +0000)]
[DebugInfo] Move test files added in r356451

Moved the X86 dependant .ll tests added in r356451 from
test/DebugInfo/Generic to test/DebugInfo/X86.

llvm-svn: 356460

5 years agoFix a "memset clearing an object of non-trivial type" warning in EmulateInstruction
Pavel Labath [Tue, 19 Mar 2019 15:05:55 +0000 (15:05 +0000)]
Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction

This is a new warning which started appearing as of gcc-8. The Opcode
class has a non-trivial constructor, so the idea of the warning is that
code should use that to initialize the object instead of using memset
(which can perturb class invariants set up by the constructor). In this
case, the Opcode default constructor was already clearing the object's
fields so we can just drop the memset call.

While I'm touching the EmulateInstruction constructor, I also move the
initialization of other members into the class declaration.

llvm-svn: 356459

5 years agoEnsure that const variables declared at namespace scope correctly have external linka...
Aaron Ballman [Tue, 19 Mar 2019 14:53:52 +0000 (14:53 +0000)]
Ensure that const variables declared at namespace scope correctly have external linkage when marked as dllexport and targeting the MSVC ABI.

Patch thanks to Zahira Ammarguellat.

llvm-svn: 356458

5 years ago[scudo][standalone] Add string utility functions
Kostya Kortchinsky [Tue, 19 Mar 2019 14:47:05 +0000 (14:47 +0000)]
[scudo][standalone] Add string utility functions

Summary:
Add some string utility functions, notably to format strings, get
lengths, convert a string to a number. Those functions will be
used in reports and flags (coming up next). They were mostly borrowed
from sanitizer_common.

Make use of the string length function in a couple places in the
platform code that was checked in with inlined version of it.

Add some tests.

Reviewers: morehouse, eugenis, vitalybuka, hctim

Reviewed By: morehouse, vitalybuka

Subscribers: mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 356457

5 years ago[InstSimplify] SimplifyICmpInst - icmp eq/ne %X, undef -> undef
Simon Pilgrim [Tue, 19 Mar 2019 14:08:23 +0000 (14:08 +0000)]
[InstSimplify] SimplifyICmpInst - icmp eq/ne %X, undef -> undef

As discussed on PR41125 and D59363, we have a mismatch between icmp eq/ne cases with an undef operand:

When the other operand is constant we fold to undef (handled in ConstantFoldCompareInstruction)
When the other operand is non-constant we fold to a bool constant based on isTrueWhenEqual (handled in SimplifyICmpInst).

Neither is really wrong, but this patch changes the logic in SimplifyICmpInst to consistently fold to undef.

The NewGVN test change is annoying (as with most heavily reduced tests) but AFAICT I have kept the purpose of the test based on rL291968.

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

llvm-svn: 356456

5 years ago[ASTImporter] Fix redecl failures of FunctionTemplateSpec
Gabor Marton [Tue, 19 Mar 2019 14:04:50 +0000 (14:04 +0000)]
[ASTImporter] Fix redecl failures of FunctionTemplateSpec

Summary:
Redecl chains of function template specializations are not handled well
currently. We want to handle them similarly to functions, i.e. try to
keep the structure of the original AST as much as possible. The aim is
to not squash a prototype with a definition, rather we create both and
put them in a redecl chain.

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 356455

5 years ago[DebugInfoMetadata] Move main subprogram DIFlag into DISPFlags
Petar Jovanovic [Tue, 19 Mar 2019 13:49:03 +0000 (13:49 +0000)]
[DebugInfoMetadata] Move main subprogram DIFlag into DISPFlags

Moving subprogram specific flags into DISPFlags makes IR code more readable.
In addition, we provide free space in DIFlags for other
'non-subprogram-specific' debug info flags.

Patch by Djordje Todorovic.

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

llvm-svn: 356454

5 years ago[InstCombine] add FMF to tests for extra coverage; NFC
Sanjay Patel [Tue, 19 Mar 2019 13:39:29 +0000 (13:39 +0000)]
[InstCombine] add FMF to tests for extra coverage; NFC

ninf is probably the only relevant possible flag here
(nnan allows simplification and nsz never makes a difference).

llvm-svn: 356453

5 years ago[ASTImporter] Fix redecl failures of ClassTemplateSpec
Gabor Marton [Tue, 19 Mar 2019 13:34:10 +0000 (13:34 +0000)]
[ASTImporter] Fix redecl failures of ClassTemplateSpec

Summary:
Redecl chains of class template specializations are not handled well
currently. We want to handle them similarly to functions, i.e. try to
keep the structure of the original AST as much as possible. The aim is
to not squash a prototype with a definition, rather we create both and
put them in a redecl chain.

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356452

5 years ago[DebugInfo] Introduce DW_OP_LLVM_convert
Markus Lavin [Tue, 19 Mar 2019 13:16:28 +0000 (13:16 +0000)]
[DebugInfo] Introduce DW_OP_LLVM_convert

Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

This is a recommit of r356442 with trivial fixes for the failing tests.

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

llvm-svn: 356451

5 years ago[OpenCL] Improved testing of default header.
Anastasia Stulova [Tue, 19 Mar 2019 13:04:17 +0000 (13:04 +0000)]
[OpenCL] Improved testing of default header.

Improved some checks and moved testing of the default header
in C++ mode into the Headers folder.

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

llvm-svn: 356450

5 years ago[clang-format] [JS] handle private members.
Martin Probst [Tue, 19 Mar 2019 12:28:41 +0000 (12:28 +0000)]
[clang-format] [JS] handle private members.

Addresses PR40999 https://bugs.llvm.org/show_bug.cgi?id=40999

Private fields and methods in JavaScript would get incorrectly indented
(it sees them as preprocessor directives and hence left aligns them)

In this revision `#identifier` tokens `tok::hash->tok::identifier` are
merged into a single new token `tok::identifier` with the `#` contained
inside the TokenText.

Before:

```
class Example {
  pub = 1;

  static pub2 = "foo";
  static #priv2 = "bar";

  method() { this.#priv = 5; }

  static staticMethod() {
    switch (this.#priv) {
    case '1':
      break;
    }
  }

  this.#privateMethod(); // infinite loop
}

static #staticPrivateMethod() {}
}
```

After this fix the code will be correctly indented

```
class Example {
  pub = 1;
  #priv = 2;

  static pub2 = "foo";
  static #priv2 = "bar";

  method() { this.#priv = 5; }

  static staticMethod() {
    switch (this.#priv) {
    case '1':
      #priv = 3;
      break;
    }
  }

  #privateMethod() {
    this.#privateMethod(); // infinite loop
  }

  static #staticPrivateMethod() {}
}
```

NOTE: There might be some JavaScript code out there which uses the C
processor to preprocess .js files
http://www.nongnu.org/espresso/js-cpp.html. It's not clear how this
revision or even private fields and methods would interact.

Patch originally by MyDeveloperDays (thanks!).

llvm-svn: 356449

5 years ago[InstCombine] Regenerate + add icmp with undef tests
Simon Pilgrim [Tue, 19 Mar 2019 11:44:22 +0000 (11:44 +0000)]
[InstCombine] Regenerate + add icmp with undef tests

Better test coverage for PR41125 and D59363

llvm-svn: 356448

5 years ago[clang-format] [JS] Don't break between template string and tag
Martin Probst [Tue, 19 Mar 2019 11:15:52 +0000 (11:15 +0000)]
[clang-format] [JS] Don't break between template string and tag

Before:
    const x = veryLongIdentifier
        `hello`;
After:
    const x =
        veryLongIdentifier`hello`;

While it's allowed to have the template string and tag identifier
separated by a line break, currently the clang-format output is not
stable when a break is forced. Additionally, disallowing a line break
makes it clear that the identifier is actually a tag for a template
string.

Patch originally by mitchellwills (thanks!).

llvm-svn: 356447

5 years ago[Tooling] Add more scope specifiers until spelling is not ambiguous.
Eric Liu [Tue, 19 Mar 2019 10:12:15 +0000 (10:12 +0000)]
[Tooling] Add more scope specifiers until spelling is not ambiguous.

Summary:
Previously, when the renamed spelling is ambiguous, we simply use the
full-qualfied name (with leading "::"). This patch makes it try adding
additional specifiers one at a time until name is no longer ambiguous,
which allows us to find better disambuguated spelling.

Reviewers: kadircet, gribozavr

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356446

5 years ago[clangd] Add support for type hierarchy (super types only for now)
Kadir Cetinkaya [Tue, 19 Mar 2019 09:27:04 +0000 (09:27 +0000)]
[clangd] Add support for type hierarchy (super types only for now)

Summary:
Patch by Nathan Ridge(@nridge)!

This is an LSP extension proposed here:
https://github.com/Microsoft/vscode-languageserver-node/pull/426

An example client implementation can be found here:
https://github.com/theia-ide/theia/pull/3802

Reviewers: kadircet, sammccall

Reviewed By: kadircet

Subscribers: jdoerfert, sammccall, cfe-commits, mgorny, dschaefer, simark, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet

Tags: #clang

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

llvm-svn: 356445

5 years agoRevert "[DebugInfo] Introduce DW_OP_LLVM_convert"
Markus Lavin [Tue, 19 Mar 2019 09:17:28 +0000 (09:17 +0000)]
Revert "[DebugInfo] Introduce DW_OP_LLVM_convert"

This reverts commit 1cf4b593a7ebd666fc6775f3bd38196e8e65fafe.

Build bots found failing tests not detected locally.

Failing Tests (3):
  LLVM :: DebugInfo/Generic/convert-debugloc.ll
  LLVM :: DebugInfo/Generic/convert-inlined.ll
  LLVM :: DebugInfo/Generic/convert-linked.ll

llvm-svn: 356444

5 years agoUse response file when generating LLVM-C.dll
Serge Guelton [Tue, 19 Mar 2019 09:14:09 +0000 (09:14 +0000)]
Use response file when generating LLVM-C.dll

As discovered in D56774 the command line gets to long, so use a response file
to give the script the libs. This change has been tested and is confirmed
working for me.

Commited on behalf of Jakob Bornecrantz.
Differential Revision: https://reviews.llvm.org/D56781

llvm-svn: 356443

5 years ago[DebugInfo] Introduce DW_OP_LLVM_convert
Markus Lavin [Tue, 19 Mar 2019 08:48:19 +0000 (08:48 +0000)]
[DebugInfo] Introduce DW_OP_LLVM_convert

Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

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

llvm-svn: 356442

5 years agoRefactor cast<>'s in if conditionals, which can only assert on failure.
Don Hinton [Tue, 19 Mar 2019 06:14:14 +0000 (06:14 +0000)]
Refactor cast<>'s in if conditionals, which can only assert on failure.

Summary:
This patch refactors several instances of cast<> used in if
conditionals.  Since cast<> asserts on failure, the else branch can
never be taken.

In some cases, the fix is to replace cast<> with dyn_cast<>.  While
others required the removal of the conditional and some minor
refactoring.

A discussion can be seen here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190318/265044.html

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

llvm-svn: 356441

5 years ago[WebAssembly] Small improvements in FixIrreducibleControlFlow (NFC)
Heejin Ahn [Tue, 19 Mar 2019 05:26:33 +0000 (05:26 +0000)]
[WebAssembly] Small improvements in FixIrreducibleControlFlow (NFC)

Summary:
- Make some class member methods const
- Delete unnecessary includes
- Use a simpler form of `BuildMI`

Reviewers: kripken

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356440

5 years ago[WebAssembly] Improve readability of irreducibility tests
Heejin Ahn [Tue, 19 Mar 2019 05:10:39 +0000 (05:10 +0000)]
[WebAssembly] Improve readability of irreducibility tests

Summary:
This adds `preds` comment lines to BB names for readability, while also
fixes some of existing incorrect comment lines. Also deletes a few
unnecessary attributes. Autogenerated by `opt`.

Reviewers: kripken

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356439

5 years ago[WebAssembly] Rename methods according to instruction name changes (NFC)
Heejin Ahn [Tue, 19 Mar 2019 05:07:33 +0000 (05:07 +0000)]
[WebAssembly] Rename methods according to instruction name changes (NFC)

Reviewers: tlively, sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356438

5 years ago[WebAssembly] Add immarg attribute to intrinsics
Heejin Ahn [Tue, 19 Mar 2019 05:02:30 +0000 (05:02 +0000)]
[WebAssembly] Add immarg attribute to intrinsics

Summary:
After r355981, intrinsic arguments that are immediate values should be
marked as `ImmArg`.

Reviewers: dschuff, tlively

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356437

5 years ago[WebAssembly] Change wasm.throw's first argument to an immediate
Heejin Ahn [Tue, 19 Mar 2019 04:58:59 +0000 (04:58 +0000)]
[WebAssembly] Change wasm.throw's first argument to an immediate

Summary:
`wasm.throw` builtin's first 'tag' argument should be an immediate index
into the event section.

Reviewers: dschuff, craig.topper

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

llvm-svn: 356436

5 years agoMark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These...
Marshall Clow [Tue, 19 Mar 2019 03:30:07 +0000 (03:30 +0000)]
Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These are just rebranded 'operator[]', and should be noexcept like it is.

llvm-svn: 356435

5 years ago[CodeGen] LLVM OpenMP Backend.
Michael Kruse [Tue, 19 Mar 2019 03:18:21 +0000 (03:18 +0000)]
[CodeGen] LLVM OpenMP Backend.

The ParallelLoopGenerator class is changed such that GNU OpenMP specific
code was removed, allowing to use it as super class in a
template-pattern. Therefore, the code has been reorganized and one may
not use the ParallelLoopGenerator directly anymore, instead specific
implementations have to be provided. These implementations contain the
library-specific code. As such, the "GOMP" (code completely taken from
the existing backend) and "KMP" variant were created.

For "check-polly" all tests that involved "GOMP": equivalents were added
that test the new functionalities, like static scheduling and different
chunk sizes. "docs/UsingPollyWithClang.rst" shows how the alternative
backend may be used.

Patch by Michael Halkenhäuser <michaelhalk@web.de>

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

llvm-svn: 356434

5 years agoFactor out repeated code parsing and concatenating header-names from
Richard Smith [Tue, 19 Mar 2019 01:51:19 +0000 (01:51 +0000)]
Factor out repeated code parsing and concatenating header-names from
tokens.

We now actually form an angled_string_literal token for a header name by
concatenation rather than just working out what its contents would be.
This substantially simplifies downstream processing and is necessary for
C++20 header unit imports.

llvm-svn: 356433

5 years agoDon't apply the include depth limit until we actually decide to enter
Richard Smith [Tue, 19 Mar 2019 01:51:17 +0000 (01:51 +0000)]
Don't apply the include depth limit until we actually decide to enter
the file.

NFC unless a skipped #include is found at the final permitted #include
level.

llvm-svn: 356432

5 years ago[WebAssembly] Lower SIMD nnan setcc nodes
Thomas Lively [Tue, 19 Mar 2019 00:55:34 +0000 (00:55 +0000)]
[WebAssembly] Lower SIMD nnan setcc nodes

Summary:
Adds patterns to lower all the remaining setcc modes: lt, gt,
le, and ge. Fixes PR40912.

Reviewers: aheejin, sbc100, dschuff

Reviewed By: dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, jdoerfert, llvm-commits, srj

Tags: #llvm

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

llvm-svn: 356431

5 years agoMinor renaming as suggested in review [NFC]
Aaron Puchert [Tue, 19 Mar 2019 00:14:46 +0000 (00:14 +0000)]
Minor renaming as suggested in review [NFC]

See D59455.

llvm-svn: 356430

5 years agoRemove unused try catch blocks from old debug tests
Eric Fiselier [Tue, 19 Mar 2019 00:00:30 +0000 (00:00 +0000)]
Remove unused try catch blocks from old debug tests

llvm-svn: 356429

5 years ago[ELF] Allow sh_entsize to be unrelated to sh_addralign and not a power of 2
Fangrui Song [Mon, 18 Mar 2019 23:49:18 +0000 (23:49 +0000)]
[ELF] Allow sh_entsize to be unrelated to sh_addralign and not a power of 2

Summary:
This implements Rui Ueyama's idea in PR39044.
I've checked that ld.bfd and gold do not have the power-of-2 requirement
and do not require sh_entsize to be a multiple of sh_align.

Now on the updated test merge-entsize.s, all the 3 linkers happily
create .rodata that is not 3-byte aligned.

This has a use case in Linux arch/x86/crypto/sha512-avx2-asm.S
It uses sh_entsize of 640, which is not a power of 2.
See https://github.com/ClangBuiltLinux/linux/issues/417

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: nickdesaulniers, E5ten, emaste, arichardson, llvm-commits

Tags: #llvm

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

llvm-svn: 356428

5 years agoThread safety analysis: Add note for unlock kind mismatch
Aaron Puchert [Mon, 18 Mar 2019 23:26:54 +0000 (23:26 +0000)]
Thread safety analysis: Add note for unlock kind mismatch

Summary:
Similar to D56967, we add the existing diag::note_locked_here to tell
the user where we saw the locking that isn't matched correctly.

Reviewers: aaron.ballman, delesley

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 356427