platform/upstream/llvm.git
5 years agoAMDGPU: Fix a SIAnnotateControlFlow issue when there are multiple backedges.
Changpeng Fang [Fri, 15 Mar 2019 21:02:48 +0000 (21:02 +0000)]
AMDGPU: Fix a SIAnnotateControlFlow issue when there are multiple backedges.

Summary:
At the exit of the loop, the compiler uses a register to remember and accumulate
the number of threads that have already exited. When all active threads exit the
loop, this register is used to restore the exec mask, and the execution continues
for the post loop code.

When there is a "continue" in the loop, the compiler made a mistake to reset the
register to 0 when the "continue" backedge is taken. This will result in some
threads not executing the post loop code as they are supposed to.

This patch fixed the issue.

Reviewers:
  nhaehnle, arsenm

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

llvm-svn: 356298

5 years ago[CMake] Correct CMake message mode
Alex Langford [Fri, 15 Mar 2019 20:43:53 +0000 (20:43 +0000)]
[CMake] Correct CMake message mode

Summary:
This wasn't actually printing out a CMake warning, it was prepending
"WARN" to the message.

Reviewers: zturner

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 356297

5 years ago[coroutines][PR40978] Emit error for co_yield within catch block
Brian Gesiak [Fri, 15 Mar 2019 20:25:49 +0000 (20:25 +0000)]
[coroutines][PR40978] Emit error for co_yield within catch block

Summary:
As reported in https://bugs.llvm.org/show_bug.cgi?id=40978, it's an
error to use the `co_yield` or `co_await` keywords outside of a valid
"suspension context" as defined by [expr.await]p2 of
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4775.pdf.

Whether or not the current scope was in a function-try-block's
(https://en.cppreference.com/w/cpp/language/function-try-block) handler
could be determined using scope flag `Scope::FnTryCatchScope`. No
such flag existed for a simple C++ catch statement, so this commit adds
one.

Reviewers: GorNishanov, tks2103, rsmith

Reviewed By: GorNishanov

Subscribers: EricWF, jdoerfert, cfe-commits, lewissbaker

Tags: #clang

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

llvm-svn: 356296

5 years ago[CMake] Fix broken uses of `try_compile_only()` and improve the function.
Dan Liew [Fri, 15 Mar 2019 20:14:46 +0000 (20:14 +0000)]
[CMake] Fix broken uses of `try_compile_only()` and improve the function.

Summary:
There were existing calls to `try_compile_only()` with arguments not
prefixed by `SOURCE` or `FLAGS`. These were silently being ignored.
It looks like the `SOURCE` and `FLAGS` arguments were first introduced
in r278454.

One implication of this is that for a builtins only build for Darwin
(see `darwin_test_archs()`) it would mean we weren't actually passing
`-arch <arch>` to the compiler). This would result in compiler-rt
claiming all supplied architectures could be targetted provided
the compiler could build for Clang's default architecture.

This patch fixes this in several ways.

* Fixes all incorrect calls to `try_compile_only()`.
* Adds code to `try_compile_only()` to check for unhandled arguments
  and raises a fatal error if this occurs. This should stop any
  incorrect calls in the future.
* Improve the documentation on `try_compile_only()` which seemed
  completely wrong.

rdar://problem/48928526

Reviewers: beanz, fjricci, dsanders, kubamracek, yln, dcoughlin

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

Tags: #llvm, #sanitizers

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

llvm-svn: 356295

5 years ago[X86] Strip the SAE bit from the rounding mode passed to the _RND opcodes. Use Target...
Craig Topper [Fri, 15 Mar 2019 19:59:35 +0000 (19:59 +0000)]
[X86] Strip the SAE bit from the rounding mode passed to the _RND opcodes. Use TargetConstant to save a conversion in the isel table.

The asm parser generates the immediate without the SAE bit. So for consistency we should generate the MCInst the same way from CodeGen.

Since they are now both the same, remove the masking from the printer and replace with an llvm_unreachable.

Use a target constant since we're rebuilding the node anyway. Then we don't have to have isel convert it. Saves about 500 bytes from the isel table.

llvm-svn: 356294

5 years ago[SimplifyDemandedVec] Strengthen handling all undef lanes (particularly GEPs)
Philip Reames [Fri, 15 Mar 2019 19:54:06 +0000 (19:54 +0000)]
[SimplifyDemandedVec] Strengthen handling all undef lanes (particularly GEPs)

A change of two parts:
1) A generic enhancement for all callers of SDVE to exploit the fact that if all lanes are undef, the result is undef.
2) A GEP specific piece to strengthen/fix the vector index undef element handling, and call into the generic infrastructure when visiting the GEP.

The result is that we replace a vector gep with at least one undef in each lane with a undef.  We can also do the same for vector intrinsics.  Once the masked.load patch (D57372) has landed, I'll update to include call tests as well.

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

llvm-svn: 356293

5 years ago[X86][SSE] Fold scalar_to_vector(i64 anyext(x)) -> bitcast(scalar_to_vector(i32 anyex...
Simon Pilgrim [Fri, 15 Mar 2019 19:14:28 +0000 (19:14 +0000)]
[X86][SSE] Fold scalar_to_vector(i64 anyext(x)) -> bitcast(scalar_to_vector(i32 anyext(x)))

Reduce the size of an any-extended i64 scalar_to_vector source to i32 - the any_extend nodes are often introduced by SimplifyDemandedBits.

llvm-svn: 356292

5 years ago[CUDA][Windows] Partial fix for bug 38811 (Step 2 of 3)
Evgeny Mankov [Fri, 15 Mar 2019 19:04:46 +0000 (19:04 +0000)]
[CUDA][Windows] Partial fix for bug 38811 (Step 2 of 3)

Partial fix for the clang Bug 38811 "Clang fails to compile with CUDA-9.x on Windows".

[Synopsis]
__sptr is a new Microsoft specific modifier (https://docs.microsoft.com/en-us/cpp/cpp/sptr-uptr?view=vs-2017).

[Solution]
Replace all `__sptr` occurrences with `__s` (and all `__cptr` with `__c` as well) to eliminate the below clang compilation error on Windows.

In file included from C:\GIT\LLVM\trunk\llvm-64-release-vs2017-15.9.5\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:162:
C:\GIT\LLVM\trunk\llvm-64-release-vs2017-15.9.5\dist\lib\clang\9.0.0\include\__clang_cuda_device_functions.h:524:33: error: expected expression
  return __nv_fast_sincosf(__a, __sptr, __cptr);
                                ^
Reviewed by: Artem Belevich

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

llvm-svn: 356291

5 years ago[ValueTracking] Use ConstantRange overflow checks for unsigned add/sub; NFC
Nikita Popov [Fri, 15 Mar 2019 18:37:45 +0000 (18:37 +0000)]
[ValueTracking] Use ConstantRange overflow checks for unsigned add/sub; NFC

Use the methods introduced in rL356276 to implement the
computeOverflowForUnsigned(Add|Sub) functions in ValueTracking, by
converting the KnownBits into a ConstantRange.

This is NFC: The existing KnownBits based implementation uses the same
logic as the the ConstantRange based one. This is not the case for the
signed equivalents, so I'm only changing unsigned here.

This is in preparation for D59386, which will also intersect the
computeConstantRange() result into the range determined from KnownBits.

llvm-svn: 356290

5 years ago[OpenMP] Add missing parenthesis in Perl module
Jonathan Peyton [Fri, 15 Mar 2019 18:27:14 +0000 (18:27 +0000)]
[OpenMP] Add missing parenthesis in Perl module

llvm-svn: 356289

5 years ago[OpenMP] Remove deprecated taskq
Jonathan Peyton [Fri, 15 Mar 2019 18:24:59 +0000 (18:24 +0000)]
[OpenMP] Remove deprecated taskq

Remove very old, unused, and deprecated taskq code.

Patch by Terry Wilmarth

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

llvm-svn: 356288

5 years ago[InstCombine] add tests for logic of NaN fcmps; NFC
Sanjay Patel [Fri, 15 Mar 2019 18:14:25 +0000 (18:14 +0000)]
[InstCombine] add tests for logic of NaN fcmps; NFC

llvm-svn: 356287

5 years ago[ConstantRange] Try to fix compiler warnings; NFC
Nikita Popov [Fri, 15 Mar 2019 18:08:06 +0000 (18:08 +0000)]
[ConstantRange] Try to fix compiler warnings; NFC

Try to fix "ignoring return value" and "default label" errors on
clang-with-thin-lto-ubuntu buildbot.

llvm-svn: 356286

5 years ago[tests] Add a test for constexpr mask as requested in D57372
Philip Reames [Fri, 15 Mar 2019 18:06:32 +0000 (18:06 +0000)]
[tests] Add a test for constexpr mask as requested in D57372

llvm-svn: 356285

5 years agoAbbreviation declarations are required to have non-null tags.
Zachary Turner [Fri, 15 Mar 2019 18:00:43 +0000 (18:00 +0000)]
Abbreviation declarations are required to have non-null tags.

Treat a null tag as an error.

llvm-svn: 356284

5 years ago[InstCombine] add tests for masked store/scatter; NFC
Sanjay Patel [Fri, 15 Mar 2019 18:00:28 +0000 (18:00 +0000)]
[InstCombine] add tests for masked store/scatter; NFC

Baseline tests for D57247

llvm-svn: 356283

5 years ago[AArch64][GlobalISel] Regbankselect: Fix G_BUILD_VECTOR trying to use s16 gpr sources.
Amara Emerson [Fri, 15 Mar 2019 18:00:01 +0000 (18:00 +0000)]
[AArch64][GlobalISel] Regbankselect: Fix G_BUILD_VECTOR trying to use s16 gpr sources.

Since we can't insert s16 gprs as we don't have 16 bit GPR registers, we need to
teach RBS to assign them to the FPR bank so our selector works.

llvm-svn: 356282

5 years ago[TSan][libdispatch] Enable linking and running of tests on Linux
Julian Lettner [Fri, 15 Mar 2019 17:52:27 +0000 (17:52 +0000)]
[TSan][libdispatch] Enable linking and running of tests on Linux

When COMPILER_RT_INTERCEPT_LIBDISPATCH is ON the TSan runtime library
now has a dependency on the blocks runtime and libdispatch. Make sure we
set all the required linking options.

Also add cmake options for specifying additional library paths to
instruct the linker where to search for libdispatch and the blocks
runtime. This allows us to build TSan runtime with libdispatch support
without installing those libraries into default linker library paths.

`CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY` is necessary to avoid
aborting the build due to failing the link step in CMake's
check_c_compiler test.

Reviewed By: dvyukov, kubamracek

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

llvm-svn: 356281

5 years ago[X86][GlobalISEL] Support lowering aligned unordered atomics
Philip Reames [Fri, 15 Mar 2019 17:50:30 +0000 (17:50 +0000)]
[X86][GlobalISEL] Support lowering aligned unordered atomics

The existing lowering code is accidentally correct for unordered atomics as far as I can tell. An unordered atomic has no memory ordering, and simply requires the actual load or store to be done as a single well aligned instruction. As such, relax the restriction while adding tests to ensure the lowering remains correct in the future.

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

llvm-svn: 356280

5 years ago[BPF] handle external global properly
Yonghong Song [Fri, 15 Mar 2019 17:39:10 +0000 (17:39 +0000)]
[BPF] handle external global properly

Previous commit 6bc58e6d3dbd ("[BPF] do not generate unused local/global types")
tried to exclude global variable from type generation. The condition is:
     if (Global.hasExternalLinkage())
       continue;
This is not right. It also excluded initialized globals.

The correct condition (from AssemblyWriter::printGlobal()) is:
  if (!GV->hasInitializer() && GV->hasExternalLinkage())
    Out << "external ";

Let us do the same in BTF type generation. Also added a test for it.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356279

5 years agoReturn Error and Expected from more DWARF interfaces.
Zachary Turner [Fri, 15 Mar 2019 17:32:05 +0000 (17:32 +0000)]
Return Error and Expected from more DWARF interfaces.

This continues the work of introducing Error and Expected into
the DWARF parsing interfaces, this time for the DWARFCompileUnit
and DWARFDebugAranges classes.

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

llvm-svn: 356278

5 years ago[HIP-Clang] propagate -mllvm options to opt and llc
Aaron Enye Shi [Fri, 15 Mar 2019 17:31:51 +0000 (17:31 +0000)]
[HIP-Clang] propagate -mllvm options to opt and llc

Change the HIP Toolchain to pass the OPT_mllvm options into OPT and LLC stages. Added a lit test to verify the command args.

Reviewers: yaxunl

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

llvm-svn: 356277

5 years ago[ConstantRange] Add overflow check helpers
Nikita Popov [Fri, 15 Mar 2019 17:29:05 +0000 (17:29 +0000)]
[ConstantRange] Add overflow check helpers

Add functions to ConstantRange that determine whether the
unsigned/signed addition/subtraction of two ConstantRanges
may/always/never overflows. This will allow checking overflow
conditions based on known constant ranges in addition to known bits.

I'm implementing these methods on ConstantRange to allow them to be
unit tested independently of any ValueTracking machinery. The tests
include exhaustive testing on 4-bit ranges, to make sure the result
is both conservatively correct and maximally precise.

The OverflowResult enum is redeclared on ConstantRange, because
I wanted to avoid a dependency in either direction between
ValueTracking.h and ConstantRange.h.

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

llvm-svn: 356276

5 years agoImplement a better way of not passing the sanitizer environment on to tests.
Adrian Prantl [Fri, 15 Mar 2019 17:22:00 +0000 (17:22 +0000)]
Implement a better way of not passing the sanitizer environment on to tests.

rdar://problem/48889580

llvm-svn: 356275

5 years ago[AArch64] Regenerate build vector tests
Simon Pilgrim [Fri, 15 Mar 2019 17:17:37 +0000 (17:17 +0000)]
[AArch64] Regenerate build vector tests

llvm-svn: 356274

5 years ago[SelectionDAG] Add SimplifyDemandedBits handling for ISD::SCALAR_TO_VECTOR
Simon Pilgrim [Fri, 15 Mar 2019 17:00:55 +0000 (17:00 +0000)]
[SelectionDAG] Add SimplifyDemandedBits handling for ISD::SCALAR_TO_VECTOR

Fixes a lot of constant folding mismatches between i686 and x86_64

llvm-svn: 356273

5 years ago[LLVM-C] Expose the "Add Discriminators" Pass To LLVM-C
Robert Widmann [Fri, 15 Mar 2019 16:57:23 +0000 (16:57 +0000)]
[LLVM-C] Expose the "Add Discriminators" Pass To LLVM-C

Summary: Add bindings to create a wrapped "Add Discriminators" pass.  Now that we have debug info support, this is a handy transform to have.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: dblaikie, aprantl, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 356272

5 years ago[DataFormatters] Remove LLDB_DISABLE_PYTHON from TypeCategory.
Davide Italiano [Fri, 15 Mar 2019 16:55:51 +0000 (16:55 +0000)]
[DataFormatters] Remove LLDB_DISABLE_PYTHON from TypeCategory.

llvm-svn: 356271

5 years ago[X86] Add SimplifyDemandedBitsForTargetNode support for PINSRB/PINSRW
Simon Pilgrim [Fri, 15 Mar 2019 16:16:49 +0000 (16:16 +0000)]
[X86] Add SimplifyDemandedBitsForTargetNode support for PINSRB/PINSRW

llvm-svn: 356270

5 years agoYAMLIO: Improve endian type support
Pavel Labath [Fri, 15 Mar 2019 15:34:10 +0000 (15:34 +0000)]
YAMLIO: Improve endian type support

Summary:
Now that endian types support enumerations (D59141), the existing yaml
support for them is somewhat insufficient. The current solution was to
define the ScalarTraits class for these types, which always forwards to
the ScalarTraits of the underlying type. However, the enum types will
usually have ScalarEnumerationTraits of ScalarBitsetTraits.

In this patch I add the two extra Traits types to the endian types. In
order to properly SFINAE-ize them, I've also added an extra "Enable"
template argument to the Traits template classes.

Reviewers: zturner, sammccall

Subscribers: kristina, Bigcheese, llvm-commits

Tags: #llvm

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

llvm-svn: 356269

5 years ago[ThinLTO] Restructure AliasSummary to contain ValueInfo of Aliasee
Teresa Johnson [Fri, 15 Mar 2019 15:11:38 +0000 (15:11 +0000)]
[ThinLTO] Restructure AliasSummary to contain ValueInfo of Aliasee

Summary:
The AliasSummary previously contained the AliaseeGUID, which was only
populated when reading the summary from bitcode. This patch changes it
to instead hold the ValueInfo of the aliasee, and always populates it.
This enables more efficient access to the ValueInfo (specifically in the
recent patch r352438 which needed to perform an index hash table lookup
using the aliasee GUID).

As noted in the comments in AliasSummary, we no longer technically need
to keep a pointer to the corresponding aliasee summary, since it could
be obtained by walking the list of summaries on the ValueInfo looking
for the summary in the same module. However, I am concerned that this
would be inefficient when walking through the index during the thin
link for various analyses. That can be reevaluated in the future.

By always populating this new field, we can remove the guard and special
handling for a 0 aliasee GUID when dumping the dot graph of the summary.

An additional improvement in this patch is when reading the summaries
from LLVM assembly we now set the AliaseeSummary field to the aliasee
summary in that same module, which makes it consistent with the behavior
when reading the summary from bitcode.

Reviewers: pcc, mehdi_amini

Subscribers: inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits

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

llvm-svn: 356268

5 years ago[Hexagon] Remove icmp undef from reduced tests
Simon Pilgrim [Fri, 15 Mar 2019 15:07:44 +0000 (15:07 +0000)]
[Hexagon] Remove icmp undef from reduced tests

Pre-commit for D59363 (Add icmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @kparzysz (Krzysztof Parzyszek)

llvm-svn: 356267

5 years agoUpdate a deque test with more assertions. NFC
Marshall Clow [Fri, 15 Mar 2019 15:00:41 +0000 (15:00 +0000)]
Update a deque test with more assertions. NFC

llvm-svn: 356266

5 years ago[llvm] Skip over empty line table entries.
Mircea Trofin [Fri, 15 Mar 2019 15:00:12 +0000 (15:00 +0000)]
[llvm] Skip over empty line table entries.

Summary:
This is similar to how addr2line handles consecutive entries with the
same address - pick the last one.

Reviewers: dblaikie, friss, JDevlieghere

Reviewed By: dblaikie

Subscribers: eugenis, vitalybuka, echristo, JDevlieghere, probinson, aprantl, hiraditya, rupprecht, jdoerfert, llvm-commits

Tags: #llvm, #debug-info

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

llvm-svn: 356265

5 years ago[clangd] Remove includes of "gmock-matchers.h". NFC
Ilya Biryukov [Fri, 15 Mar 2019 14:30:07 +0000 (14:30 +0000)]
[clangd] Remove includes of "gmock-matchers.h". NFC

For consistency with most of the test code.

llvm-svn: 356264

5 years agoFix a typo in FindLibEdit.cmake
Pavel Labath [Fri, 15 Mar 2019 14:03:52 +0000 (14:03 +0000)]
Fix a typo in FindLibEdit.cmake

The package name is LibEdit, so we should use that name in the call to
find_package_handle_standard_args. Failing to do so results in the
standard_args (such as the one telling us whether REQUIRED was used in
the find_package invocation) not being handled.

llvm-svn: 356263

5 years agoDelete type_sp member from TypePair
Pavel Labath [Fri, 15 Mar 2019 14:02:35 +0000 (14:02 +0000)]
Delete type_sp member from TypePair

Summary:
As discussed in the review of D59217, this member is unnecessary since
always the first thing we do is convert it to a CompilerType.

This opens up possibilities for further cleanups (e.g. the whole
TypePair class now loses purpose, since we can just pass around
CompilerType everywhere), but I did not want to do that yet, because I
am not sure if this will not introduce breakages in some of the
platforms/configurations that I am not testing on.

Reviewers: clayborg, zturner, jingham

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 356262

5 years ago[clangd] Tune the fuzzy-matching algorithm
Ilya Biryukov [Fri, 15 Mar 2019 14:00:49 +0000 (14:00 +0000)]
[clangd] Tune the fuzzy-matching algorithm

Summary:
To reduce the gap between prefix and initialism matches.

The motivation is producing better scoring in one particular example,
but the change does not seem to cause large regressions in other cases.

The examples is matching 'up' against 'unique_ptr' and 'upper_bound'.
Before the change, we had:
  - "[u]nique_[p]tr" with a score of 0.3,
  - "[up]per_bound" with a score of 1.0.

A 3x difference meant that symbol quality signals were almost always ignored
and 'upper_bound' was always ranked higher.

However, intuitively, the match scores should be very close for the two.

After the change we have the following scores:
- "[u]nique_[p]tr" with a score of 0.75,
- "[up]per_bound" with a score of 1.0.

Reviewers: ioeric

Reviewed By: ioeric

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

Tags: #clang

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

llvm-svn: 356261

5 years ago[CodeGenPrepare] avoid crashing from replacing a phi twice
Mikael Holmen [Fri, 15 Mar 2019 13:51:05 +0000 (13:51 +0000)]
[CodeGenPrepare]  avoid crashing from replacing a phi twice

Summary:
This is a fix to bug 41052:
https://bugs.llvm.org/show_bug.cgi?id=41052

While trying to optimize a memory instruction in a dead basic block, we end up registering the same phi for replacement twice. This patch avoids registering more than the first replacement candidate for a phi.

Patch by: JesperAntonsson

Reviewers: skatkov, aprantl

Reviewed By: aprantl

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356260

5 years ago[ARM] Remove EarlyCSE from backend
Sam Parker [Fri, 15 Mar 2019 13:36:37 +0000 (13:36 +0000)]
[ARM] Remove EarlyCSE from backend

There is an issue with early CSE hitting an assert, so temporarily
remove the pass from the Arm backend.

Bug: https://bugs.llvm.org/show_bug.cgi?id=41081

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

llvm-svn: 356259

5 years ago[AMDGPU] Fix SGPR fixing through SCC chaining
Michael Liao [Fri, 15 Mar 2019 12:42:21 +0000 (12:42 +0000)]
[AMDGPU] Fix SGPR fixing through SCC chaining

Summary:
- During the fixing of SGPR copying from VGPR, ensure users of SCC is
  properly propagated, i.e.
  * only propagate through live def of SCC,
  * skip the SCC-def inst itself, and
  * stop the propagation on the other SCC-def inst after checking its
    SCC-use first.

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

Tags: #llvm

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

llvm-svn: 356258

5 years ago[LSR] Update test from rL356256 after rebase.
Florian Hahn [Fri, 15 Mar 2019 12:37:50 +0000 (12:37 +0000)]
[LSR] Update test from rL356256 after rebase.

llvm-svn: 356257

5 years ago[LSR] Check for signed overflow in NarrowSearchSpaceByDetectingSupersets.
Florian Hahn [Fri, 15 Mar 2019 12:17:36 +0000 (12:17 +0000)]
[LSR] Check for signed overflow in NarrowSearchSpaceByDetectingSupersets.

We are adding a sign extended IR value to an int64_t, which can cause
signed overflows, as in the attached test case, where we have a formula
with BaseOffset = -1 and a constant with numeric_limits<int64_t>::min().

If the addition would overflow, skip the simplification for this
formula. Note that the target triple is required to trigger the failure.

Reviewers: qcolombet, gilr, kparzysz, efriedma

Reviewed By: efriedma

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

llvm-svn: 356256

5 years ago[CUDA][Windows] Partial fix for bug #38811 (Step 1 of 3)
Evgeny Mankov [Fri, 15 Mar 2019 12:05:36 +0000 (12:05 +0000)]
[CUDA][Windows] Partial fix for bug #38811 (Step 1 of 3)

Partial fix for the clang Bug https://bugs.llvm.org/show_bug.cgi?id=38811 "Clang fails to compile with CUDA-9.x on Windows".

Adding defined(_WIN64) check along with existing #if defined(__LP64__) eliminates the below clang (64-bit) compilation error on Windows.

C:/GIT/LLVM/trunk/llvm-64-release-vs2017/dist/lib/clang/9.0.0\include\__clang_cuda_device_functions.h(1609,45): error GEF7559A7: no matching function for call to 'roundf'
 __DEVICE__ long lroundf(float __a) { return roundf(__a); }

Reviewed by: Artem Belevich

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

llvm-svn: 356255

5 years agoRename directory housing clang-change-namespace to be eponymous
Nico Weber [Fri, 15 Mar 2019 11:54:01 +0000 (11:54 +0000)]
Rename directory housing clang-change-namespace to be eponymous

Makes the name of this directory consistent with the names of the other
directories in clang-tools-extra.

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

llvm-svn: 356254

5 years ago[SPARC] Regenerate label test for D59363
Simon Pilgrim [Fri, 15 Mar 2019 11:24:17 +0000 (11:24 +0000)]
[SPARC] Regenerate label test for D59363

llvm-svn: 356253

5 years ago[ARM] Remove icmp undef from reduced tests
Simon Pilgrim [Fri, 15 Mar 2019 11:14:59 +0000 (11:14 +0000)]
[ARM] Remove icmp undef from reduced tests

Pre-commit for D59363 (Add icmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @efriedma (Eli Friedman)

llvm-svn: 356252

5 years ago[WebAssembly] Remove icmp undef in stackify test
Simon Pilgrim [Fri, 15 Mar 2019 11:13:26 +0000 (11:13 +0000)]
[WebAssembly] Remove icmp undef in stackify test

Pre-commit for D59363 (Add icmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @tlively (Thomas Lively)

llvm-svn: 356251

5 years agoMake getFullyQualifiedName qualify both the pointee and class type for member ptr...
Benjamin Kramer [Fri, 15 Mar 2019 11:09:41 +0000 (11:09 +0000)]
Make getFullyQualifiedName qualify both the pointee and class type for member ptr types

We already handle pointers and references, member ptrs are just another
special case. Fixes PR40732.

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

llvm-svn: 356250

5 years ago[X86][SSE] Attempt to convert SSE shift-by-var to shift-by-imm.
Simon Pilgrim [Fri, 15 Mar 2019 11:05:42 +0000 (11:05 +0000)]
[X86][SSE] Attempt to convert SSE shift-by-var to shift-by-imm.

Prep work for PR40203

llvm-svn: 356249

5 years ago[llvm-profdata] Deleted unused Cutoffs added by D16005
Fangrui Song [Fri, 15 Mar 2019 10:43:51 +0000 (10:43 +0000)]
[llvm-profdata] Deleted unused Cutoffs added by D16005

llvm-svn: 356248

5 years ago[yaml2obj]Allow explicit setting of p_filesz, p_memsz, and p_offset
James Henderson [Fri, 15 Mar 2019 10:35:27 +0000 (10:35 +0000)]
[yaml2obj]Allow explicit setting of p_filesz, p_memsz, and p_offset

yaml2obj currently derives the p_filesz, p_memsz, and p_offset values of
program headers from their sections. This makes writing tests for
certain formats more complex, and sometimes impossible. This patch
allows setting these fields explicitly, overriding the default value,
when relevant.

Reviewed by: jakehehrlich, Higuoxing

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

llvm-svn: 356247

5 years ago[llvm-readobj] Delete unused variable. NFC
Fangrui Song [Fri, 15 Mar 2019 10:34:57 +0000 (10:34 +0000)]
[llvm-readobj] Delete unused variable. NFC

llvm-svn: 356246

5 years ago[llvm-objcopy] Delete unused parameter from replaceDebugSections. NFC
Fangrui Song [Fri, 15 Mar 2019 10:27:28 +0000 (10:27 +0000)]
[llvm-objcopy] Delete unused parameter from replaceDebugSections. NFC

llvm-svn: 356245

5 years ago[llvm-objcopy] Don't use {}; NFC
Fangrui Song [Fri, 15 Mar 2019 10:20:51 +0000 (10:20 +0000)]
[llvm-objcopy] Don't use {}; NFC

llvm-svn: 356244

5 years ago[ARM][ParallelDSP] Disable for big-endian
Sam Parker [Fri, 15 Mar 2019 10:19:32 +0000 (10:19 +0000)]
[ARM][ParallelDSP] Disable for big-endian

Bail early when we don't have a preheader and also if the target is
big endian because it's written with only little endian in mind!

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

llvm-svn: 356243

5 years ago[msan] Fix BMI2 detection in msan tests, take 2.
Jonas Hahnfeld [Fri, 15 Mar 2019 10:15:13 +0000 (10:15 +0000)]
[msan] Fix BMI2 detection in msan tests, take 2.

It's not enough if only one bit is present, we need to check that
both are set. This finally fixes the test failures for me.

llvm-svn: 356242

5 years ago[COFF] Delete unused declarations and add a missing forward declaration. NFC
Fangrui Song [Fri, 15 Mar 2019 09:40:03 +0000 (09:40 +0000)]
[COFF] Delete unused declarations and add a missing forward declaration. NFC

llvm-svn: 356241

5 years ago[ELF] Delete unused forward declarations and unused DynamicReloc::getInputSec(). NFC
Fangrui Song [Fri, 15 Mar 2019 07:16:39 +0000 (07:16 +0000)]
[ELF] Delete unused forward declarations and unused DynamicReloc::getInputSec(). NFC

llvm-svn: 356239

5 years ago[MIPS GlobalISel] Improve selection of constants
Petar Avramovic [Fri, 15 Mar 2019 07:07:50 +0000 (07:07 +0000)]
[MIPS GlobalISel] Improve selection of constants

Certain 32 bit constants can be generated with a single instruction
instead of two. Implement materialize32BitImm function for MIPS32.

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

llvm-svn: 356238

5 years ago[ELF] De-template wrapSymbols, isReserved and addGotEntry. NFC
Fangrui Song [Fri, 15 Mar 2019 06:58:23 +0000 (06:58 +0000)]
[ELF] De-template wrapSymbols, isReserved and addGotEntry. NFC

llvm-svn: 356237

5 years ago[BPF] do not generate unused local/global types
Yonghong Song [Fri, 15 Mar 2019 05:51:25 +0000 (05:51 +0000)]
[BPF] do not generate unused local/global types

The kernel currently has a limit for # of types to be 64KB and
the size of string subsection to be 64KB. A simple bcc tool
runqlat.py generates:
  . the size of ~33KB type section, roughly ~10K types
  . the size of ~17KB string section

The majority type is from the types referenced by local
variables in the bpf program. For example, the kernel "task_struct"
itself recursively brings in ~900 other types.
This patch did the following optimization to avoid generating
unused types:
  . do not generate types for local variables unless they are
    function arguments.
  . do not generate types for external globals.

If an external global is not used in the program, llvm
already removes it from IR, so global variable saving is
typical small. For runqlat.py, only one variable "llvm.used"
is the external global.

The types for locals and external globals can be added back
once there is a usage for them.

After the above optimization, the runqlat.py generates:
  . the size of ~1.5KB type section, roughtly 500 types
  . the size of ~0.7KB string section

UPDATE:
  resubmitted the patch after previous revert with
  the following fix:
  use Global.hasExternalLinkage() to test "external"
  linkage instead of using Global.getInitializer(),
  which will assert on external variables.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356234

5 years agoRevert "[BPF] do not generate unused local/global types"
Yonghong Song [Fri, 15 Mar 2019 05:02:19 +0000 (05:02 +0000)]
Revert "[BPF] do not generate unused local/global types"

This reverts commit r356232.

Reason: test failure with ASSERT on enabled build.
llvm-svn: 356233

5 years ago[BPF] do not generate unused local/global types
Yonghong Song [Fri, 15 Mar 2019 04:42:01 +0000 (04:42 +0000)]
[BPF] do not generate unused local/global types

The kernel currently has a limit for # of types to be 64KB and
the size of string subsection to be 64KB. A simple bcc tool
runqlat.py generates:
  . the size of ~33KB type section, roughly ~10K types
  . the size of ~17KB string section

The majority type is from the types referenced by local
variables in the bpf program. For example, the kernel "task_struct"
itself recursively brings in ~900 other types.
This patch did the following optimization to avoid generating
unused types:
  . do not generate types for local variables unless they are
    function arguments.
  . do not generate types for external globals.

If an external global is not used in the program, llvm
already removes it from IR, so global variable saving is
typical small. For runqlat.py, only one variable "llvm.used"
is the external global.

The types for locals and external globals can be added back
once there is a usage for them.

After the above optimization, the runqlat.py generates:
  . the size of ~1.5KB type section, roughtly 500 types
  . the size of ~0.7KB string section

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356232

5 years agoRemove an assert in template pack deduction during nested instantiation.
Richard Trieu [Fri, 15 Mar 2019 04:26:02 +0000 (04:26 +0000)]
Remove an assert in template pack deduction during nested instantiation.

llvm-svn: 356231

5 years ago[ELF] Add a test for large .bss.rel.ro
Fangrui Song [Fri, 15 Mar 2019 03:37:42 +0000 (03:37 +0000)]
[ELF] Add a test for large .bss.rel.ro

Reviewers: ruiu, pcc, espindola

Reviewed By: pcc

Subscribers: emaste, arichardson, llvm-commits

Tags: #llvm

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

llvm-svn: 356230

5 years ago[ELF] Fix 3 tests after D56828
Fangrui Song [Fri, 15 Mar 2019 03:20:13 +0000 (03:20 +0000)]
[ELF] Fix 3 tests after D56828

arm-plt-reloc.s arm-thumb-plt-reloc.s: update offset calculations

pack-dyn-relocs-loop.s: this test is very sensitive to exact section
offsets and sizes. If we comment out the following two lines in
SyntheticSections.cpp, we should reproduce `ld.lld: error: thunk
creation not converged` caused by oscillation of the section size.

  if (RelocData.size() < OldSize)
    RelocData.append(OldSize - RelocData.size(), 0);

Use -z norelro to counteract the layout change (to be more specific,
we have to place .dynamic below .foo so that offset(foo) remains 0x10004)

llvm-svn: 356229

5 years agoAdd missing override specifier [NFC]
Aaron Puchert [Fri, 15 Mar 2019 02:30:07 +0000 (02:30 +0000)]
Add missing override specifier [NFC]

This should fix a -Winconsistent-missing-override warning that is only
visible when Z3 is enabled.

llvm-svn: 356228

5 years ago[lldb-vscode] Fix dangling pointer in request_evaluate.
Jorge Gorbe Moya [Fri, 15 Mar 2019 01:46:50 +0000 (01:46 +0000)]
[lldb-vscode] Fix dangling pointer in request_evaluate.

SBError::GetCString() returns a pointer to a string owned by the SBError
object. The code here was calling GetCString on a temporary and using
the returned pointer after the temporary was destroyed.

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

llvm-svn: 356227

5 years ago[ELF] Split RW PT_LOAD on the PT_GNU_RELRO boundary
Fangrui Song [Fri, 15 Mar 2019 01:29:57 +0000 (01:29 +0000)]
[ELF] Split RW PT_LOAD on the PT_GNU_RELRO boundary

Summary:
Based on Peter Collingbourne's suggestion in D56828.

Before D56828: PT_LOAD(.data PT_GNU_RELRO(.data.rel.ro .bss.rel.ro) .bss)
Old:           PT_LOAD(PT_GNU_RELRO(.data.rel.ro .bss.rel.ro) .data .bss)
New:           PT_LOAD(PT_GNU_RELRO(.data.rel.ro .bss.rel.ro)) PT_LOAD(.data. .bss)

The new layout reflects the runtime memory mappings.
By having two PT_LOAD segments, we can utilize the NOBITS part of the
first PT_LOAD and save bytes for .bss.rel.ro.

.bss.rel.ro is currently small and only used by copy relocations of
symbols in read-only segments, but it can be used for other purposes in
the future, e.g. if a relro section's statically relocated data is all
zeros, we can move it to .bss.rel.ro.

Reviewers: espindola, ruiu, pcc

Reviewed By: ruiu

Subscribers: nemanjai, jvesely, nhaehnle, javed.absar, kbarton, emaste, arichardson, llvm-commits

Tags: #llvm

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

llvm-svn: 356226

5 years ago[DataFormatters] Remove LLDB_DISABLE_PYTHON from FormatManager.
Davide Italiano [Fri, 15 Mar 2019 00:45:57 +0000 (00:45 +0000)]
[DataFormatters] Remove LLDB_DISABLE_PYTHON from FormatManager.

And DataVisualization. One step closer.

llvm-svn: 356225

5 years agoMark vector::operator[] and front/back as noexcept. We already do this for string...
Marshall Clow [Fri, 15 Mar 2019 00:29:35 +0000 (00:29 +0000)]
Mark vector::operator[] and front/back as noexcept. We already do this for string and string_view. This should give better codegen inside of noexcept functions. Add tests for op[]/front/back/at, because apparently we had none.

llvm-svn: 356224

5 years ago[analyzer] RetainCount: A function isn't a CFRetain if it takes no arguments.
Artem Dergachev [Fri, 15 Mar 2019 00:26:17 +0000 (00:26 +0000)]
[analyzer] RetainCount: A function isn't a CFRetain if it takes no arguments.

Don't crash when a function has a name that starts with "CF" and ends with
"Retain" but takes 0 arguments. In particular, don't try to treat it as if
it returns its first argument.

These problems are inevitable because the checker is naming-convention-based,
but at least we shouldn't crash.

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

llvm-svn: 356223

5 years ago[analyzer] Support C++17 aggregates with bases without constructors.
Artem Dergachev [Fri, 15 Mar 2019 00:22:59 +0000 (00:22 +0000)]
[analyzer] Support C++17 aggregates with bases without constructors.

RegionStore now knows how to bind a nonloc::CompoundVal that represents the
value of an aggregate initializer when it has its initial segment of sub-values
correspond to base classes.

Additionally, fixes the crash from pr40022.

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

llvm-svn: 356222

5 years ago[WebAssembly] Remove unused load/store patterns that use texternalsym
Sam Clegg [Fri, 15 Mar 2019 00:20:13 +0000 (00:20 +0000)]
[WebAssembly] Remove unused load/store patterns that use texternalsym

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

llvm-svn: 356221

5 years agoFixed global constant/variable naming check on C++ class for ObjC++ files.
Yan Zhang [Fri, 15 Mar 2019 00:17:41 +0000 (00:17 +0000)]
Fixed global constant/variable naming check on C++ class for ObjC++ files.

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 356220

5 years agoAMDGPU: Remove intrinsic operand assert
Matt Arsenault [Thu, 14 Mar 2019 23:45:09 +0000 (23:45 +0000)]
AMDGPU: Remove intrinsic operand assert

Before r355981, this was under LLVM_DEBUG. I don't think the assert is
quite right, but this really should be a verifier check. Instcombine
should not be asserting on this sort of thing.

llvm-svn: 356219

5 years ago[CGP] add another bailout for degenerate code (PR41064)
Sanjay Patel [Thu, 14 Mar 2019 23:14:31 +0000 (23:14 +0000)]
[CGP] add another bailout for degenerate code (PR41064)

This is almost the same as:
rL355345
...and should prevent any potential crashing from examples like:
https://bugs.llvm.org/show_bug.cgi?id=41064
...although the bug was masked by:
rL355823
...and I'm not sure how to repro the problem after that change.

llvm-svn: 356218

5 years agoTighten up tests that use -debugify as a shortcut. NFC
Paul Robinson [Thu, 14 Mar 2019 23:09:17 +0000 (23:09 +0000)]
Tighten up tests that use -debugify as a shortcut. NFC

These now verify that a given instruction has a specific source
location, rather than any old location. We want to make sure we
propagate the correct locations from one instruction to another.

llvm-svn: 356217

5 years ago[MC] Sort FDEs by the associated CIE before emitting them.
Eli Friedman [Thu, 14 Mar 2019 23:08:19 +0000 (23:08 +0000)]
[MC] Sort FDEs by the associated CIE before emitting them.

This isn't necessary according to the DWARF standard, but it matches the
.eh_frame sections emitted by other tools in practice, and the Android
libunwindstack rejects .eh_frame sections where an FDE refers to a CIE
other than the closest previous CIE. So match the other tools and also
sort accordingly.

I consider this a bug in libunwindstack, but it's easy enough to emit
a compatible .eh_frame section for compatibility with installed
operating systems.

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

llvm-svn: 356216

5 years agoMIR: Allow targets to serialize MachineFunctionInfo
Matt Arsenault [Thu, 14 Mar 2019 22:54:43 +0000 (22:54 +0000)]
MIR: Allow targets to serialize MachineFunctionInfo

This has been a very painful missing feature that has made producing
reduced testcases difficult. In particular the various registers
determined for stack access during function lowering were necessary to
avoid undefined register errors in a large percentage of
cases. Implement a subset of the important fields that need to be
preserved for AMDGPU.

Most of the changes are to support targets parsing register fields and
properly reporting errors. The biggest sort-of bug remaining is for
fields that can be initialized from the IR section will be overwritten
by a default initialized machineFunctionInfo section. Another
remaining bug is the machineFunctionInfo section is still printed even
if empty.

llvm-svn: 356215

5 years ago[AArch64][GlobalISel] Add isel support for G_UADDO on s32s and s64s
Jessica Paquette [Thu, 14 Mar 2019 22:54:29 +0000 (22:54 +0000)]
[AArch64][GlobalISel] Add isel support for G_UADDO on s32s and s64s

This adds instruction selection support for G_UADDO on s32s and s64s.

Also
- Add an instruction selection test
- Update the arm64-xaluo.ll test to show that we generate the correct assembly

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

llvm-svn: 356214

5 years ago[AArch64][GlobalISel] Implement selection for G_UNMERGE of vectors to vectors.
Amara Emerson [Thu, 14 Mar 2019 22:48:18 +0000 (22:48 +0000)]
[AArch64][GlobalISel] Implement selection for G_UNMERGE of vectors to vectors.

This re-uses the previous support for extract vector elt to extract the
subvectors.

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

llvm-svn: 356213

5 years ago[AArch64][GlobalISel] Add some support for G_CONCAT_VECTORS.
Amara Emerson [Thu, 14 Mar 2019 22:48:15 +0000 (22:48 +0000)]
[AArch64][GlobalISel] Add some support for G_CONCAT_VECTORS.

Handles concatenating 2 x v2s32 and 2 x v4s16

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

llvm-svn: 356212

5 years agoXFAIL this debug-mode test that I just broke. Eric has a patch out for review (D59166...
Marshall Clow [Thu, 14 Mar 2019 22:24:32 +0000 (22:24 +0000)]
XFAIL this debug-mode test that I just broke. Eric has a patch out for review (D59166) that rewrites this test completely, so I'm not going to bother fixing it.

llvm-svn: 356211

5 years ago[ObjCLanguage] Remove LLDB_DISABLE_PYTHON markers from the formatters.
Davide Italiano [Thu, 14 Mar 2019 22:12:59 +0000 (22:12 +0000)]
[ObjCLanguage] Remove LLDB_DISABLE_PYTHON markers from the formatters.

llvm-svn: 356210

5 years agoAdd noexcept to operator[] for array and deque. This is an extension. We already...
Marshall Clow [Thu, 14 Mar 2019 21:56:57 +0000 (21:56 +0000)]
Add noexcept to operator[] for array and deque. This is an extension. We already do this for string and string_view. This should give better codegen inside of noexcept functions.

llvm-svn: 356209

5 years agoReland the rest of "Add AIX Target Info"
Jason Liu [Thu, 14 Mar 2019 21:54:30 +0000 (21:54 +0000)]
Reland the rest of "Add AIX Target Info"

llvm-svn 356197 relanded previously failing test case max_align.c.
This commit will reland the rest of llvm-svn 356060 commit.

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

llvm-svn: 356208

5 years ago[llvm-strip] Hook up (unimplemented) --only-keep-debug
Jordan Rupprecht [Thu, 14 Mar 2019 21:51:42 +0000 (21:51 +0000)]
[llvm-strip] Hook up (unimplemented) --only-keep-debug

For ELF, we accept but ignore --only-keep-debug. Do the same for llvm-strip.

COFF does implement this, so update the test that it is supported.

llvm-svn: 356207

5 years agoAMDGPU: Correct type for waitcnt debug flag
Matt Arsenault [Thu, 14 Mar 2019 21:23:59 +0000 (21:23 +0000)]
AMDGPU: Correct type for waitcnt debug flag

llvm-svn: 356206

5 years agoAdd test I forgot to git-add in r356163.
Adrian Prantl [Thu, 14 Mar 2019 21:23:52 +0000 (21:23 +0000)]
Add test I forgot to git-add in r356163.

llvm-svn: 356205

5 years agoLine wrap README file
Sam Clegg [Thu, 14 Mar 2019 21:09:14 +0000 (21:09 +0000)]
Line wrap README file

llvm-svn: 356204

5 years ago[InstCombine] Add tests for range-based saturing math overflow; NFC
Nikita Popov [Thu, 14 Mar 2019 21:06:46 +0000 (21:06 +0000)]
[InstCombine] Add tests for range-based saturing math overflow; NFC

Tests for cases where overflow can be determined, but not based on
known bits.

llvm-svn: 356203

5 years ago[NFC][TSan] Move libdispatch tests into their own subfolder
Julian Lettner [Thu, 14 Mar 2019 20:59:41 +0000 (20:59 +0000)]
[NFC][TSan] Move libdispatch tests into their own subfolder

Remove 'gcd' file prefix. GCD stands for Grand Central Dispatch, which
is another name for libdispatch.
https://apple.github.io/swift-corelibs-libdispatch/

Remove `REQUIRE: dispatch` from tests.

Also rename lit feature 'dispatch' -> 'libdispatch' to be more explicit
what this is about.

Reviewed By: kubamracek

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

llvm-svn: 356202

5 years ago[TSan][libdispatch] Remove dependency on system headers
Julian Lettner [Thu, 14 Mar 2019 20:59:37 +0000 (20:59 +0000)]
[TSan][libdispatch] Remove dependency on system headers

Including <dispatch/dispatch.h> and <Blocks.h> transitively pulls in
other system headers. Let's try to avoid that.

Blocks.h: compiler-rt already includes a blocks runtime. Just use the
header file that comes with it.

dispatch.h: Declare the bare minimum required for our implementation,
i.e., everything needed to define the interceptors, but not the
interceptors themselves. See tsan_dispatch_defs.h. I spotted a few other
places in compile-rt, where we declare libdispatch types. Maybe this
file can be moved to sanitizer_common if we deem it useful enough.

tsan_libdispatch.cc now compiles on Linux/Clang (requires support for
-fblocks). Linking still requires some manual configuration.

Reviewed By: kubamracek

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

llvm-svn: 356201

5 years ago[ARC] Add more load/store variants.
Pete Couperus [Thu, 14 Mar 2019 20:50:54 +0000 (20:50 +0000)]
[ARC] Add more load/store variants.

On ARC ISA, general format of load instruction is this:

    LD<zz><.x><.aa><.di> a, [b,c]
And general format of store is this:
    ST<zz><.aa><.di> c, [b,s9]
Where:

<zz> is data size field and can be one of
  <empty> (bits 00) - Word (32-bit), default behavior
  B             (bits 01) - Byte
  H             (bits 10) - Half-word (16-bit)

 <.x> is data extend mode:
  <empty> (bit 0) - If size is not Word(32-bit), then data is zero extended
  X       (bit 1) - If size is not Word(32-bit), then data is sign extended

 <.aa> is address write-back mode:
  <empty> (bits 00) - no write-back
  .AW  (bits 01) - Preincrement, base register updated pre memory transaction
  .AB  (bits 10) - Postincrement, base register updated post memory transaction

 <.di> is cache bypass mode:
  <empty> (bit 0) - Cached memory access, default mode
  .DI     (bit 1) - Non-cached data memory access

  This patch adds these load/store instruction variants to the ARC backend.

Patch By Denis Antrushin! <denis@synopsys.com>

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

llvm-svn: 356200

5 years agogn build: Add build files for clang-doc
Nico Weber [Thu, 14 Mar 2019 20:41:19 +0000 (20:41 +0000)]
gn build: Add build files for clang-doc

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

llvm-svn: 356199

5 years ago[OPENMP]Fix crash for the ordered(n) clause.
Alexey Bataev [Thu, 14 Mar 2019 20:36:00 +0000 (20:36 +0000)]
[OPENMP]Fix crash for the ordered(n) clause.

If the doacross lop construct is used and the loop counter is declare
outside of the loop, the compiler might crash trying to get the address
of the loop counter. Patch fixes this problem.

llvm-svn: 356198

5 years agoReland part of "Add AIX Target Info"
Jason Liu [Thu, 14 Mar 2019 20:27:39 +0000 (20:27 +0000)]
Reland part of "Add AIX Target Info"

This patch reland the test case max_align.c which is failing at
Windows and PS4 platform in the previous commit.

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

original llvm-svn: 356060

llvm-svn: 356197

5 years ago[CodeGen] Consider tied operands when adjusting inline asm operands.
Eli Friedman [Thu, 14 Mar 2019 19:46:51 +0000 (19:46 +0000)]
[CodeGen] Consider tied operands when adjusting inline asm operands.

The constraint "0" in the following asm did not consider the its
relationship with "=y" when try to replace the type of the operands.

asm ("nop" : "=y"(Mu8_1 ) : "0"(Mu8_0 ));

Patch by Xiang Zhang.

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

llvm-svn: 356196