platform/upstream/llvm.git
5 years ago[XRay][compiler-rt] Stash flags as well in x86_64 trampoline
Dean Michael Berris [Tue, 28 Aug 2018 10:32:50 +0000 (10:32 +0000)]
[XRay][compiler-rt] Stash flags as well in x86_64 trampoline

Summary:
This change saves and restores the full flags register in x86_64 mode.
This makes running instrumented signal handlers safer, and avoids flags
set during the execution of the event handlers from polluting the
instrumented call's flags state.

Reviewers: kpw, eizan, jfb

Subscribers: llvm-commits

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

llvm-svn: 340812

5 years ago[benchmark] Silence warning by applying upstream patch
Kirill Bobyrev [Tue, 28 Aug 2018 10:27:49 +0000 (10:27 +0000)]
[benchmark] Silence warning by applying upstream patch

ompiling benchmark library (introduced in D50894) with the latest
bootstrapped Clang produces a lot of warnings, this issue was addressed
in the upstream patch I pushed earlier.

Upstream patch:
https://github.com/google/benchmark/commit/f85304e4e3a0e4e1bf15b91720df4a19e90b589f

`README.LLVM` notes were updated to reflect the latest changes.

Reviewed by: lebedev.ri

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

llvm-svn: 340811

5 years ago[X86][SSE] Avoid vector extraction/insertion for non-constant uniform shifts
Simon Pilgrim [Tue, 28 Aug 2018 10:14:09 +0000 (10:14 +0000)]
[X86][SSE] Avoid vector extraction/insertion for non-constant uniform shifts

As discussed on D51263, we're better off using byte shifts to clear the upper bits on pre-SSE41 hardware.

llvm-svn: 340810

5 years agoPull google/benchmark library to the LLVM tree
Kirill Bobyrev [Tue, 28 Aug 2018 09:42:41 +0000 (09:42 +0000)]
Pull google/benchmark library to the LLVM tree

This patch pulls google/benchmark v1.4.1 into the LLVM tree so that any
project could use it for benchmark generation. A dummy benchmark is
added to `llvm/benchmarks/DummyYAML.cpp` to validate the correctness of
the build process.

The current version does not utilize LLVM LNT and LLVM CMake
infrastructure, but that might be sufficient for most users. Two
introduced CMake variables:

* `LLVM_INCLUDE_BENCHMARKS` (`ON` by default) generates benchmark
  targets
* `LLVM_BUILD_BENCHMARKS` (`OFF` by default) adds generated
  benchmark targets to the list of default LLVM targets (i.e. if `ON`
  benchmarks will be built upon standard build invocation, e.g. `ninja` or
  `make` with no specific targets)

List of modifications:

* `BENCHMARK_ENABLE_TESTING` is disabled
* `BENCHMARK_ENABLE_EXCEPTIONS` is disabled
* `BENCHMARK_ENABLE_INSTALL` is disabled
* `BENCHMARK_ENABLE_GTEST_TESTS` is disabled
* `BENCHMARK_DOWNLOAD_DEPENDENCIES` is disabled

Original discussion can be found here:
http://lists.llvm.org/pipermail/llvm-dev/2018-August/125023.html

Reviewed by: dberris, lebedev.ri

Subscribers: ilya-biryukov, ioeric, EricWF, lebedev.ri, srhines,
dschuff, mgorny, krytarowski, fedor.sergeev, mgrang, jfb, llvm-commits

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

llvm-svn: 340809

5 years ago[NFC] A loop can never contain Ret instruction
Max Kazantsev [Tue, 28 Aug 2018 09:26:28 +0000 (09:26 +0000)]
[NFC] A loop can never contain Ret instruction

llvm-svn: 340808

5 years agoFix in getAllocationDataForFunction
David Chisnall [Tue, 28 Aug 2018 08:59:06 +0000 (08:59 +0000)]
Fix in getAllocationDataForFunction

Summary:
Correct to use set like behaviour of AllocType.  Should check for
subset, not precise value.

Reviewers: theraven

Reviewed By: theraven

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 340807

5 years ago[LLD][ELF] - Simplify Call-Chain Clustering implementation a bit.
George Rimar [Tue, 28 Aug 2018 08:49:40 +0000 (08:49 +0000)]
[LLD][ELF] - Simplify Call-Chain Clustering implementation a bit.

Looking at the current implementation and algorithm description,
it does not seem we need to keep vector with all edges for
each cluster and can just remember the best one. This is NFC change.

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

llvm-svn: 340806

5 years ago[Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments
Adam Balogh [Tue, 28 Aug 2018 08:41:15 +0000 (08:41 +0000)]
[Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

We add check for invalidation of iterators. The only operation we handle here
is the (copy) assignment.

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

llvm-svn: 340805

5 years ago[LLD][ELD] - Do not reject INFO output section type when used with a start address.
George Rimar [Tue, 28 Aug 2018 08:39:21 +0000 (08:39 +0000)]
[LLD][ELD] - Do not reject INFO output section type when used with a start address.

This is https://bugs.llvm.org/show_bug.cgi?id=38625

LLD accept this:

".stack (INFO) : {",

but not this:

".stack address_expression (INFO) :"

The patch fixes it.

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

llvm-svn: 340804

5 years ago[LLF][ELF] - Support -z global.
George Rimar [Tue, 28 Aug 2018 08:24:34 +0000 (08:24 +0000)]
[LLF][ELF] - Support -z global.

-z global is a flag used on Android (see D49198).

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

llvm-svn: 340802

5 years ago[clang-tidy] Abseil: no namepsace check
Haojian Wu [Tue, 28 Aug 2018 07:48:28 +0000 (07:48 +0000)]
[clang-tidy] Abseil: no namepsace check

This check ensures that users of Abseil do not open namespace absl in their code, as that violates our compatibility guidelines.

AbseilMatcher.h written by Hugo Gonzalez.

Patch by Deanna Garcia!

llvm-svn: 340800

5 years ago[X86] Fix some comments to refer to KORTEST not KTEST. NFC
Craig Topper [Tue, 28 Aug 2018 06:39:35 +0000 (06:39 +0000)]
[X86] Fix some comments to refer to KORTEST not KTEST. NFC

KTEST is a different instruction. All of this code uses KORTEST.

llvm-svn: 340799

5 years ago[X86] Add kortest intrinsics for 8, 32, and 64 bit masks. Add new intrinsic names...
Craig Topper [Tue, 28 Aug 2018 06:28:25 +0000 (06:28 +0000)]
[X86] Add kortest intrinsics for 8, 32, and 64 bit masks. Add new intrinsic names for 16 bit masks.

This matches gcc and icc despite not being documented in the Intel Intrinsics Guide.

llvm-svn: 340798

5 years ago[DAGCombiner][AMDGPU][Mips] Fold bitcast with volatile loads if the resulting load...
Craig Topper [Tue, 28 Aug 2018 03:47:20 +0000 (03:47 +0000)]
[DAGCombiner][AMDGPU][Mips] Fold bitcast with volatile loads if the resulting load is legal for the target.

Summary:
I'm not sure if this patch is correct or if it needs more qualifying somehow. Bitcast shouldn't change the size of the load so it should be ok? We already do something similar for stores. We'll change the type of a volatile store if the resulting store is Legal or Custom. I'm not sure we should be allowing Custom there...

I was playing around with converting X86 atomic loads/stores(except seq_cst) into regular volatile loads and stores during lowering. This would allow some special RMW isel patterns in X86InstrCompiler.td to be removed. But there's some floating point patterns in there that didn't work because we don't fold (f64 (bitconvert (i64 volatile load))) or (f32 (bitconvert (i32 volatile load))).

Reviewers: efriedma, atanasyan, arsenm

Reviewed By: efriedma

Subscribers: jvesely, arsenm, sdardis, kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, arichardson, jrtc27, atanasyan, jfb, llvm-commits

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

llvm-svn: 340797

5 years ago[InstCombine] Extend (add (sext x), cst) --> (sext (add x, cst')) and (add (zext...
Craig Topper [Tue, 28 Aug 2018 02:02:29 +0000 (02:02 +0000)]
[InstCombine] Extend (add (sext x), cst) --> (sext (add x, cst')) and (add (zext x), cst) --> (zext (add x, cst')) to work for vectors

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

llvm-svn: 340796

5 years ago[PPC] Remove Darwin support from POWER backend.
Kit Barton [Tue, 28 Aug 2018 01:18:29 +0000 (01:18 +0000)]
[PPC] Remove Darwin support from POWER backend.
This patch issues an error message if Darwin ABI is attempted with the PPC
backend. It also cleans up existing test cases, either converting the test to
use an alternative triple or removing the test if the coverage is no longer
needed.

Updated Tests
-------------
The majority of test cases were updated to use a different triple that does not
include the Darwin ABI. Many tests were also updated to use FileCheck, in place
of grep.

Deleted Tests
-------------
llvm/test/tools/dsymutil/PowerPC/sibling.test was originally added to test
specific functionality of dsymutil using an object file created with an old
version of llvm-gcc for a Powerbook G4. After a discussion with @JDevlieghere he
suggested removing the test.

llvm/test/CodeGen/PowerPC/combine_loads_from_build_pair.ll was converted from a
PPC test to a SystemZ test, as the behavior is also reproducible there.

All other tests that were deleted were specific to the darwin/ppc ABI and no
longer necessary.

Phabricator Review: https://reviews.llvm.org/D50988

llvm-svn: 340795

5 years agoRevert "[CodeGenPrepare] Scan past debug intrinsics to find select candidates (NFC)"
David Blaikie [Tue, 28 Aug 2018 00:55:19 +0000 (00:55 +0000)]
Revert "[CodeGenPrepare] Scan past debug intrinsics to find select candidates (NFC)"

This causes crashes due to the interleaved dbg.value intrinsics being
left at the end of basic blocks, causing the actual terminators (br,
etc) to be not where they should be (not at the end of the block),
leading to later crashes.

Further discussion on the original commit thread.

This reverts commit r340368.

llvm-svn: 340794

5 years ago[MemorySSA] Add NDEBUG checks to verifiers; NFC
George Burgess IV [Tue, 28 Aug 2018 00:32:32 +0000 (00:32 +0000)]
[MemorySSA] Add NDEBUG checks to verifiers; NFC

verify*() methods are intended to have no side-effects (unless we detect
broken MSSA, in which case they assert()), and all of the other verify
methods are wrapped by `#ifndef NDEBUG`.

llvm-svn: 340793

5 years agoMake the DYLD_INSERT_LIBRARIES workaround for SIP more robut for the various configur...
Adrian Prantl [Mon, 27 Aug 2018 23:06:38 +0000 (23:06 +0000)]
Make the DYLD_INSERT_LIBRARIES workaround for SIP more robut for the various configurations that bots are running

llvm-svn: 340792

5 years agoAdd a mkdir -p to builddir into lldbtest.py
Adrian Prantl [Mon, 27 Aug 2018 23:06:37 +0000 (23:06 +0000)]
Add a mkdir -p to builddir into lldbtest.py

Based on how it is executed, it may not have been yet created.

llvm-svn: 340791

5 years ago[InstCombine] fix formatting; NFC
Sanjay Patel [Mon, 27 Aug 2018 23:01:10 +0000 (23:01 +0000)]
[InstCombine] fix formatting; NFC

llvm-svn: 340790

5 years ago[InstCombine] Add test cases for D51236. NFC
Craig Topper [Mon, 27 Aug 2018 22:55:49 +0000 (22:55 +0000)]
[InstCombine] Add test cases for D51236. NFC

llvm-svn: 340789

5 years ago[RuntimeDyld] Add test case that was accidentally left out of r340125.
Lang Hames [Mon, 27 Aug 2018 22:48:01 +0000 (22:48 +0000)]
[RuntimeDyld] Add test case that was accidentally left out of r340125.

llvm-svn: 340788

5 years ago[InstCombine] allow shuffle+binop canonicalization with widening shuffles
Sanjay Patel [Mon, 27 Aug 2018 22:41:44 +0000 (22:41 +0000)]
[InstCombine] allow shuffle+binop canonicalization with widening shuffles

This lines up with the behavior of an existing transform where if both
operands of the binop are shuffled, we allow moving the binop before the
shuffle regardless of whether the shuffle changes the size of the vector.

llvm-svn: 340787

5 years ago[ORC] Add unit tests for the new RTDyldObjectLinkingLayer2 class.
Lang Hames [Mon, 27 Aug 2018 22:30:57 +0000 (22:30 +0000)]
[ORC] Add unit tests for the new RTDyldObjectLinkingLayer2 class.

The new unit tests match the old ones, which will remain in tree until the
old RTDyldObjectLinkingLayer is removed.

llvm-svn: 340786

5 years ago[x86] add AVX runs to show more potential scalar->vector mov opportunities; NFC
Sanjay Patel [Mon, 27 Aug 2018 22:29:06 +0000 (22:29 +0000)]
[x86] add AVX runs to show more potential scalar->vector mov opportunities; NFC

llvm-svn: 340785

5 years ago[PATCH] [InstCombine] Fix issue in the simplification of pow() with nested exp{,2}()
Evandro Menezes [Mon, 27 Aug 2018 22:11:15 +0000 (22:11 +0000)]
[PATCH] [InstCombine] Fix issue in the simplification of pow() with nested exp{,2}()

Fix the issue of duplicating the call to `exp{,2}()` when it's nested in
`pow()`, as exposed by rL340462.

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

llvm-svn: 340784

5 years agos/std::set/DenseSet/; NFC
George Burgess IV [Mon, 27 Aug 2018 22:10:59 +0000 (22:10 +0000)]
s/std::set/DenseSet/; NFC

We only use this set for `insert` and `count`, so a hashing container
seems better here.

llvm-svn: 340783

5 years ago[Pipeliner] Fix incorrect phi values in the epilog and kernel
Brendon Cahoon [Mon, 27 Aug 2018 22:04:50 +0000 (22:04 +0000)]
[Pipeliner] Fix incorrect phi values in the epilog and kernel

The code that generates the loop definition operand for phis
in the epilog and kernel is incorrect in some cases.

In the kernel, when a phi refers to another phi, the code that
updates PhiOp2 needs to include the stage difference between
the two phis.

In the epilog, the check for using the loop definition instead
of the phi definition uses the StageDiffAdj value (the difference
between the phi stage and the loop definition stage), but the
adjustment is not needed to determine if the current stage
contains an iteration with the loop definition.

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

llvm-svn: 340782

5 years ago[WebAssembly] TableGen backend for stackifying instructions
Thomas Lively [Mon, 27 Aug 2018 22:02:09 +0000 (22:02 +0000)]
[WebAssembly] TableGen backend for stackifying instructions

Summary:
The new stackification backend generates the giant switch statement
used to translate instructions to their stackified forms. I did this
because it was more interesting than adding all the different vector
versions of the various SIMD instructions to the switch statment
manually.

Reviewers: aardappel, aheejin, dschuff

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

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

llvm-svn: 340781

5 years agoUpdate the Visual Studio Integration from user feedback.
Zachary Turner [Mon, 27 Aug 2018 21:53:36 +0000 (21:53 +0000)]
Update the Visual Studio Integration from user feedback.

This patch removes the MSBuild warnings about options that
clang-cl ignores.  It also adds several additional fields to
the LLVM Configuration options page.  The first is that it
adds support for LLD!  To give the user flexibility though,
we don't want to force LLD to always-on, and if we're not
forcing LLD then we might as well not force clang-cl either.
So we add options that can enable or disable lld, clang-cl,
or any combination of the two.  Whenever one is disabled,
it falls back to the Microsoft equivalent.

Additionally, for each of clang-cl and lld-link, we add a new
configuration setting that allows Additional Options to be
passed for that specific tool only.  This is similar to the
C/C++ > Command Line > Additional Options entry box, but
it serves the use case where a user switches back and forth
between the toolsets in their vcxproj, but where cl.exe
won't accept some options that clang-cl will.  In this case
you can pass those options in the clang-cl additional options
and whenever clang-cl is disabled (or the other toolset is
selected entirely), those options won't get passed at all.

llvm-svn: 340780

5 years agoFix typo
Adrian Prantl [Mon, 27 Aug 2018 21:46:18 +0000 (21:46 +0000)]
Fix typo

llvm-svn: 340779

5 years agoFix ODR violation: namespace-scope helpers should not be declared 'static'.
Richard Smith [Mon, 27 Aug 2018 21:41:50 +0000 (21:41 +0000)]
Fix ODR violation: namespace-scope helpers should not be declared 'static'.

llvm-svn: 340778

5 years agoRevert "[SCEV][NFC] Check NoWrap flags before lexicographical comparison of SCEVs"
Roman Tereshin [Mon, 27 Aug 2018 21:41:37 +0000 (21:41 +0000)]
Revert "[SCEV][NFC] Check NoWrap flags before lexicographical comparison of SCEVs"

This reverts r319889.

Unfortunately, wrapping flags are not a part of SCEV's identity (they
do not participate in computing a hash value or in equality
comparisons) and in fact they could be assigned after the fact w/o
rebuilding a SCEV.

Grep for const_cast's to see quite a few of examples, apparently all
for AddRec's at the moment.

So, if 2 expressions get built in 2 slightly different ways: one with
flags set in the beginning, the other with the flags attached later
on, we may end up with 2 expressions which are exactly the same but
have their operands swapped in one of the commutative N-ary
expressions, and at least one of them will have "sorted by complexity"
invariant broken.

2 identical SCEV's won't compare equal by pointer comparison as they
are supposed to.

A real-world reproducer is added as a regression test: the issue
described causes 2 identical SCEV expressions to have different order
of operands and therefore compare not equal, which in its turn
prevents LoadStoreVectorizer from vectorizing a pair of consecutive
loads.

On a larger example (the source of the test attached, which is a
bugpoint) I have seen even weirder behavior: adding a constant to an
existing SCEV changes the order of the existing terms, for instance,
getAddExpr(1, ((A * B) + (C * D))) returns (1 + (C * D) + (A * B)).

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

llvm-svn: 340777

5 years agoSet line endings to Windows on MSBuild files.
Zachary Turner [Mon, 27 Aug 2018 21:35:58 +0000 (21:35 +0000)]
Set line endings to Windows on MSBuild files.

Normally we force Unix line endings in the repository, but since these are Windows files which are consumed by Microsoft tools that we don't have the source of, we should probably err on the side of caution and force CRLF.

llvm-svn: 340776

5 years ago[X86] Reverse the check prefixes in the test added in r340774.
Craig Topper [Mon, 27 Aug 2018 21:34:37 +0000 (21:34 +0000)]
[X86] Reverse the check prefixes in the test added in r340774.

The 32-bit and 64-bit checks were reversed.

llvm-svn: 340775

5 years ago[X86] Add test cases to show current codegen of v2i32 div/rem in 32-bit and 64-bit...
Craig Topper [Mon, 27 Aug 2018 21:13:07 +0000 (21:13 +0000)]
[X86] Add test cases to show current codegen of v2i32 div/rem in 32-bit and 64-bit modes

In particular this shows that we end up using libcalls in 32-bit mode even for division by constant.

llvm-svn: 340774

5 years ago[x86] add tests for possibly avoiding scalar->vector move; NFC
Sanjay Patel [Mon, 27 Aug 2018 20:21:33 +0000 (20:21 +0000)]
[x86] add tests for possibly avoiding scalar->vector move; NFC

llvm-svn: 340773

5 years ago[OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading
Gheorghe-Teodor Bercea [Mon, 27 Aug 2018 20:16:20 +0000 (20:16 +0000)]
[OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading

Summary: When offloading to a device and using the powerpc64le version of the auxiliary triple, the _CALL_ELF macro is not set correctly to 2 resulting in the attempt to include a header that does not exist. This patch fixes this problem.

Reviewers: Hahnfeld, ABataev, caomhin

Reviewed By: Hahnfeld

Subscribers: guansong, cfe-commits

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

llvm-svn: 340772

5 years ago[OpenMP][Fix] Conditional compilation leaves variables unused
Gheorghe-Teodor Bercea [Mon, 27 Aug 2018 19:54:26 +0000 (19:54 +0000)]
[OpenMP][Fix] Conditional compilation leaves variables unused

Summary: Prevent variables from being left unused by conditional compilation.

Reviewers: ABataev, grokos, Hahnfeld, caomhin, protze.joachim

Reviewed By: Hahnfeld

Subscribers: guansong, openmp-commits

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

llvm-svn: 340771

5 years ago[PPC] Remove Darwin support from POWER backend.
Kit Barton [Mon, 27 Aug 2018 19:53:19 +0000 (19:53 +0000)]
[PPC] Remove Darwin support from POWER backend.
This patch removes uses of the Darwin ABI for PowerPC related test cases. This
is the first step in removing Darwin support from the POWER backend.

clang/test/CodeGen/darwin-ppc-varargs.c  was deleted because it was a darwin/ppc
specific test case.

All other tests were updated to remove the darwin/ppc specific invocation.

Phabricator Review: https://reviews.llvm.org/D50989.

llvm-svn: 340770

5 years ago[lsan] Check that leak sanitizer works in the forked process
Vitaly Buka [Mon, 27 Aug 2018 19:15:05 +0000 (19:15 +0000)]
[lsan] Check that leak sanitizer works in the forked process

Regression test for PR38698

llvm-svn: 340769

5 years ago[llvm-mca] Remove unused include. NFC
Andrea Di Biagio [Mon, 27 Aug 2018 19:14:35 +0000 (19:14 +0000)]
[llvm-mca] Remove unused include. NFC

llvm-svn: 340768

5 years ago[OpenMP][libomptarget] rework of fatal error reporting
Alexandre Eichenberger [Mon, 27 Aug 2018 18:20:15 +0000 (18:20 +0000)]
[OpenMP][libomptarget] rework of fatal error reporting

Summary:
Removed the function that used a lock and varargs
Used the same mechanism as for debug messages

Reviewers: ABataev, gtbercea, grokos, Hahnfeld

Reviewed By: gtbercea, Hahnfeld

Subscribers: mikerice, ABataev, RaviNarayanaswamy, guansong, openmp-commits

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

llvm-svn: 340767

5 years agoDAG: Check transformed type for forming fminnum/fmaxnum from vselect
Matt Arsenault [Mon, 27 Aug 2018 18:11:31 +0000 (18:11 +0000)]
DAG: Check transformed type for forming fminnum/fmaxnum from vselect

Follow up to r340655 to fix vector types which are split.

llvm-svn: 340766

5 years ago[Sema/Attribute] Make types declared with address_space an AttributedType
Leonard Chan [Mon, 27 Aug 2018 17:57:29 +0000 (17:57 +0000)]
[Sema/Attribute] Make types declared with address_space an AttributedType

Currently an address_space is stored in a qualifier. This makes any type
declared with an address_space attribute in the form
`__attribute__((address_space(1))) int 1;` be wrapped in an AttributedType.

This is for a later patch where if `address_space` is declared in a macro,
any diagnostics that would normally print the address space will instead dump
the macro name. This will require saving any macro information in the
AttributedType.

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

llvm-svn: 340765

5 years ago[sanitizer][fuzzer] Transition back to ZX_TIME_INFINITE
Petr Hosek [Mon, 27 Aug 2018 17:51:52 +0000 (17:51 +0000)]
[sanitizer][fuzzer] Transition back to ZX_TIME_INFINITE

Now that all Zircon calls have been transitioned to take time as signed
value, we can transition back to ZX_TIME_INFINITE, undoing the change
made in r337802.

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

llvm-svn: 340764

5 years agoMachineVerifier: Fix assert on implicit virtreg use
Matt Arsenault [Mon, 27 Aug 2018 17:40:09 +0000 (17:40 +0000)]
MachineVerifier: Fix assert on implicit virtreg use

If the liveness of a physical register was invalid, this
was attempting to iterate the subregisters of all register
uses of the instruction, which would assert when it
encountered an implicit virtual register operand.

llvm-svn: 340763

5 years agoLangRef: Clarify expected sNaN behavior for minnum/maxnum
Matt Arsenault [Mon, 27 Aug 2018 17:40:07 +0000 (17:40 +0000)]
LangRef: Clarify expected sNaN behavior for minnum/maxnum

This matches the de-facto behavior based on constant folding
and the default lowering to fmin/fmax.

llvm-svn: 340762

5 years ago[PowerPC][MC] Support expressions in getMemRIX16Encoding.
Sean Fertile [Mon, 27 Aug 2018 17:37:43 +0000 (17:37 +0000)]
[PowerPC][MC] Support expressions in getMemRIX16Encoding.

Loosens an assert in getMemRIX16Encoding that restricts DQ-form instructions to
using an immediate, so that we can assemble instructions like lxv/stxv where the
offset is an expression.

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

llvm-svn: 340761

5 years ago[NVPTX] Implement isLegalToVectorizeLoadChain
Benjamin Kramer [Mon, 27 Aug 2018 17:29:43 +0000 (17:29 +0000)]
[NVPTX] Implement isLegalToVectorizeLoadChain

This lets LSV nicely split up underaligned chains.

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

llvm-svn: 340760

5 years agoCleanup after rL340729
Kirill Bobyrev [Mon, 27 Aug 2018 17:26:43 +0000 (17:26 +0000)]
Cleanup after rL340729

llvm-svn: 340759

5 years agoRevert "[lsan] Do not check for leaks in the forked process"
Vitaly Buka [Mon, 27 Aug 2018 17:26:28 +0000 (17:26 +0000)]
Revert "[lsan] Do not check for leaks in the forked process"

Users need leak reports in forks.

This reverts commit r334036.

llvm-svn: 340758

5 years ago[X86] When lowering v32i8 MULHS/MULHU, shuffle after the PACKUS rather than before.
Craig Topper [Mon, 27 Aug 2018 17:20:41 +0000 (17:20 +0000)]
[X86] When lowering v32i8 MULHS/MULHU, shuffle after the PACKUS rather than before.

We're using a 256-bit PACKUS to do the truncation, but that instruction operates on 128-bit lanes. So previously we shuffled first to rearrange the lanes. But that requires 2 shuffles. Instead we can shuffle after the PACKUS using a single VPERMQ. This matches what our normal LowerTRUNCATE code does when it uses PACKUS.

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

llvm-svn: 340757

5 years ago[X86] Add support for matching paddus patterns where one of the vectors is a constant.
Craig Topper [Mon, 27 Aug 2018 17:20:38 +0000 (17:20 +0000)]
[X86] Add support for matching paddus patterns where one of the vectors is a constant.

InstCombine mucks these up a bit. So we need to do some additional pattern matching to fix it. There are a still a few special cases not handled, but this covers the general case.

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

llvm-svn: 340756

5 years ago[llvm-mca] Introduce the llvm-mca library and organize the directory accordingly...
Matt Davis [Mon, 27 Aug 2018 17:16:32 +0000 (17:16 +0000)]
[llvm-mca] Introduce the llvm-mca library and organize the directory accordingly. NFC.

Summary:
This patch introduces llvm-mca as a library.  The driver (llvm-mca.cpp), views, and stats, are not part of the library.
Those are separate components that are not required for the functioning of llvm-mca.

The directory has been organized as follows:
All library source files now reside in:
  - `lib/HardwareUnits/` - All subclasses of HardwareUnit (these represent the simulated hardware components of a backend).
      (LSUnit does not inherit from HardwareUnit, but Scheduler does which uses LSUnit).
  - `lib/Stages/` - All subclasses of the pipeline stages.
  - `lib/` - This is the root of the library and contains library code that does not fit into the Stages or HardwareUnit subdirs.

All library header files now reside in the `include` directory and mimic the same layout as the `lib` directory mentioned above.

In the (near) future we would like to move the library (include and lib) contents from tools and into the core of llvm somewhere.
That change would allow various analysis and optimization passes to make use of MCA  functionality for things like cost modeling.

I left all of the non-library code just where it has always been, in the root of the llvm-mca directory.
The include directives for the non-library source file have been updated to refer to the llvm-mca library headers.
I updated the llvm-mca/CMakeLists.txt file to include the library headers, but I made the non-library code
explicitly reference the library's 'include' directory.  Once we eventually (hopefully) migrate the MCA library
components into llvm the include directives used by the non-library source files will be updated to point to the
proper location in llvm.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits

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

llvm-svn: 340755

5 years ago[llvm-mca] Remove unused method. NFC.
Matt Davis [Mon, 27 Aug 2018 16:52:31 +0000 (16:52 +0000)]
[llvm-mca] Remove unused method. NFC.

llvm-svn: 340754

5 years ago[lit, python] Remove quotes around %python in cache.ll
Stella Stamenova [Mon, 27 Aug 2018 16:33:13 +0000 (16:33 +0000)]
[lit, python] Remove quotes around %python in cache.ll

Summary: We needed quotes around %python before to make python work correctly (on Windows) if the path contains spaces. I recently made a change so that %python now inherently has quotes, so now adding quotes around %python makes the test fail because the quotes cancel each other.

Reviewers: asmith, inglorion

Subscribers: mehdi_amini, eraman, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 340753

5 years agoMark P0556 as 'in progress'
Marshall Clow [Mon, 27 Aug 2018 16:07:01 +0000 (16:07 +0000)]
Mark P0556 as 'in progress'

llvm-svn: 340752

5 years agoUse a lambda for calls to ::open in RetryAfterSignal
Hans Wennborg [Mon, 27 Aug 2018 15:55:39 +0000 (15:55 +0000)]
Use a lambda for calls to ::open in RetryAfterSignal

In Bionic, open can be overloaded for _FORTIFY_SOURCE support, causing
compile errors of RetryAfterSignal due to overload resolution. Wrapping
the call in a lambda avoids this.

Based on a patch by Chih-Wei Huang <cwhuang@linux.org.tw>!

llvm-svn: 340751

5 years ago[WebAssembly] Added default stack-only instruction mode for MC.
Wouter van Oortmerssen [Mon, 27 Aug 2018 15:45:51 +0000 (15:45 +0000)]
[WebAssembly] Added default stack-only instruction mode for MC.

Summary:
Made it convert from register to stack based instructions, and removed the registers.
Fixes to related code that was expecting register based instructions.
Added the correct testing flag to all tests, depending on what the
format they were expecting so far.
Translated one test to stack format as example: reg-stackify-stack.ll

tested:
llvm-lit -v `find test -name WebAssembly`
unittests/MC/*

Reviewers: dschuff, sunfish

Subscribers: sbc100, jgravelle-google, eraman, aheejin, llvm-commits, jfb

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

llvm-svn: 340750

5 years ago[docs] Mention clangd-dev in clangd documentation
Kirill Bobyrev [Mon, 27 Aug 2018 15:38:49 +0000 (15:38 +0000)]
[docs] Mention clangd-dev in clangd documentation

Since the clangd-dev is intended to be the place for clangd-related
discussions, we should point new users to this mailing list while
probably mentioning cfe-dev, too.

Reviewed by: ioeric

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

llvm-svn: 340749

5 years agoLet the CompilerInstance create our clang ASTContext
Raphael Isemann [Mon, 27 Aug 2018 15:18:33 +0000 (15:18 +0000)]
Let the CompilerInstance create our clang ASTContext

Summary:
Now that we moved the BuiltinContext and SelectorTable to the
CompilerInstance, we can also get rid of manually creating our
own ASTContext, but just use the one from the CompilerInstance
(which will be created with the same settings).

Reviewers: vsk, aprantl, davide

Reviewed By: davide

Subscribers: lldb-commits

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

llvm-svn: 340748

5 years agoDisable use-color if the output stream is not a terminal with color support.
Raphael Isemann [Mon, 27 Aug 2018 15:16:25 +0000 (15:16 +0000)]
Disable use-color if the output stream is not a terminal with color support.

Summary:
LLDB currently only checks the output terminal for color support by looking
at the `TERM` environment variable and comparing it to `"dumb"`. This causes that
when running LLDB on a CI node, the syntax highlighter will not be deactivated by
LLDB and the output log is filled with color codes (unless the terminal emulator
actually exposes itself as dumb).

This patch now relies on the LLVM code for detecting color support which is more
reliable. We now also correctly actually initialize the `m_supports_colors` variable in `File`.
`m_supports_colors` was so far uninitialized, but the code path that uses `m_supports_colors`
was also dead so the sanitizers didn't sound an alarm.

The old check that compares `TERM` is not removed by this patch as the new LLVM code
doesn't seem to handle this case (and it's a good thing to check for "dumb" terminals).

Reviewers: aprantl, javed.absar

Reviewed By: aprantl

Subscribers: kristof.beyls, abidh, lldb-commits

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

llvm-svn: 340747

5 years ago[llvm-mca] Improved report generated by the SchedulerStatistics view.
Andrea Di Biagio [Mon, 27 Aug 2018 14:52:52 +0000 (14:52 +0000)]
[llvm-mca] Improved report generated by the SchedulerStatistics view.

Before this patch, the SchedulerStatistics only printed the maximum number of
buffer entries consumed in each scheduler's queue at a given point of the
simulation.

This patch restructures the reported table, and adds an extra field named
"Average number of used buffer entries" to it.
This patch also uses different colors to help identifying bottlenecks caused by
high scheduler's buffer pressure.

llvm-svn: 340746

5 years ago[OpenMP][Fix] Ensure comparison between unsigned values.
Gheorghe-Teodor Bercea [Mon, 27 Aug 2018 14:52:20 +0000 (14:52 +0000)]
[OpenMP][Fix] Ensure comparison between unsigned values.

Summary: Ensure the values being compared are both unsigned.

Reviewers: ABataev, Hahnfeld, caomhin, grokos, AndreyChurbanov

Reviewed By: AndreyChurbanov

Subscribers: AndreyChurbanov, guansong, openmp-commits

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

llvm-svn: 340745

5 years agofix comment typo
Nico Weber [Mon, 27 Aug 2018 14:25:22 +0000 (14:25 +0000)]
fix comment typo

llvm-svn: 340744

5 years agofix comment typo
Nico Weber [Mon, 27 Aug 2018 14:23:50 +0000 (14:23 +0000)]
fix comment typo

llvm-svn: 340743

5 years agofix comment typo
Nico Weber [Mon, 27 Aug 2018 14:22:25 +0000 (14:22 +0000)]
fix comment typo

llvm-svn: 340742

5 years ago[SelectionDAG] add helper query for binops; NFC
Sanjay Patel [Mon, 27 Aug 2018 14:20:15 +0000 (14:20 +0000)]
[SelectionDAG] add helper query for binops; NFC

We will also use this in a planned enhancement for vector insertelement.

llvm-svn: 340741

5 years ago[PowerPC] Revert commit r339779
Nemanja Ivanovic [Mon, 27 Aug 2018 13:20:42 +0000 (13:20 +0000)]
[PowerPC] Revert commit r339779

This commit has caused failures in some internal benchmarks. Temporarily
reverting this patch until the issue can be diagnosed and fixed.

llvm-svn: 340740

5 years ago[ELF][HEXAGON] Add R_HEX_11/10/9_X support
Sid Manning [Mon, 27 Aug 2018 12:55:28 +0000 (12:55 +0000)]
[ELF][HEXAGON] Add R_HEX_11/10/9_X support

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

llvm-svn: 340739

5 years agoHandle identifying AMDGPU bitcode files
Matt Arsenault [Mon, 27 Aug 2018 12:40:00 +0000 (12:40 +0000)]
Handle identifying AMDGPU bitcode files

llvm-svn: 340738

5 years ago[X86] Adding the test pointing to the fail case of D45653
Aleksandr Urakov [Mon, 27 Aug 2018 11:56:32 +0000 (11:56 +0000)]
[X86] Adding the test pointing to the fail case of D45653

Summary:
This commit adds the case of tail calling a sret function from a non-sret
function when both functions have the C calling convention.

llvm-svn: 340737

5 years ago[Sparc] Avoid writing outside array in applyFixup
Daniel Cederman [Mon, 27 Aug 2018 11:43:59 +0000 (11:43 +0000)]
[Sparc] Avoid writing outside array in applyFixup

Summary: If an object file ends with a relocation that is smaller
than 4 bytes we will write outside the Data array and trigger an
"Invalid index" assertion.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 340736

5 years ago[NFC][X86] Fix `sibcall.ll` formatting
Aleksandr Urakov [Mon, 27 Aug 2018 11:25:38 +0000 (11:25 +0000)]
[NFC][X86] Fix `sibcall.ll` formatting

Summary:
Remove unnecessary lines from `sibcall.ll` and rename labels according
to @RKSimon's recommendations in the D45653 conversation.

llvm-svn: 340735

5 years ago[PowerPC] Recommit r340016 after fixing the reported issue
Nemanja Ivanovic [Mon, 27 Aug 2018 11:20:27 +0000 (11:20 +0000)]
[PowerPC] Recommit r340016 after fixing the reported issue

The internal benchmark failure reported by Google was due to a missing
check for the result type for the sign-extend and shift DAG. This commit
adds the check and re-commits the patch.

llvm-svn: 340734

5 years ago[Sparc] Add support for the cycle counter available in GR740
Daniel Cederman [Mon, 27 Aug 2018 11:11:47 +0000 (11:11 +0000)]
[Sparc] Add support for the cycle counter available in GR740

Summary: The GR740 provides an up cycle counter in the registers ASR22
and ASR23. As these registers can not be read together atomically we only
use the value of ASR23 for llvm.readcyclecounter(). The ASR23 register
holds the 32 LSBs of the up-counter.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: jfb, fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 340733

5 years ago[NFC] Try to make buildbot happy about virtual destructors
Max Kazantsev [Mon, 27 Aug 2018 10:09:28 +0000 (10:09 +0000)]
[NFC] Try to make buildbot happy about virtual destructors

llvm-svn: 340732

5 years ago[clangd] Use TRUE iterator instead of complete posting list
Kirill Bobyrev [Mon, 27 Aug 2018 09:47:50 +0000 (09:47 +0000)]
[clangd] Use TRUE iterator instead of complete posting list

Stop using `$$$` (empty) trigram and generating a posting list with all
items. Since TRUE iterator is already implemented and correctly inserted
when there are no real trigram posting lists, this is a valid
transformation.

Benchmarks show that this simple change allows ~30% speedup on dataset
of real completion queries.

Before

```
-------------------------------------------------------
Benchmark                Time           CPU Iterations
-------------------------------------------------------
DexAdHocQueries    5640321 ns    5640265 ns        120
DexRealQ         939835603 ns  939830296 ns          1
```

After

```
-------------------------------------------------------
Benchmark                Time           CPU Iterations
-------------------------------------------------------
DexAdHocQueries    3452014 ns    3451987 ns        203
DexRealQ         667455912 ns  667455750 ns          1
```

Reviewed by: ilya-biryukov

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

llvm-svn: 340729

5 years ago[NFC] Split logic of ImplicitControlFlowTracking to allow generalization
Max Kazantsev [Mon, 27 Aug 2018 09:43:16 +0000 (09:43 +0000)]
[NFC] Split logic of ImplicitControlFlowTracking to allow generalization

We have a class `ImplicitControlFlowTracking` which allows us to keep track of
instructions that can abnormally exit and answer queries like "whether or not
there is side-exiting instruction above this instruction in its block".

We may want to have the similar tracking for other types of "special" instructions,
for example instructions that write memory.

This patch separates ImplicitControlFlowTracking into two classes, isolating all
general logic not related to implicit control flow into its parent class. We can
later make another child of this class to keep track of instructions that write
memory.

The motivation for that is that we want to make these checks efficiently in the
patch https://reviews.llvm.org/D50891.

NOTE: The naming of the parent class is not super cool, but the other options we
have are hardly better. Please feel free to rename it as NFC if you think you've
found a more informative name for it.

Differential Revision: https://reviews.llvm.org/D50954
Reviewed By: fedor.sergeev

llvm-svn: 340728

5 years agoTry to fix this clang driver test case after r340709.
Chandler Carruth [Mon, 27 Aug 2018 08:49:20 +0000 (08:49 +0000)]
Try to fix this clang driver test case after r340709.

If any of the bots complain about this, I'll just revert. This test case
is essentially trying to test the exact change made, but I think this
matches the intent of the patch in question.

llvm-svn: 340727

5 years ago[COFF] Support MinGW automatic dllimport of data
Martin Storsjo [Mon, 27 Aug 2018 08:43:31 +0000 (08:43 +0000)]
[COFF] Support MinGW automatic dllimport of data

Normally, in order to reference exported data symbols from a different
DLL, the declarations need to have the dllimport attribute, in order to
use the __imp_<var> symbol (which contains an address to the actual
variable) instead of the variable itself directly. This isn't an issue
in the same way for functions, since any reference to the function without
the dllimport attribute will end up as a reference to a thunk which loads
the actual target function from the import address table (IAT).

GNU ld, in MinGW environments, supports automatically importing data
symbols from DLLs, even if the references didn't have the appropriate
dllimport attribute. Since the PE/COFF format doesn't support the kind
of relocations that this would require, the MinGW's CRT startup code
has an custom framework of their own for manually fixing the missing
relocations once module is loaded and the target addresses in the IAT
are known.

For this to work, the linker (originall in GNU ld) creates a list of
remaining references needing fixup, which the runtime processes on
startup before handing over control to user code.

While this feature is rather controversial, it's one of the main features
allowing unix style libraries to be used on windows without any extra
porting effort.

Some sort of automatic fixing of data imports is also necessary for the
itanium C++ ABI on windows (as clang implements it right now) for importing
vtable pointers in certain cases, see D43184 for some discussion on that.

The runtime pseudo relocation handler supports 8/16/32/64 bit addresses,
either PC relative references (like IMAGE_REL_*_REL32*) or absolute
references (IMAGE_REL_AMD64_ADDR32, IMAGE_REL_AMD64_ADDR32,
IMAGE_REL_I386_DIR32). On linking, the relocation is handled as a
relocation against the corresponding IAT slot. For the absolute references,
a normal base relocation is created, to update the embedded address
in case the image is loaded at a different address.

The list of runtime pseudo relocations contains the RVA of the
imported symbol (the IAT slot), the RVA of the location the relocation
should be applied to, and a size of the memory location. When the
relocations are fixed at runtime, the difference between the actual
IAT slot value and the IAT slot address is added to the reference,
doing the right thing for both absolute and relative references.

With this patch alone, things work fine for i386 binaries, and mostly
for x86_64 binaries, with feature parity with GNU ld. Despite this,
there are a few gotchas:
- References to data from within code works fine on both x86 architectures,
  since their relocations consist of plain 32 or 64 bit absolute/relative
  references. On ARM and AArch64, references to data doesn't consist of
  a plain 32 or 64 bit embedded address or offset in the code. On ARMNT,
  it's usually a MOVW+MOVT instruction pair represented by a
  IMAGE_REL_ARM_MOV32T relocation, each instruction containing 16 bit of
  the target address), on AArch64, it's usually an ADRP+ADD/LDR/STR
  instruction pair with an even more complex encoding, storing a PC
  relative address (with a range of +/- 4 GB). This could theoretically
  be remedied by extending the runtime pseudo relocation handler with new
  relocation types, to support these instruction encodings. This isn't an
  issue for GCC/GNU ld since they don't support windows on ARMNT/AArch64.
- For x86_64, if references in code are encoded as 32 bit PC relative
  offsets, the runtime relocation will fail if the target turns out to be
  out of range for a 32 bit offset.
- Fixing up the relocations at runtime requires making sections writable
  if necessary, with the VirtualProtect function. In Windows Store/UWP apps,
  this function is forbidden.

These limitations are addressed by a few later patches in lld and
llvm.

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

llvm-svn: 340726

5 years ago[COFF] Expose an easier helper function for getting names for relocation types
Martin Storsjo [Mon, 27 Aug 2018 08:42:39 +0000 (08:42 +0000)]
[COFF] Expose an easier helper function for getting names for relocation types

The existing method is protected, and requires using DataRefImpl
and SmallVector.

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

llvm-svn: 340725

5 years ago[Sparc] Custom bitcast between f64 and v2i32
Daniel Cederman [Mon, 27 Aug 2018 07:14:53 +0000 (07:14 +0000)]
[Sparc] Custom bitcast between f64 and v2i32

Summary:
Currently bitcasting constants from f64 to v2i32 is done by storing the
value to the stack and then loading it again. This is not necessary, but
seems to happen because v2i32 is a valid type for Sparc V8. If it had not
been legal, we would have gotten help from the type legalizer.

This patch tries to do the same work as the legalizer would have done by
bitcasting the floating point constant and splitting the value up into a
vector of two i32 values.

Reviewers: venkatra, jyknight

Reviewed By: jyknight

Subscribers: glaubitz, fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 340723

5 years ago[RISCV] atomic_store_nn have a different layout to regular store
Roger Ferrer Ibanez [Mon, 27 Aug 2018 07:08:18 +0000 (07:08 +0000)]
[RISCV] atomic_store_nn have a different layout to regular store

We cannot directy reuse the patterns of StPat because for some reason the store
DAG node and the atomic_store_nn DAG nodes put the ptr and the value in
different positions. Currently we attempt to store the address to an address
formed by the value.

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

llvm-svn: 340722

5 years agoFix this file to have the necessary standard library includes and use
Chandler Carruth [Mon, 27 Aug 2018 06:52:14 +0000 (06:52 +0000)]
Fix this file to have the necessary standard library includes and use
the `std::` namespace. Should fix a number of build bots as well.

llvm-svn: 340721

5 years ago[X86] Cleanup the LowerMULH code by hoisting some commonalities between the vXi32...
Craig Topper [Mon, 27 Aug 2018 06:35:02 +0000 (06:35 +0000)]
[X86] Cleanup the LowerMULH code by hoisting some commonalities between the vXi32 and vXi8 handling. NFCI

vXi32 support was recently moved from LowerMUL_LOHI to LowerMULH.

This commit shares the getOperand calls, switches both to use common IsSigned flag, and hoists the NumElems/NumElts variable.

llvm-svn: 340720

5 years ago[X86] Add intrinsics for kand/kandn/knot/kor/kxnor/kxor with 8, 32, and 64-bit mask...
Craig Topper [Mon, 27 Aug 2018 06:20:22 +0000 (06:20 +0000)]
[X86] Add intrinsics for kand/kandn/knot/kor/kxnor/kxor with 8, 32, and 64-bit mask registers.

This also adds a second intrinsic name for the 16-bit mask versions.

These intrinsics match gcc and icc. They just aren't published in the Intel Intrinsics Guide so I only recently found they existed.

llvm-svn: 340719

5 years ago[X86] Remove min_vector_width 512 from some intrinsics that operate only on k-registers.
Craig Topper [Mon, 27 Aug 2018 06:20:20 +0000 (06:20 +0000)]
[X86] Remove min_vector_width 512 from some intrinsics that operate only on k-registers.

llvm-svn: 340718

5 years ago[X86] Rename __DEFAULT_FN_ATTRS to a__DEFAULT_FN_ATTRS512 in avx512dqintrin.h and...
Craig Topper [Mon, 27 Aug 2018 06:20:19 +0000 (06:20 +0000)]
[X86] Rename __DEFAULT_FN_ATTRS to a__DEFAULT_FN_ATTRS512 in avx512dqintrin.h and avx512bwintrin.h.

This is preparation for adding removing min_vector_width 512 from some intrinsics.

llvm-svn: 340717

5 years agoRename a function to follow the LLVM coding style.
Rui Ueyama [Mon, 27 Aug 2018 06:18:10 +0000 (06:18 +0000)]
Rename a function to follow the LLVM coding style.

llvm-svn: 340716

5 years ago[COFF] Check the instructions in ARM MOV32T relocations
Martin Storsjo [Mon, 27 Aug 2018 06:04:36 +0000 (06:04 +0000)]
[COFF] Check the instructions in ARM MOV32T relocations

For this relocation, which applies to two consecutive instructions,
it's plausible that the second instruction might not actually be
the right one.

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

llvm-svn: 340715

5 years ago[X86] Undef __DEFAULT_FN_ATTRS in avx512fintrin.h.
Craig Topper [Mon, 27 Aug 2018 05:44:45 +0000 (05:44 +0000)]
[X86] Undef __DEFAULT_FN_ATTRS in avx512fintrin.h.

Fixes test failure after r340713

llvm-svn: 340714

5 years ago[X86] Don't set min_vector_width to 512 on intrinsics that only operate on k registers.
Craig Topper [Mon, 27 Aug 2018 05:27:15 +0000 (05:27 +0000)]
[X86] Don't set min_vector_width to 512 on intrinsics that only operate on k registers.

llvm-svn: 340713

5 years ago[Xray] Darwin - Enable in the driver side
David Carlier [Mon, 27 Aug 2018 05:16:09 +0000 (05:16 +0000)]
[Xray] Darwin - Enable in the driver side

Reviewers: dberris

Reviered By: dberris

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

llvm-svn: 340712

5 years ago[MS Demangler] Add virtual destructor.
Zachary Turner [Mon, 27 Aug 2018 04:04:41 +0000 (04:04 +0000)]
[MS Demangler] Add virtual destructor.

Silence -Wnon-virtual-dtor.

llvm-svn: 340711

5 years ago[MS Demangler] Re-write the Microsoft demangler.
Zachary Turner [Mon, 27 Aug 2018 03:48:03 +0000 (03:48 +0000)]
[MS Demangler] Re-write the Microsoft demangler.

This is a pretty large refactor / re-write of the Microsoft
demangler.  The previous one was a little hackish because it
evolved as I was learning about all the various edge cases,
exceptions, etc.  It didn't have a proper AST and so there was
lots of custom handling of things that should have been much
more clean.

Taking what was learned from that experience, it's now
re-written with a completely redesigned and much more sensible
AST.  It's probably still not perfect, but at least it's
comprehensible now to someone else who wants to come along
and make some modifications or read the code.

Incidentally, this fixed a couple of bugs, so I've enabled
the tests which now pass.

llvm-svn: 340710

5 years ago[Driver] Change MipsLinux default linker from "lld" to "ld.lld"
Fangrui Song [Sun, 26 Aug 2018 19:47:23 +0000 (19:47 +0000)]
[Driver] Change MipsLinux default linker from "lld" to "ld.lld"

Reviewers: kzhuravl, atanasyan

Reviewed By: atanasyan

Subscribers: sdardis, arichardson, jrtc27, atanasyan, cfe-commits

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

llvm-svn: 340709

5 years ago[X86] Correct the cost of (v4i32 (fptoui (v4f64))) under AVX512F.
Craig Topper [Sun, 26 Aug 2018 18:47:44 +0000 (18:47 +0000)]
[X86] Correct the cost of (v4i32 (fptoui (v4f64))) under AVX512F.

Summary: This was inheriting the cost from the AVX table, but should be legal under AVX512.

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 340708