platform/upstream/llvm.git
6 years agoPrintStatistics() and PrintStatisticsJSON() should take StatLock
Daniel Sanders [Tue, 6 Mar 2018 21:16:42 +0000 (21:16 +0000)]
PrintStatistics() and PrintStatisticsJSON() should take StatLock

These two functions iterate over the list of statistics but don't take the lock
that protects the iterators from being invalidated by
StatisticInfo::addStatistic().

So far, this hasn't been an issue since (in-tree at least) these functions are
called by the StatisticInfo destructor so addStatistic() shouldn't be called
anymore. However, we do expose them in the public API.

Note that this only protects against iterator invalidation and does not protect
against ordering issues caused by statistic updates that race with
PrintStatistics()/PrintStatisticsJSON().

Thanks to Roman Tereshin for spotting it

llvm-svn: 326834

6 years ago[scudo] Use gc-sections by default
Kostya Kortchinsky [Tue, 6 Mar 2018 20:13:37 +0000 (20:13 +0000)]
[scudo] Use gc-sections by default

Summary:
If not using `-Wl,--gc-sections`, a whole lot of unused `sanitizer_common` code
and related static variables are pulled into the shared library.
Keep the binary size smaller, and its memory footprint smaller as well, by
using the compiler flags `-ffunction-section` & `-fdata-sections` by default,
as well as the linker flags `-Wl,--gc-sections`.

Current experiments show a large discrepency between binary sizes generated
by gcc (big) and clang (small). I am not sure yet how I can make a test that
would encompass both, so it's an outstanding work item.

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

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

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

llvm-svn: 326833

6 years ago[TargetLowering] Rename DAGCombinerInfo::isAfterLegalizeVectorOps to DAGCombiner...
Craig Topper [Tue, 6 Mar 2018 19:44:52 +0000 (19:44 +0000)]
[TargetLowering] Rename DAGCombinerInfo::isAfterLegalizeVectorOps to DAGCombiner::isAfterLegalizeDAG since that's what it checks. NFC

The code checks Level == AfterLegalizeDAG which is the fourth and last of the possible DAG combine stages that we have.

There is a Level called AfterLegalVectorOps, but that's the third DAG combine and it doesn't always run.

A function called isAfterLegalVectorOps should imply it returns true in either of the DAG combines that runs after the legalize vector ops stage, but that's not what this function does.

llvm-svn: 326832

6 years ago[SymboleFilePDB] Put the test input back that my previous commit clobbered
Aaron Smith [Tue, 6 Mar 2018 19:36:17 +0000 (19:36 +0000)]
[SymboleFilePDB] Put the test input back that my previous commit clobbered

llvm-svn: 326831

6 years ago[Hexagon] Update more testcases
Krzysztof Parzyszek [Tue, 6 Mar 2018 19:15:58 +0000 (19:15 +0000)]
[Hexagon] Update more testcases

llvm-svn: 326830

6 years ago[Hexagon] Remove {{ *}} from testcases
Krzysztof Parzyszek [Tue, 6 Mar 2018 19:07:21 +0000 (19:07 +0000)]
[Hexagon] Remove {{ *}} from testcases

The spaces in the instructions are now consistent.

llvm-svn: 326829

6 years ago[InstCombine] simplify min/max canonicalization; NFCI
Sanjay Patel [Tue, 6 Mar 2018 19:01:18 +0000 (19:01 +0000)]
[InstCombine] simplify min/max canonicalization; NFCI

llvm-svn: 326828

6 years ago[OPENMP] Fix generation of the unique names for task reduction
Alexey Bataev [Tue, 6 Mar 2018 18:59:43 +0000 (18:59 +0000)]
[OPENMP] Fix generation of the unique names for task reduction
variables.

If the task has reduction construct and this construct for some variable
requires unique threadprivate storage, we may generate different names
for variables used in taskgroup task_reduction clause and in task
  in_reduction clause. Patch fixes this problem.

llvm-svn: 326827

6 years ago[X86] Reject registers that require a REX prefix in inline asm constraints in 32...
Craig Topper [Tue, 6 Mar 2018 18:56:33 +0000 (18:56 +0000)]
[X86] Reject registers that require a REX prefix in inline asm constraints in 32-bit mode

We don't currently reject r8-r15 or xmm8-32 or bpl/spl/sil/dil in 32-bit mode.

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

llvm-svn: 326826

6 years ago[AMDGPU] Add default ISA version targets
Stanislav Mekhanoshin [Tue, 6 Mar 2018 18:33:55 +0000 (18:33 +0000)]
[AMDGPU] Add default ISA version targets

In case if -mattr used to modify feature set bits in llvm-mc call
getIsaVersion can fail to identify specific ISA due to test mismatch.
Adding default fallback tests which will always correctly report at
least major version.

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

llvm-svn: 326825

6 years ago[CodeView] Emit UdtSourceLine information for enums
Aaron Smith [Tue, 6 Mar 2018 18:20:22 +0000 (18:20 +0000)]
[CodeView] Emit UdtSourceLine information for enums

Summary:
- Emit UdtSourceLine information for enums to match MSVC

- Add a method to add UDTSrcLine and call it for all Class/Struct/Union/Enum

- Update test cases to verify the changes

Reviewers: zturner, llvm-commits, rnk

Reviewed By: rnk

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

llvm-svn: 326824

6 years ago[PatternMatch] define m_Not using m_Xor and cst_pred_ty
Sanjay Patel [Tue, 6 Mar 2018 18:19:42 +0000 (18:19 +0000)]
[PatternMatch] define m_Not using m_Xor and cst_pred_ty

Using cst_pred_ty in the definition allows us to match vectors with undef elements.

This is a continuation of an effort to make all pattern matchers allow undef elements in vectors:
rL325437
rL325466
D43792

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

llvm-svn: 326823

6 years agoTableGen: Give up on exact fixits for diagnostic groups
Nicolai Haehnle [Tue, 6 Mar 2018 17:55:00 +0000 (17:55 +0000)]
TableGen: Give up on exact fixits for diagnostic groups

With recent changes in the TableGen frontend, we no longer have usable
location information for anonymous defs.

Fixes test breakage caused by r326788.

The normal, non-error TableGen output is not affected by this change.

llvm-svn: 326822

6 years agolgamma_r: Move code from .inc to .cl file
Jan Vesely [Tue, 6 Mar 2018 17:48:47 +0000 (17:48 +0000)]
lgamma_r: Move code from .inc to .cl file

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326821

6 years agofrexp: Reuse types provided by gentype.inc
Jan Vesely [Tue, 6 Mar 2018 17:48:45 +0000 (17:48 +0000)]
frexp: Reuse types provided by gentype.inc

v2: Use select instead of bitselect to consolidate scalar and vector
versions

Passes CTS on Carrizo

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326820

6 years agoselect: Add vector implementation
Jan Vesely [Tue, 6 Mar 2018 17:48:43 +0000 (17:48 +0000)]
select: Add vector implementation

Passes CTS on Carrizo

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326819

6 years agominmag: Condition variable needs to be the same bitwidth as operands
Jan Vesely [Tue, 6 Mar 2018 17:48:40 +0000 (17:48 +0000)]
minmag: Condition variable needs to be the same bitwidth as operands

No changes wrt CTS

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326818

6 years agomaxmag: Condition variable needs to be the same bitwidth as operands
Jan Vesely [Tue, 6 Mar 2018 17:48:38 +0000 (17:48 +0000)]
maxmag: Condition variable needs to be the same bitwidth as operands

No changes wrt CTS

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326817

6 years agoMove cl_khr_fp64 exntension enablement to gentype include lists
Jan Vesely [Tue, 6 Mar 2018 17:48:35 +0000 (17:48 +0000)]
Move cl_khr_fp64 exntension enablement to gentype include lists

This will make adding cl_khr_fp16 support easier

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326816

6 years ago[clang-format] Improve detection of ObjC for-in statements
Ben Hamilton [Tue, 6 Mar 2018 17:21:42 +0000 (17:21 +0000)]
[clang-format] Improve detection of ObjC for-in statements

Summary:
Previously, clang-format would detect the following as an
Objective-C for-in statement:

  for (int x = in.value(); ...) {}

because the logic only decided a for-loop was definitely *not*
an Objective-C for-in loop after it saw a semicolon or a colon.

To fix this, I delayed the decision of whether this was a for-in
statement until after we found the matching right-paren, at which
point we know if we've seen a semicolon or not.

Test Plan: New tests added. Ran tests with:
  make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: krasimir, jolesiak

Reviewed By: jolesiak

Subscribers: djasper, cfe-commits, klimek

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

llvm-svn: 326815

6 years agoRefactor check for dllimport in the Verifier.
Rafael Espindola [Tue, 6 Mar 2018 17:19:23 +0000 (17:19 +0000)]
Refactor check for dllimport in the Verifier.

This avoids duplicated code and now also rejects dllimport aliases.

llvm-svn: 326814

6 years agoImprove duplicated version handling.
Rafael Espindola [Tue, 6 Mar 2018 17:05:12 +0000 (17:05 +0000)]
Improve duplicated version handling.

It looks like the problem that caused us to originally warn instead of
error was that of a symbol being assigned to the same version twice.

Now we don't warn if a symbol is assigned to the same version twice,
but error if it is assigned to multiple.

This fixes pr28342.

llvm-svn: 326813

6 years ago[ValueTracking] move helpers for SelectPatterns from InstCombine to ValueTracking
Sanjay Patel [Tue, 6 Mar 2018 16:57:55 +0000 (16:57 +0000)]
[ValueTracking] move helpers for SelectPatterns from InstCombine to ValueTracking

Most of the folds based on SelectPatternResult belong in InstSimplify rather than
InstCombine, so the helper code should be available to other passes/analysis.

llvm-svn: 326812

6 years ago[AArch64] define isExtractSubvectorCheap
Sebastian Pop [Tue, 6 Mar 2018 16:54:55 +0000 (16:54 +0000)]
[AArch64] define isExtractSubvectorCheap

Following the ARM-neon backend, define isExtractSubvectorCheap to return true
when extracting low and high part of a neon register.

The patch disables a test in llvm/test/CodeGen/AArch64/arm64-ext.ll This
testcase is fragile in the sense that it requires a BUILD_VECTOR to "survive"
all DAG transforms until ISelLowering. The testcase is supposed to check that
AArch64TargetLowering::ReconstructShuffle() works, and for that we need a
BUILD_VECTOR in ISelLowering. As we now transform the BUILD_VECTOR earlier into
an VEXT + vector_shuffle, we don't have the BUILD_VECTOR pattern when we get to
ISelLowering. As there is no way to disable the combiner to only exercise the
code in ISelLowering, the patch disables the testcase.

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

llvm-svn: 326811

6 years ago[Asm] Fix another layering violation in assmebly macro dumping
Oliver Stannard [Tue, 6 Mar 2018 16:51:17 +0000 (16:51 +0000)]
[Asm] Fix another layering violation in assmebly macro dumping

AsmToken is in the MCParser library, so we can't use its dump function from
MCAsmMacro in the MC library. Instead, just print the string, which we don't
need the MCParser library for.

llvm-svn: 326810

6 years ago[clangd] Don't end completion item labels with '::'
Ilya Biryukov [Tue, 6 Mar 2018 16:45:21 +0000 (16:45 +0000)]
[clangd] Don't end completion item labels with '::'

llvm-svn: 326809

6 years ago[Pipeliner] Test commit: fixed spelling mistake in comments
Roorda, Jan-Willem [Tue, 6 Mar 2018 16:26:01 +0000 (16:26 +0000)]
[Pipeliner] Test commit: fixed spelling mistake in comments

Reviewers: bcahoon

Subscribers: llvm-commits

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

llvm-svn: 326808

6 years ago[X86] Fix typo in cpuid.h, bit_AVX51SER->bit_AVX512ER.
Craig Topper [Tue, 6 Mar 2018 16:06:44 +0000 (16:06 +0000)]
[X86] Fix typo in cpuid.h, bit_AVX51SER->bit_AVX512ER.

llvm-svn: 326807

6 years ago[AMDGPU] Fix lowering OpenCL enqueue_kernel
Yaxun Liu [Tue, 6 Mar 2018 16:04:39 +0000 (16:04 +0000)]
[AMDGPU] Fix lowering OpenCL enqueue_kernel

One addrspacecast disappeared in clang emitted IR for
block invoke function due to adoption of the new
addr space mapping.

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

llvm-svn: 326806

6 years agoRewrite TestTargetSymbolsBuildidCase to be more focused
Pavel Labath [Tue, 6 Mar 2018 15:56:20 +0000 (15:56 +0000)]
Rewrite TestTargetSymbolsBuildidCase to be more focused

Summary:
The test was failing in remote debugging scenario with windows as a host
as cmd.exe is not able to parse the complicated shell commands in the
Makefile.

The test seemed like a perfect candidate for a more focused testing
approach, so I have rewritten in on top of lldb-test's module-sections
functionality. The slight gotcha there was that the
Module::GetSectionList does not include the sections from the symbol
file until someone manually calls Module::GetSymbolVendor. Normally,
this is not an issue, because someone will have initialized the symbol
vendor by the time anyone starts looking at the sections. However, when
all one this is dump the section list, we run into this problem.

I've tried making this behavior more automatic, but it turns out it's
not that easy, so for now, I just manually initialize the Symbol Vendor
before dumping out the sections in lldb-test.

Reviewers: jankratochvil

Subscribers: lldb-commits

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

llvm-svn: 326805

6 years ago[ARM][Asm] Fix layering violation introduced by r326795
Oliver Stannard [Tue, 6 Mar 2018 15:32:34 +0000 (15:32 +0000)]
[ARM][Asm] Fix layering violation introduced by r326795

The MCAsmMacro::dump function is in the MCParser library, so can't be called
from the MC library.

llvm-svn: 326804

6 years ago[ARM]Decoding MSR with unpredictable destination register causes an assert
Simi Pallipurath [Tue, 6 Mar 2018 15:21:19 +0000 (15:21 +0000)]
[ARM]Decoding MSR with unpredictable destination register causes an assert

This patch handling:

    Enable parsing of raw encodings of system registers .
    Allows UNPREDICTABLE sysregs to be decoded to a raw number in the same way that disasslib does, rather than llvm crashing.
    Disassemble msr/mrs with unpredictable sysregs as SoftFail.
    Fix regression due to SoftFailing some encodings.

Patch by Chris Ryder

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

llvm-svn: 326803

6 years agoOne more test for P0767:
Marshall Clow [Tue, 6 Mar 2018 15:01:55 +0000 (15:01 +0000)]
One more test for P0767:

llvm-svn: 326802

6 years agoImplement P0767R1 - Deprecate POD
Marshall Clow [Tue, 6 Mar 2018 15:01:19 +0000 (15:01 +0000)]
Implement P0767R1 - Deprecate POD

llvm-svn: 326801

6 years agotest commit: fix typo in comment
Simi Pallipurath [Tue, 6 Mar 2018 14:35:23 +0000 (14:35 +0000)]
test commit: fix typo in comment

This is  a simple change to do the test commit and verify commit access.

llvm-svn: 326800

6 years ago[clang-tidy] Fix one corner case in make-unique check.
Haojian Wu [Tue, 6 Mar 2018 14:34:35 +0000 (14:34 +0000)]
[clang-tidy] Fix one corner case in make-unique check.

Summary:
Previously, we tried to cover all "std::initializer_list" implicit conversion
cases in the code, but there are some corner cases that not covered (see
newly-added test in the patch).

Sipping all implicit AST nodes is a better way to filter out all these cases.

Reviewers: ilya-biryukov

Subscribers: klimek, xazax.hun, cfe-commits

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

llvm-svn: 326799

6 years ago[clangd] Address missed comments from D44003
Sam McCall [Tue, 6 Mar 2018 14:30:07 +0000 (14:30 +0000)]
[clangd] Address missed comments from D44003

llvm-svn: 326798

6 years ago[demangler] Modernize the rest of the demangler.
Erik Pilkington [Tue, 6 Mar 2018 14:21:10 +0000 (14:21 +0000)]
[demangler] Modernize the rest of the demangler.

llvm-svn: 326797

6 years ago[demangler] Modernize parse_unresolved_name.
Erik Pilkington [Tue, 6 Mar 2018 14:21:08 +0000 (14:21 +0000)]
[demangler] Modernize parse_unresolved_name.

llvm-svn: 326796

6 years ago[Asm] Add debug printing for assembler macros
Oliver Stannard [Tue, 6 Mar 2018 14:07:01 +0000 (14:07 +0000)]
[Asm] Add debug printing for assembler macros

This adds some debug printing (gated behind the "asm-macros" debug flag) which
can help tracing complicated assembly macros.

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

llvm-svn: 326795

6 years ago[Asm] Refactor debug printing of AsmToken
Oliver Stannard [Tue, 6 Mar 2018 14:02:14 +0000 (14:02 +0000)]
[Asm] Refactor debug printing of AsmToken

* Move printing from llvm-mc to the AsmToken class, so that it can be used elsewhere.
* Add 5 cases which were missed: BigNum, Comment, HashDirective, Space and
  BackSlash, and remove the default case so that -Wswitch will catch this error
  in future.

This is almost NFC, except for the fact that llvm-mc can now print those 5
tokens in -as-lex mode.

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

llvm-svn: 326794

6 years ago[CallSiteSplitting] Do not crash when BB's terminator changes.
Florian Hahn [Tue, 6 Mar 2018 14:00:58 +0000 (14:00 +0000)]
[CallSiteSplitting] Do not crash when BB's terminator changes.

Change doCallSiteSplitting to iterate until we reach the terminator instruction.
tryToSplitCallSite can replace BB's terminator in case BB is a successor of
itself. Then IE will be invalidated and we also have to check the current
terminator.

Reviewers: junbuml, davidxl, davide, fhahn

Reviewed By: fhahn, junbuml

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

llvm-svn: 326793

6 years ago[clang-format] fix handling of consecutive unary operators
Krasimir Georgiev [Tue, 6 Mar 2018 13:56:28 +0000 (13:56 +0000)]
[clang-format] fix handling of consecutive unary operators

Summary:
Code that used to be formatted as `if (! + object) {` is now formatted as `if (!+object) {`
(we have a particular object in our codebase where unary `operator+` is overloaded to return the underlying value, which in this case is a `bool`)

We still preserve the TypeScript behavior where `!` is a trailing non-null operator. (This is already tested by an existing unit test in `FormatTestJS.cpp`)

It doesn't appear like handling of consecutive unary operators are tested in general, so I added another test for completeness

Patch contributed by @kevinl!

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 326792

6 years agoObjectFileMachO: split CreateSections mega-function into more manageable chunks
Pavel Labath [Tue, 6 Mar 2018 13:53:26 +0000 (13:53 +0000)]
ObjectFileMachO: split CreateSections mega-function into more manageable chunks

Summary:
In an effort to understand the function's operation, I've split it into logical
pieces. Parsing of a single segment is moved to a separate function (and the
parsing state that is carried from one segment to another is explicitly
captured in the SegmentParsingContext object). I've also extracted some pieces
of code which were already standalone (validation of the segment load command,
determining the section type, determining segment permissions) into
separate functions.

Parsing of a single section within the segment should probably also be a
separate function, but I've left that for a separate patch.

This patch is intended to be NFC.

Reviewers: clayborg, davide

Subscribers: lldb-commits

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

llvm-svn: 326791

6 years agoTableGen: Add !foldl operation
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:16 +0000 (13:49 +0000)]
TableGen: Add !foldl operation

Change-Id: I63d67bf6e0b315e2d3360e47e3b62c9517f38987
llvm-svn: 326790

6 years agoTableGen: Remove the ResolveFirst mechanism
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:06 +0000 (13:49 +0000)]
TableGen: Remove the ResolveFirst mechanism

Summary:
It is no longer used.

Change-Id: I1e47267d1975d43ad43acd6347f54e958e3b6c86

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326789

6 years agoTableGen: Delay instantiating inline anonymous records
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:01 +0000 (13:49 +0000)]
TableGen: Delay instantiating inline anonymous records

Summary:
Only instantiate anonymous records once all variable references in template
arguments have been resolved. This allows patterns like the new test case,
which in practice can appear in expressions like:

  class IntrinsicTypeProfile<list<LLVMType> ty, int shift> {
    list<LLVMType> types =
      !listconcat(ty, [llvm_any_ty, LLVMMatchType<shift>]);
  }

  class FooIntrinsic<IntrinsicTypeProfile P, ...>
    : Intrinsic<..., P.types, ...>;

Without this change, the anonymous LLVMMatchType instantiation would
never get resolved.

Another consequence of this change is that anonymous inline
instantiations are uniqued via the folding set of the newly introduced
VarDefInit.

Change-Id: I7a7041a20e297cf98c9109b28d85e64e176c932a

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326788

6 years agoTableGen: Move getNewAnonymousName into RecordKeeper
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:54 +0000 (13:48 +0000)]
TableGen: Move getNewAnonymousName into RecordKeeper

Summary:
So that we will be able to generate new anonymous names more easily
outside the parser as well.

Change-Id: I28f396a7bdbc3ff0c665d466abbd3d31376e21b4

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326787

6 years agoTableGen: Explicitly check whether a record has been resolved
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:47 +0000 (13:48 +0000)]
TableGen: Explicitly check whether a record has been resolved

Summary:
There are various places where resolving and constant folds can
get stuck, especially around casts. We don't always signal an
error for those, because in many cases they can legitimately
occur without being an error in the "untaken branch" of an !if.

Change-Id: I3befc0e4234c8e6cc61190504702918c9f29ce5c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326786

6 years agoTableGen: Allow !cast of records, cleanup conversion machinery
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:39 +0000 (13:48 +0000)]
TableGen: Allow !cast of records, cleanup conversion machinery

Summary:
Distinguish two relationships between types: is-a and convertible-to.
For example, a bit is not an int or vice versa, but they can be
converted into each other (with range checks that you can think of
as "dynamic": unlike other type checks, those range checks do not
happen during parsing, but only once the final values have been
established).

Actually converting initializers between types is subtle: even
when values of type A can be converted to type B (e.g. int into
string), it may not be possible to do so with a concrete initializer
(e.g., a VarInit that refers to a variable of type int cannot
be immediately converted to a string).

For this reason, distinguish between getCastTo and convertInitializerTo:
the latter implements the actual conversion when appropriate, while
the former will first try to do the actual conversion and fall back
to introducing a !cast operation so that the conversion will be
delayed until variable references have been resolved.

To make the approach of adding !cast operations to work, !cast needs
to fallback to convertInitializerTo when the special string <-> record
logic does not apply.

This enables casting records to a subclass, although that new
functionality is only truly useful together with !isa, which will be
added in a later change.

The test is removed because it uses !srl on a bit sequence,
which cannot really be supported consistently, but luckily
isn't used anywhere either.

Change-Id: I98168bf52649176654ed2ec61a29bdb29970cfe7

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326785

6 years agoTableGen: Simplify BitsInit::resolveReferences
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:30 +0000 (13:48 +0000)]
TableGen: Simplify BitsInit::resolveReferences

Summary:
No functional change intended. The removed code has a loop for
recursive resolving, which is superseded by the recursive
resolving done by the Resolver implementations.

Add a test case which was broken by an earlier version of this
change.

Change-Id: Ib208d037b77a8bbb725977f1388601fc984723d8

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326784

6 years agoTableGen: Generalize record types to fix typeIsConvertibleTo et al.
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:20 +0000 (13:48 +0000)]
TableGen: Generalize record types to fix typeIsConvertibleTo et al.

Summary:
Allow RecordRecTy to represent the type "subclass of N superclasses",
where N may be zero. Furthermore, generate RecordRecTy instances only
with actual classes in the list.

Keeping track of multiple superclasses is required to resolve the type
of a list correctly in some cases. The old code relied on the incorrect
behavior of typeIsConvertibleTo, and an earlier version of this change
relied on a modified ordering of superclasses (it was committed in
r325884 and then reverted because unfortunately some of clang-tblgen's
backends depend on the ordering).

Previously, the DefInit for each Record would have a RecordRecTy of
that Record as its type. Now, all defs with the same superclasses will
share the same type.

This allows us to be more consistent about type checks involving records:

- typeIsConvertibleTo actually requires the LHS to be a subtype of the
  RHS

- resolveTypes will return the least supertype of given record types in
  all cases

- different record types in the two branches of an !if are handled
  correctly

Add a test that used to be accepted without flagging the obvious type
error.

Change-Id: Ib366db1a4e6a079f1a0851e469b402cddae76714

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326783

6 years ago[analyzer] CStringChecker.cpp: Remove the duplicated check about null dereference...
Henry Wong [Tue, 6 Mar 2018 13:38:42 +0000 (13:38 +0000)]
[analyzer] CStringChecker.cpp: Remove the duplicated check about null dereference on dest-buffer or src-buffer.

Summary: `CheckBufferAccess()` calls `CheckNonNull()`, so there are some calls to `CheckNonNull()` that are useless.

Reviewers: dcoughlin, NoQ, xazax.hun, cfe-commits, george.karpenkov

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, MTC, a.sidorin

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

llvm-svn: 326782

6 years ago[clang-format] Fix documentation for SpaceAfterCStyleCast option
Krasimir Georgiev [Tue, 6 Mar 2018 13:24:01 +0000 (13:24 +0000)]
[clang-format] Fix documentation for SpaceAfterCStyleCast option

Patch contributed by @EricMarti!

Summary: I noticed that the example for SpaceAfterCStyleCast does not match its description. I fixed the example after testing it out.

Reviewers: rsmith, krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 326781

6 years agoFixup for rL326769 (RegState::Debug is being truncated to a bool)
Bjorn Pettersson [Tue, 6 Mar 2018 13:23:28 +0000 (13:23 +0000)]
Fixup for rL326769 (RegState::Debug is being truncated to a bool)

I obviously messed up arguments to MachineOperand::CreateReg
in rL326769. This should make it work as intended.

Thanks to RKSimon for spotting this.

llvm-svn: 326780

6 years ago[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.
Florian Hahn [Tue, 6 Mar 2018 13:12:32 +0000 (13:12 +0000)]
[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.

In case PredBB == BB and StopAt == BB's terminator, StopAt != &*BI will
fail, because BB's terminator instruction gets replaced.

By using BB.getTerminator() we get the current terminator which we can use
to compare.

Reviewers: sanjoy, anna, reames

Reviewed By: anna

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

llvm-svn: 326779

6 years ago[clangd] Fix -Wpedantic warning, NFC.
Haojian Wu [Tue, 6 Mar 2018 12:56:18 +0000 (12:56 +0000)]
[clangd] Fix -Wpedantic warning, NFC.

llvm-svn: 326778

6 years agoHostThreadPosix::Cancel: remove android-specific implementation
Pavel Labath [Tue, 6 Mar 2018 12:46:05 +0000 (12:46 +0000)]
HostThreadPosix::Cancel: remove android-specific implementation

Noone is calling this function on android, so we can just use the
generic llvm_unreachable "implementation".

llvm-svn: 326777

6 years ago[Analyzer] More accurate modeling about the increment operator of the operand with...
Henry Wong [Tue, 6 Mar 2018 12:29:09 +0000 (12:29 +0000)]
[Analyzer] More accurate modeling about the increment operator of the operand with type bool.

Summary:
There is a problem with analyzer that a wrong value is given when modeling the increment operator of the operand with type bool. After `rL307604` is applied, a unsigned overflow may occur.

Example:
```
void func() {
  bool b = true;
  // unsigned overflow occur, 2 -> 0 U1b
  b++;
}
```

The use of an operand of type bool with the ++ operators is deprecated but valid untill C++17. And if the operand of the increment operator is of type bool, it is set to true.

This patch includes two parts:

  - If the operand of the increment operator is of type bool or type _Bool, set to true.
  - Modify `BasicValueFactory::getTruthValue()`, use `getIntWidth()` instead `getTypeSize()` and use `unsigned` instead `signed`.

Reviewers: alexshap, NoQ, dcoughlin, george.karpenkov

Reviewed By: NoQ

Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits, MTC

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

llvm-svn: 326776

6 years ago[LLDB][PPC64] Fixed issues with expedited registers
Pavel Labath [Tue, 6 Mar 2018 11:54:41 +0000 (11:54 +0000)]
[LLDB][PPC64] Fixed issues with expedited registers

Summary:
- reg_nums were missing the end marker entry
- marked FP test to be skipped for ppc64

Reviewers: labath, clayborg

Reviewed By: labath, clayborg

Subscribers: alexandreyy, lbianc, nemanjai, kbarton

Differential Revision: https://reviews.llvm.org/D43767
Patch by Leandro Lupori <leandro.lupori@gmail.com>

llvm-svn: 326775

6 years ago[AVR] Remove the earlyclobber flag from LDDWRdYQ
Dylan McKay [Tue, 6 Mar 2018 11:20:25 +0000 (11:20 +0000)]
[AVR] Remove the earlyclobber flag from LDDWRdYQ

Before I started maintaining the AVR backend, this instruction
never originally used to have an earlyclobber flag.

Some time afterwards (years ago), I must've added it back in, not realising that it
was left out for a reason.

This pseudo instrction exists solely to work around a long standing bug
in the register allocator.

Before this commit, the LDDWRdYQ pseudo was not actually working around
any bug. With the earlyclobber flag removed again, the LDDWRdYQ pseudo
now correctly works around PR13375 again.

llvm-svn: 326774

6 years ago[clangd] Sort includes when formatting code or inserting new includes.
Eric Liu [Tue, 6 Mar 2018 10:42:50 +0000 (10:42 +0000)]
[clangd] Sort includes when formatting code or inserting new includes.

Reviewers: hokein, ilya-biryukov

Subscribers: klimek, jkorous-apple, cfe-commits

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

llvm-svn: 326773

6 years agoMove test/gcdasyncsemaphorechecker_test.m to a subdirectory
Alexander Kornienko [Tue, 6 Mar 2018 10:40:11 +0000 (10:40 +0000)]
Move test/gcdasyncsemaphorechecker_test.m to a subdirectory

llvm-svn: 326772

6 years ago[DebugInfo] Discard invalid DBG_VALUE instructions in LiveDebugVariables
Bjorn Pettersson [Tue, 6 Mar 2018 08:47:07 +0000 (08:47 +0000)]
[DebugInfo] Discard invalid DBG_VALUE instructions in LiveDebugVariables

Summary:
This is a workaround for pr36417
https://bugs.llvm.org/show_bug.cgi?id=36417

LiveDebugVariables will now verify that the DBG_VALUE instructions
are sane (prior to register allocation) by asking LIS if a virtual
register used in the DBG_VALUE is live (or dead def) in the slot
index before the DBG_VALUE. If it isn't sane the DBG_VALUE is
discarded.

One pass that was identified as introducing non-sane DBG_VALUE
instructtons, when analysing pr36417, was the DAG->DAG Instruction
Selection. It sometimes inserts DBG_VALUE instructions referring to
a virtual register that is defined later in the same basic block.
So it is a use before def kind of problem. The DBG_VALUE is
typically inserted in the beginning of a basic block when this
happens. The problem can be seen in the test case
test/DebugInfo/X86/dbg-value-inlined-parameter.ll

Reviewers: aprantl, rnk, probinson

Reviewed By: aprantl

Subscribers: vsk, davide, alexcrichton, Ka-Ka, eraman, llvm-commits, JDevlieghere

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

llvm-svn: 326769

6 years agoOpenBSD sanitizer common, define RLIMIT_AS constant
Kamil Rytarowski [Tue, 6 Mar 2018 08:24:16 +0000 (08:24 +0000)]
OpenBSD sanitizer common, define RLIMIT_AS constant

Summary: define RLIMIT_AS constant until it s defined in the future

Patch by: David Carlier

Reviewers: krytarowski, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

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

llvm-svn: 326768

6 years agoFix an unused variable warning; NFC
George Burgess IV [Tue, 6 Mar 2018 07:45:11 +0000 (07:45 +0000)]
Fix an unused variable warning; NFC

llvm-svn: 326767

6 years ago[ExprConstant] Look through ExprWithCleanups for `allocsize`
George Burgess IV [Tue, 6 Mar 2018 07:42:36 +0000 (07:42 +0000)]
[ExprConstant] Look through ExprWithCleanups for `allocsize`

llvm-svn: 326766

6 years ago[WebAssebmly] Remove reloc ordering constraint
Sam Clegg [Tue, 6 Mar 2018 07:13:10 +0000 (07:13 +0000)]
[WebAssebmly] Remove reloc ordering constraint

The MC layer doesn't currently emit relocations in offset
order for the entire code section so this check was causing
failures on the wasm waterfall.

Perhaps we can re-instate this check if we divide the relocations
per-function, or add extra ordering the MC object writer.

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

llvm-svn: 326765

6 years ago[X86] Handle EAX being live when calling chkstk for x86_64
Martin Storsjo [Tue, 6 Mar 2018 06:00:13 +0000 (06:00 +0000)]
[X86] Handle EAX being live when calling chkstk for x86_64

EAX can turn out to be alive here, when shrink wrapping is done
(which is allowed when using dwarf exceptions, contrary to the
normal case with WinCFI).

This fixes PR36487.

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

llvm-svn: 326764

6 years agoUpdated docs in CrashRecoveryContext.h
Serge Pavlov [Tue, 6 Mar 2018 04:00:30 +0000 (04:00 +0000)]
Updated docs in CrashRecoveryContext.h

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

llvm-svn: 326763

6 years agoRevert "[DWARFv5] Emit file 0 to the line table."
Paul Robinson [Tue, 6 Mar 2018 03:15:21 +0000 (03:15 +0000)]
Revert "[DWARFv5] Emit file 0 to the line table."
Caused an asan failure.

This reverts commit d54883f081186cdcce74e6f98cfc0438579ec019.
aka r326758

llvm-svn: 326762

6 years ago[MergeICmp] Simplify how BCECmpBlock instructions are blacklisted
Xin Tong [Tue, 6 Mar 2018 02:24:02 +0000 (02:24 +0000)]
[MergeICmp] Simplify how BCECmpBlock instructions are blacklisted

llvm-svn: 326761

6 years ago[MergeICmp] Fix printing. NFC
Xin Tong [Tue, 6 Mar 2018 02:04:57 +0000 (02:04 +0000)]
[MergeICmp] Fix printing. NFC

llvm-svn: 326760

6 years ago[sanitizer] Fix the return type for GetTid in Fuchsia implementation
Petr Hosek [Tue, 6 Mar 2018 02:01:32 +0000 (02:01 +0000)]
[sanitizer] Fix the return type for GetTid in Fuchsia implementation

This is triggering "functions that differ only in their return type
cannot be overloaded" error.

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

llvm-svn: 326759

6 years ago[DWARFv5] Emit file 0 to the line table.
Paul Robinson [Tue, 6 Mar 2018 01:59:56 +0000 (01:59 +0000)]
[DWARFv5] Emit file 0 to the line table.

DWARF v5 specifies that the root file (also given in the DW_AT_name
attribute of the compilation unit DIE) should be emitted explicitly to
the line table's list of files.  This makes the line table more
independent of the .debug_info section.

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

llvm-svn: 326758

6 years ago[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings...
Eugene Zelenko [Tue, 6 Mar 2018 00:47:41 +0000 (00:47 +0000)]
[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 326757

6 years agoUpstreaming avx512 register support in debugserver. These changes
Jason Molenda [Tue, 6 Mar 2018 00:27:41 +0000 (00:27 +0000)]
Upstreaming avx512 register support in debugserver.  These changes
were originally written by Chris Bieneman, they've undergone a
number of changes since then.

Also including the debugserver bridgeos support, another arm
environment that runs Darwin akin to ios.  These codepaths are
activated when running in a bridgeos environment which we're not
set up to test today.

There's additional (small) lldb changes to handle bridgeos binaries
that still need to be merged up.

Tested on a darwin system with avx512 hardware and without.

<rdar://problem/36424951>

llvm-svn: 326756

6 years ago[analyzer] [quickfix] Prevent a crash in NamedDecl::getName()
George Karpenkov [Tue, 6 Mar 2018 00:18:21 +0000 (00:18 +0000)]
[analyzer] [quickfix] Prevent a crash in NamedDecl::getName()

llvm-svn: 326755

6 years agoLLDBStandalone.cmake: set path to llvm-lit inside of llvm build dir
Adrian Prantl [Mon, 5 Mar 2018 23:57:46 +0000 (23:57 +0000)]
LLDBStandalone.cmake: set path to llvm-lit inside of llvm build dir

llvm-svn: 326754

6 years agoRemove redundant casts.
Rui Ueyama [Mon, 5 Mar 2018 23:50:45 +0000 (23:50 +0000)]
Remove redundant casts.

llvm-svn: 326753

6 years agoDisable llvm-opt-fuzzer/exec-options.ll on Windows, it is too flaky
Reid Kleckner [Mon, 5 Mar 2018 23:18:13 +0000 (23:18 +0000)]
Disable llvm-opt-fuzzer/exec-options.ll on Windows, it is too flaky

llvm-svn: 326752

6 years ago[X86] cvttpd2dq lowering has been supported for some time
Simon Pilgrim [Mon, 5 Mar 2018 23:00:39 +0000 (23:00 +0000)]
[X86] cvttpd2dq lowering has been supported for some time

Tests in vec_fp_to_int.ll

llvm-svn: 326751

6 years ago[InstSimplify] remove redundant folds
Sanjay Patel [Mon, 5 Mar 2018 22:46:48 +0000 (22:46 +0000)]
[InstSimplify] remove redundant folds

The 'hasOneUse' check is a giveaway that something's not right.
We never need to check that in InstSimplify because we don't
create new instructions here.

These are all handled as icmp simplifies which then trigger
existing select simplifies, so there's no need to duplicate
a composite fold of the two.

llvm-svn: 326750

6 years agoGlobalISel: IRTranslate llvm.fabs.* intrinsic
Volkan Keles [Mon, 5 Mar 2018 22:31:55 +0000 (22:31 +0000)]
GlobalISel: IRTranslate llvm.fabs.* intrinsic

Summary:
Fabs is a common floating-point operation, especially for some expansions. This patch adds
a new generic opcode for llvm.fabs.* intrinsic in order to avoid building/matching this intrinsic.

Reviewers: qcolombet, aditya_nandakumar, dsanders, rovka

Reviewed By: aditya_nandakumar

Subscribers: kristof.beyls, javed.absar, llvm-commits

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

llvm-svn: 326749

6 years ago[RewriteStatepoints] Fix stale parse points
Daniel Neilson [Mon, 5 Mar 2018 22:27:30 +0000 (22:27 +0000)]
[RewriteStatepoints] Fix stale parse points

Summary:
RewriteStatepointsForGC collects parse points for further processing.
During the collection if a callsite is found in an unreachable block
(DominatorTree::isReachableFromEntry()) then all unreachable blocks are
removed by removeUnreachableBlocks(). Some of the removed blocks could
have been reachable according to DominatorTree::isReachableFromEntry().
In this case the collected parse points became stale and resulted in a
crash when accessed.

The fix is to unconditionally canonicalize the IR to
removeUnreachableBlocks and then collect the parse points.

The added test crashes with the old version and passes with this patch.

Patch by Yevgeny Rouban!

Reviewed by: Anna

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

llvm-svn: 326748

6 years ago[X86] Add silvermont fp arithmetic cost model tests
Simon Pilgrim [Mon, 5 Mar 2018 22:13:22 +0000 (22:13 +0000)]
[X86] Add silvermont fp arithmetic cost model tests

Add silvermont to existing high coverage tests instead of repeating in slm-arith-costs.ll

llvm-svn: 326747

6 years ago[analyzer] AST-matching checker to detect global central dispatch performance anti...
George Karpenkov [Mon, 5 Mar 2018 22:03:32 +0000 (22:03 +0000)]
[analyzer] AST-matching checker to detect global central dispatch performance anti-pattern

rdar://37312818

NB: The checker does not care about the ordering of callbacks, see the
relevant FIXME in tests.

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

llvm-svn: 326746

6 years ago[AMDGPU] Remove unused AMDOpenCL triple environment
Tony Tye [Mon, 5 Mar 2018 21:39:41 +0000 (21:39 +0000)]
[AMDGPU] Remove unused AMDOpenCL triple environment

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

llvm-svn: 326745

6 years ago[msvc] Allow MSVC toolchain driver to find the aarch64 / arm64 cross-compiler.
Reid Kleckner [Mon, 5 Mar 2018 21:36:23 +0000 (21:36 +0000)]
[msvc] Allow MSVC toolchain driver to find the aarch64 / arm64 cross-compiler.

Starting with the Fall Creators Update, Windows 10 Desktop can run on
machines that are powered by aarch64 processors.

Microsoft call the aarch64 architecture "arm64". This patch maps
ArchType::aarch64 to "arm64" to allow the MSVC toolchain driver to find
the aarch64 / arm64 cross-compiler.

Patch by Chris January

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

llvm-svn: 326744

6 years agoFix the install location of LLDBWrapPython.cpp when building
Adrian Prantl [Mon, 5 Mar 2018 21:08:42 +0000 (21:08 +0000)]
Fix the install location of LLDBWrapPython.cpp when building
LLDB.framework to point to the build directory where it is expected by
the top-level CMakeLists.txt.

This should be a no-op in any other configurations.

rdar://problem/38005302

llvm-svn: 326743

6 years ago[AVR] Fix the test suite after r326500.
Dylan McKay [Mon, 5 Mar 2018 20:56:25 +0000 (20:56 +0000)]
[AVR] Fix the test suite after r326500.

r326500 subtly changed the way the instructions are printed.

llvm-svn: 326742

6 years agoFix typo in comment.
Richard Smith [Mon, 5 Mar 2018 20:54:34 +0000 (20:54 +0000)]
Fix typo in comment.

llvm-svn: 326741

6 years ago[SLP] Additional tests for stores vectorization, NFC.
Alexey Bataev [Mon, 5 Mar 2018 20:20:12 +0000 (20:20 +0000)]
[SLP] Additional tests for stores vectorization, NFC.

llvm-svn: 326740

6 years ago[test] Skip pexpect-based lldb-mi tests on Darwin
Vedant Kumar [Mon, 5 Mar 2018 20:16:52 +0000 (20:16 +0000)]
[test] Skip pexpect-based lldb-mi tests on Darwin

These tests fail with a relatively frequently on Darwin machines with
errors such as:

  File ".../lldb/third_party/Python/module/pexpect-2.4/pexpect.py", line 1444, in expect_loop
    raise EOF(str(e) + '\n' + str(self))
EOF: End Of File (EOF) in read_nonblocking(). Empty string style platform.

The unpredictable failures make these tests noisy.

rdar://37046976

llvm-svn: 326739

6 years agoRe-commit: Make STATISTIC() values available programmatically
Daniel Sanders [Mon, 5 Mar 2018 19:38:16 +0000 (19:38 +0000)]
Re-commit: Make STATISTIC() values available programmatically

Summary:
It can be useful for tools to be able to retrieve the values of variables
declared via STATISTIC() directly without having to emit them and parse
them back. Use cases include:
* Needing to report specific statistics to a test harness
* Wanting to post-process statistics. For example, to produce a percentage of
  functions that were fully selected by GlobalISel

Make this possible by adding llvm::GetStatistics() which returns an
iterator_range that can be used to inspect the statistics that have been
touched during execution. When statistics are disabled (NDEBUG and not
LLVM_ENABLE_STATISTICS) this method will return an empty range.

This patch doesn't address the effect of multiple compilations within the same
process. In such situations, the statistics will be cumulative for all
compilations up to the GetStatistics() call.

Reviewers: qcolombet, rtereshin, aditya_nandakumar, bogner

Reviewed By: rtereshin, bogner

Subscribers: llvm-commits, mgorny

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

This re-commit fixes a missing include of <vector> which it seems clang didn't
mind but G++ and MSVC objected to. It seems that, clang was ok with std::vector
only being forward declared at the point of use since it was fully defined
eventually but G++/MSVC both rejected it at the point of use.

llvm-svn: 326738

6 years agoOn Windows we need to be able to process response files with Windows-style
Dmitry Mikulin [Mon, 5 Mar 2018 19:34:33 +0000 (19:34 +0000)]
On Windows we need to be able to process response files with Windows-style
path names.

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

llvm-svn: 326737

6 years ago[PowerPC] Do not emit record-form rotates when record-form andi suffices
Nemanja Ivanovic [Mon, 5 Mar 2018 19:27:16 +0000 (19:27 +0000)]
[PowerPC] Do not emit record-form rotates when record-form andi suffices

Up until Power9, the performance profile for rlwinm., rldicl. and andi. looked
more or less equivalent. However with Power9, the rotates are still 2-way
cracked whereas the and-immediate is not.

This patch just ensures that we don't emit record-form rotates when an andi.
is adequate.

As first pointed out by Carrot in https://bugs.llvm.org/show_bug.cgi?id=30833
(this patch is a fix for that PR).

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

llvm-svn: 326736

6 years ago[x86] auto-generate full checks for fabs tests
Sanjay Patel [Mon, 5 Mar 2018 19:11:20 +0000 (19:11 +0000)]
[x86] auto-generate full checks for fabs tests

Also, change the x86-64 test to optimized and remove the
unnecessary platform specification from the RUN lines..

llvm-svn: 326735

6 years agoOn Windows expansion of regex file name patterns is the responsibility of each
Dmitry Mikulin [Mon, 5 Mar 2018 18:54:56 +0000 (18:54 +0000)]
On Windows expansion of regex file name patterns is the responsibility of each
tool. Fix ar to do that.

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

llvm-svn: 326734

6 years agoImprove OpenMP threadprivate implementation.
Andrey Churbanov [Mon, 5 Mar 2018 18:42:01 +0000 (18:42 +0000)]
Improve OpenMP threadprivate implementation.

Patch by Terry Wilmarth

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

llvm-svn: 326733