platform/upstream/llvm.git
7 years ago[pp-trace] Update skipped source ranges in tests
Vedant Kumar [Mon, 11 Sep 2017 20:47:45 +0000 (20:47 +0000)]
[pp-trace] Update skipped source ranges in tests

Depends on D36642

llvm-svn: 312948

7 years ago[Lexer] Report more precise skipped regions (PR34166)
Vedant Kumar [Mon, 11 Sep 2017 20:47:42 +0000 (20:47 +0000)]
[Lexer] Report more precise skipped regions (PR34166)

This patch teaches the preprocessor to report more precise source ranges for
code that is skipped due to conditional directives.

The new behavior includes the '#' from the opening directive and the full text
of the line containing the closing directive in the skipped area. This matches
up clang's behavior (we don't IRGen the code between the closing "endif" and
the end of a line).

This also affects the code coverage implementation. See llvm.org/PR34166 (this
also happens to be rdar://problem/23224058).

The old behavior (report the end of the skipped range as the end
location of the 'endif' token) is preserved for indexing clients.

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

llvm-svn: 312947

7 years ago[MinGW] Ignore the sysroot parameter
Martin Storsjo [Mon, 11 Sep 2017 20:43:43 +0000 (20:43 +0000)]
[MinGW] Ignore the sysroot parameter

If the sysroot parameter is passed to the clang frontend, clang
already uses it to find libraries and adds -L options for it, but
also passes it on to the linker. Therefore we can get pretty far
by just ignoring it altogether.

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

llvm-svn: 312945

7 years ago[MinGW] Map the -verbose option, implement -### for showing the produced parameters
Martin Storsjo [Mon, 11 Sep 2017 20:43:39 +0000 (20:43 +0000)]
[MinGW] Map the -verbose option, implement -### for showing the produced parameters

Pass the -verbose option through to the COFF linker, and show the
arguments passed to it. If the -### option is specified, just show
the produced argument list and exit, just like in clang.

Replace the first argument with "lld-link" in order to produce a
correct command line.

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

llvm-svn: 312944

7 years ago[InstSimplify] fix some test names; NFC
Sanjay Patel [Mon, 11 Sep 2017 20:38:31 +0000 (20:38 +0000)]
[InstSimplify] fix some test names; NFC

Too much division...the quotient is the answer.

llvm-svn: 312943

7 years agoclang-rename: let -force handle multiple renames
Miklos Vajna [Mon, 11 Sep 2017 20:18:38 +0000 (20:18 +0000)]
clang-rename: let -force handle multiple renames

Summary:
The use case is that renaming multiple symbols in a large enough codebase is
much faster if all of these can be done with a single invocation, but
there will be multiple translation units where one or more symbols are
not found.

Old behavior was to exit with an error (default) or exit without
reporting an error (-force). New behavior is that -force results in a
best-effort rename: rename symbols which are found and just ignore the
rest.

The existing help for -force sort of already implies this behavior.

Reviewers: cfe-commits, klimek, arphaman

Reviewed By: klimek

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

llvm-svn: 312942

7 years agoDriver: default to `-fno-use-cxatexit` on Windows
Saleem Abdulrasool [Mon, 11 Sep 2017 20:18:09 +0000 (20:18 +0000)]
Driver: default to `-fno-use-cxatexit` on Windows

This primarily impacts the Windows MSVC and Windows itanium
environments.  Windows MSVC does not use `__cxa_atexit` and Itanium
follows suit.  Simplify the logic for the default value calculation and
blanket the Windows environments to default to off for use of
`__cxa_atexit`.

llvm-svn: 312941

7 years agoImprove readability of MinGW driver. NFC.
Rui Ueyama [Mon, 11 Sep 2017 20:14:47 +0000 (20:14 +0000)]
Improve readability of MinGW driver. NFC.

Summary:
In addition to removing a few global variables and functions, I believe
this patch improves code readability a bit in general.

Reviewers: mstorsjo, martell

Subscribers: llvm-commits

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

llvm-svn: 312940

7 years ago[scudo] Fix improper TSD init after TLS destructors are called
Kostya Kortchinsky [Mon, 11 Sep 2017 19:59:40 +0000 (19:59 +0000)]
[scudo] Fix improper TSD init after TLS destructors are called

Summary:
Some of glibc's own thread local data is destroyed after a user's thread local
destructors are called, via __libc_thread_freeres. This might involve calling
free, as is the case for strerror_thread_freeres.
If there is no prior heap operation in the thread, this free would end up
initializing some thread specific data that would never be destroyed properly
(as user's pthread destructors have already been called), while still being
deallocated when the TLS goes away. As a result, a program could SEGV, usually
in __sanitizer::AllocatorGlobalStats::Unregister, where one of the doubly linked
list links would refer to a now unmapped memory area.

To prevent this from happening, we will not do a full initialization from the
deallocation path. This means that the fallback cache & quarantine will be used
if no other heap operation has been called, and we effectively prevent the TSD
being initialized and never destroyed. The TSD will be fully initialized for all
other paths.

In the event of a thread doing only frees and nothing else, a TSD would never
be initialized for that thread, but this situation is unlikely and we can live
with that.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 312939

7 years ago[InstSimplify] add tests for possible sdiv/srem simplifications; NFC
Sanjay Patel [Mon, 11 Sep 2017 19:42:41 +0000 (19:42 +0000)]
[InstSimplify] add tests for possible sdiv/srem simplifications; NFC

As noted in PR34517, the handling of signed div/rem is not on par with
unsigned div/rem. Signed is harder to reason about, but it should be
possible to handle at least some of these using the same technique that
we use for unsigned: use icmp logic to see if there's a relationship
between the quotient and divisor.

llvm-svn: 312938

7 years ago[asan] Include asan-dynamic into check-all
Vitaly Buka [Mon, 11 Sep 2017 19:41:17 +0000 (19:41 +0000)]
[asan] Include asan-dynamic into check-all

Summary: It's adds just 1k to about 45k tests.

Reviewers: eugenis, alekseyshl

Subscribers: kubamracek, mgorny, llvm-commits

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

llvm-svn: 312937

7 years agoAMDGPU: Allow coldcc calls
Matt Arsenault [Mon, 11 Sep 2017 18:54:20 +0000 (18:54 +0000)]
AMDGPU: Allow coldcc calls

llvm-svn: 312936

7 years ago[mips][microMIPS] add lapc instruction
Petar Jovanovic [Mon, 11 Sep 2017 18:34:04 +0000 (18:34 +0000)]
[mips][microMIPS] add lapc instruction

Implement LAPC instruction for mips32r6, mips64r6 and micromips32r6.

Patch by Milos Stojanovic.

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

llvm-svn: 312934

7 years ago[ubsan] Save binary name before parsing options
Vitaly Buka [Mon, 11 Sep 2017 18:32:51 +0000 (18:32 +0000)]
[ubsan] Save binary name before parsing options

Summary: To parser "include" we may need to do binary name substitution.

Reviewers: eugenis, alekseyshl

Subscribers: llvm-commits, kubamracek

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

llvm-svn: 312933

7 years agomark mersenne_twister_engine<>::seed(result_type __sd) with _LIBCPP_DISABLE_UBSAN_UNS...
Marshall Clow [Mon, 11 Sep 2017 18:10:33 +0000 (18:10 +0000)]
mark mersenne_twister_engine<>::seed(result_type __sd) with _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK to placate UBSAN. Fixes PR#34160

llvm-svn: 312932

7 years agoRemove cross-target test dependency.
Rui Ueyama [Mon, 11 Sep 2017 18:00:03 +0000 (18:00 +0000)]
Remove cross-target test dependency.

Tests for MinGW shouldn't depend on files under test/COFF/Inputs.

llvm-svn: 312931

7 years agoUnmerge GEPs to reduce register pressure on IndirectBr edges.
Hiroshi Yamauchi [Mon, 11 Sep 2017 17:52:08 +0000 (17:52 +0000)]
Unmerge GEPs to reduce register pressure on IndirectBr edges.

Summary:
GEP merging can sometimes increase the number of live values and register
pressure across control edges and cause performance problems particularly if the
increased register pressure results in spills.

This change implements GEP unmerging around an IndirectBr in certain cases to
mitigate the issue. This is in the CodeGenPrepare pass (after all the GEP
merging has happened.)

With this patch, the Python interpreter loop runs faster by ~5%.

Reviewers: sanjoy, hfinkel

Reviewed By: hfinkel

Subscribers: eastig, junbuml, llvm-commits

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

llvm-svn: 312930

7 years agoUnroll and separate the remaining parts of isolation
Roman Gareev [Mon, 11 Sep 2017 17:46:47 +0000 (17:46 +0000)]
Unroll and separate the remaining parts of isolation

The remaining parts produced by the full partial tile isolation can contain
hot spots that are worth to be optimized. Currently, we rely on the simple
loop unrolling pass, LiCM and the SLP vectorizer to optimize such parts.
However, the approach can suffer from the lack of the information about
aliasing that Polly provides using additional alias metadata or/and the lack
of the information required by simple loop unrolling pass.

This patch is the first step to optimize the remaining parts. To do it, we
unroll and separate them. In case of, for instance, Intel Kaby Lake, it helps
to increase the performance of the generated code from 39.87 GFlop/s to
49.23 GFlop/s.

The next possible step is to avoid unrolling performed by Polly in case of
isolated and remaining parts and rely only on simple loop unrolling pass and
the Loop vectorizer.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D37692

llvm-svn: 312929

7 years ago[AMDGPU] Produce madak and madmk from the two-address pass
Stanislav Mekhanoshin [Mon, 11 Sep 2017 17:13:57 +0000 (17:13 +0000)]
[AMDGPU] Produce madak and madmk from the two-address pass

These two instructions are normally selected, but when the
two address pass converts mac into mad we end up with the
mad where we could have one of these.

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

llvm-svn: 312928

7 years agoLLD: Introduce a GNU LD style driver for COFF
Martell Malone [Mon, 11 Sep 2017 17:02:59 +0000 (17:02 +0000)]
LLD: Introduce a GNU LD style driver for COFF

When building COFF programs many targets such as mingw prefer
to have a gnu ld frontend. Rather then having a fully fledged
standalone driver we wrap a shim around the LINK driver.

Extra tests were provided by mstorsjo

Reviewers: mstorsjo, ruiu

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

llvm-svn: 312926

7 years ago[X86] Remove portions of r275950 that are no longer needed with i1 not being a legal...
Craig Topper [Mon, 11 Sep 2017 16:16:48 +0000 (16:16 +0000)]
[X86] Remove portions of r275950 that are no longer needed with i1 not being a legal type

Summary:
r275950 added support for turning (trunc (X >> N) to i1) into BT(X, N). But that's no longer necessary now that i1 isn't legal.

This patch removes the support for that, but preserves some of the refactorings done in that commit.

Reviewers: guyblank, RKSimon, spatel, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 312925

7 years ago[SelectionDAG] Remove a check for type being a vector type after calling getShiftAmou...
Craig Topper [Mon, 11 Sep 2017 16:15:39 +0000 (16:15 +0000)]
[SelectionDAG] Remove a check for type being a vector type after calling getShiftAmountTy. NFCI

getShiftAmountTy already returns the vector type when called for vectors.

llvm-svn: 312924

7 years agoAdd include of <string> to <system_error>, since things in there return strings....
Marshall Clow [Mon, 11 Sep 2017 16:05:42 +0000 (16:05 +0000)]
Add include of <string> to <system_error>, since things in there return strings. Fixes PR#34529.

llvm-svn: 312923

7 years ago[ELF] Fix issue with test when build path contains '@'
James Henderson [Mon, 11 Sep 2017 15:55:54 +0000 (15:55 +0000)]
[ELF] Fix issue with test when build path contains '@'

'@' is a valid character in file paths, but the linker script tokenizer treats it
as a separate token. This was leading to an unexpected test failure, on our local
builds. This patch changes the test to quote the path to prevent this happening.

An alternative would have been to add '@' to the list of "unquoted tokens" in
ScriptLexer.cpp, but ld.bfd has the same behaviour as the current LLD.

Reviewers: ruiu

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

llvm-svn: 312922

7 years agoX86 Tests: More AVX512 conversions tests. NFC
Zvi Rackover [Mon, 11 Sep 2017 15:54:38 +0000 (15:54 +0000)]
X86 Tests: More AVX512 conversions tests. NFC

Adding more tests for AVX512 fp<->int conversions that were missing.

llvm-svn: 312921

7 years ago[ScalarEvolution] Refactor forgetLoop() to improve performance
Marcello Maggioni [Mon, 11 Sep 2017 15:44:20 +0000 (15:44 +0000)]
[ScalarEvolution] Refactor forgetLoop() to improve performance

forgetLoop() has pretty bad performance because it goes over
the same instructions over and over again in particular when
nested loop are involved.
The refactoring changes the function to a not-recursive function
and reusing the allocation for data-structures and the Visited
set.

NFCI

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

llvm-svn: 312920

7 years agoFix typo
Matt Arsenault [Mon, 11 Sep 2017 15:23:22 +0000 (15:23 +0000)]
Fix typo

llvm-svn: 312919

7 years agoclang-format: [JS] wrap and indent `goog.setTestOnly` calls.
Martin Probst [Mon, 11 Sep 2017 15:22:52 +0000 (15:22 +0000)]
clang-format: [JS] wrap and indent `goog.setTestOnly` calls.

Summary:
While `goog.setTestOnly` usually appears in the imports section of a file, it is
not actually an import, and also usually doesn't take long parameters (nor
namespaces as a parameter, it's a description/message that should be wrapped).

This fixes a regression where a `goog.setTestOnly` call nested in a function was
not wrapped.

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 312918

7 years ago[PCH] Allow VFS to be used for tests that generate PCH files
Cameron Desrochers [Mon, 11 Sep 2017 15:03:23 +0000 (15:03 +0000)]
[PCH] Allow VFS to be used for tests that generate PCH files

When using a virtual file-system (VFS) and a preamble file (PCH) is generated,
it is generated on-disk in the real file-system instead of in the VFS (which
makes sense, since the VFS is read-only). However, when subsequently reading
the generated PCH, the frontend passes through the VFS it has been given --
resulting in an error and a failed parse (since the VFS doesn't contain the
PCH; the real filesystem does).

This patch fixes that by detecting when a VFS is being used for a parse that
needs to work with a PCH file, and creating an overlay VFS that includes the
PCH file from the real file-system.

This allows tests to be written which make use of both PCH files and a VFS.

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

llvm-svn: 312917

7 years ago[X86][SSE] Add support for X86ISD::PACKSS to ComputeNumSignBitsForTargetNode
Simon Pilgrim [Mon, 11 Sep 2017 14:03:47 +0000 (14:03 +0000)]
[X86][SSE] Add support for X86ISD::PACKSS to ComputeNumSignBitsForTargetNode

Helps improve combineLogicBlendIntoPBLENDV support by allowing us to peek into through PACKSS truncations of vector comparison results.

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

llvm-svn: 312916

7 years ago[AMDGPU] exp should not be in WQM mode
Tim Renouf [Mon, 11 Sep 2017 13:55:39 +0000 (13:55 +0000)]
[AMDGPU] exp should not be in WQM mode

A mrt exp with vm=1 must be in exact (non-WQM) mode, as it also exports
the exec mask as the valid mask to determine which pixels to render.

This commit marks any exp as needing to be in exact mode.

Actually, if there are multiple mrt exps, only one needs to have vm=1,
and only that one needs to be in exact mode. But that is an optimization
for another day.

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

llvm-svn: 312915

7 years ago[TableGen] Ensure that __lsan_is_turned_off isn't removed by DCE in llvm-tblgen
Francis Ricci [Mon, 11 Sep 2017 13:50:39 +0000 (13:50 +0000)]
[TableGen] Ensure that __lsan_is_turned_off isn't removed by DCE in llvm-tblgen

Summary:
Since asan is linked dynamically on Darwin, the weak interface symbol
is removed by -Wl,-dead_strip.

Reviewers: kcc, compnerd, aaron.ballman

Subscribers: llvm-commits

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

llvm-svn: 312914

7 years ago[InstSimplify] reorder methods; NFC
Sanjay Patel [Mon, 11 Sep 2017 13:34:27 +0000 (13:34 +0000)]
[InstSimplify] reorder methods; NFC

I'm trying to refactor some shared code for integer div/rem,
but I keep having to scroll through fdiv. The FP ops have
nothing in common with the integer ops, so I'm moving FP
below everything else.

While here, improve a couple of comments and fix some formatting.

llvm-svn: 312913

7 years ago[clang-tidy] FunctionSizeCheck: wrap FunctionASTVisitor into anon namespace, NFC
Roman Lebedev [Mon, 11 Sep 2017 13:12:31 +0000 (13:12 +0000)]
[clang-tidy] FunctionSizeCheck: wrap FunctionASTVisitor into anon namespace, NFC

This check is relatively simple, and is often being used
as an example. I'm aware of at least two cases, when
simply copying the FunctionASTVisitor class to a new
check resulted in a rather unobvious segfault. Having it
in anonymous namespace prevents such a problem.

No functionality change, so i opted to avoid phabricator,
especially since clang-tidy reviews are seriously jammed.

llvm-svn: 312912

7 years ago[AST] Make RecursiveASTVisitor visit TemplateDecls in source order
Johannes Altmanninger [Mon, 11 Sep 2017 13:12:30 +0000 (13:12 +0000)]
[AST] Make RecursiveASTVisitor visit TemplateDecls in source order

Summary:
This causes template arguments to be traversed before the templated
declaration, which is useful for clients that expect the nodes in
the same order as they are in the source code. Additionally, there
seems to be no good reason not to do so.

This was moved here from LexicallyOrderedRecursiveASTVisitor. The tests
still reside in LexicallyOrderedRecursiveASTVisitorTest.cpp under
VisitTemplateDecls.

Reviewers: arphaman, rsmith, klimek

Subscribers: cfe-commits, klimek

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

llvm-svn: 312911

7 years ago[X86][SSE] Add further test cases showing failure to compute sign bits through PACKSS
Simon Pilgrim [Mon, 11 Sep 2017 12:18:43 +0000 (12:18 +0000)]
[X86][SSE] Add further test cases showing failure to compute sign bits through PACKSS

Suggested in D37680

Note: had to drop AVX512VL tests as there is an infinite loop in the new tests that needs further investigation (not relevant to D37680).
llvm-svn: 312910

7 years ago[X86][SKX][KNL] Updating several CodeGen tests to use the attr flag instead of mcpu...
Gadi Haber [Mon, 11 Sep 2017 11:26:20 +0000 (11:26 +0000)]
[X86][SKX][KNL] Updating several CodeGen tests to use the attr flag instead of mcpu flag

NFC.
 Updated 3 Codegen regression tests to use the -mattr flag instead of the -mcpu flags as follows:
 Instead of -mcpu=skx use -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq
 Instead of -mcpu=knl use -mattr=+avx512f

Reviewers: delena
Revision: https://reviews.llvm.org/D37674
llvm-svn: 312909

7 years ago[ARM] Enable the use of SVC anywhere in an IT block
Andre Vieira [Mon, 11 Sep 2017 11:11:17 +0000 (11:11 +0000)]
[ARM] Enable the use of SVC anywhere in an IT block

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

llvm-svn: 312908

7 years ago[Interleved][Stride 3]Adding test for case the VF=64 target with AVX512.
Michael Zuckerman [Mon, 11 Sep 2017 10:57:15 +0000 (10:57 +0000)]
[Interleved][Stride 3]Adding test for case the VF=64 target with AVX512.

llvm-svn: 312907

7 years ago[X86][SSE] Add test showing failure to compute sign bits through PACKSS
Simon Pilgrim [Mon, 11 Sep 2017 10:50:03 +0000 (10:50 +0000)]
[X86][SSE] Add test showing failure to compute sign bits through PACKSS

Prevents combineLogicBlendIntoPBLENDV from merging to PBLENDV

llvm-svn: 312906

7 years ago[AVR] Enable the '__do_copy_data' function
Dylan McKay [Mon, 11 Sep 2017 10:32:51 +0000 (10:32 +0000)]
[AVR] Enable the '__do_copy_data' function

Also enables '__do_clear_bss'.

These functions are automaticalled called by the CRT if they are
declared.

We need these to be called otherwise RAM will start completely
uninitialised, even though we need to copy RAM variables from progmem to
RAM.

llvm-svn: 312905

7 years ago[clang-format] Fixed one-line if statement
Krasimir Georgiev [Mon, 11 Sep 2017 10:12:16 +0000 (10:12 +0000)]
[clang-format] Fixed one-line if statement

Summary:
**Short overview:**

Fixed bug: https://bugs.llvm.org/show_bug.cgi?id=34001
Clang-format bug resulting in a strange behavior of control statements short blocks. Different flags combinations do not guarantee expected result. Turned on option AllowShortBlocksOnASingleLine does not work as intended.

**Description of the problem:**

Cpp source file UnwrappedLineFormatter does not handle AllowShortBlocksOnASingleLine flag as it should. Putting a single-line control statement without any braces, clang-format works as expected (depending on AllowShortIfStatementOnASingleLine or AllowShortLoopsOnASingleLine value). Putting a single-line control statement in braces, we can observe strange and incorrect behavior.
Our short block is intercepted by tryFitMultipleLinesInOne function. The function returns a number of lines to be merged. Unfortunately, our control statement block is not covered properly. There are several if-return statements, but none of them handles our block. A block is identified by the line first token and by left and right braces. A function block works as expected, there is such an if-return statement doing proper job. A control statement block, from the other hand, falls into strange conditional construct, which depends on BraceWrapping.AfterFunction flag (with condition that the line’s last token is left brace, what is possible in our case) or goes even further. That should definitely not happen.

**Description of the patch:**

By adding three different if statements, we guarantee that our short control statement block, however it looks like (different brace wrapping flags may be turned on), is handled properly and does not fall into wrong conditional construct. Depending on appropriate options we return either 0 (when something disturbs our merging attempt) or let another function (tryMergeSimpleBlock) take the responsibility of returned result (number of merged lines). Nevertheless, one more correction is required in mentioned tryMergeSimpleBlock function. The function, previously, returned either 0 or 2. The problem was that this did not handle the case when our block had the left brace in a separate line, not the header one. After change, after adding condition, we return the result compatible with block’s structure. In case of left brace in the header’s line we do everything as before the patch. In case of left brace in a separate line we do the job similar to the one we do in case of a “non-header left brace” function short block. To be precise, we try to merge the block ignoring the header line. Then, if success, we increment our returned result.

**After fix:**

**CONFIG:**
```
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
BreakBeforeBraces: Custom
BraceWrapping: {
AfterClass: true, AfterControlStatement: true, AfterEnum: true, AfterFunction: true, AfterNamespace: false, AfterStruct: true, AfterUnion: true, BeforeCatch: true, BeforeElse: true
}
```
**BEFORE:**
```
if (statement) doSomething();
if (statement) { doSomething(); }
if (statement) {
    doSomething();
}
if (statement)
{
    doSomething();
}
if (statement)
    doSomething();
if (statement) {
    doSomething1();
    doSomething2();
}
```
**AFTER:**
```
if (statement) doSomething();
if (statement) { doSomething(); }
if (statement) { doSomething(); }
if (statement) { doSomething(); }
if (statement) doSomething();
if (statement)
{
  doSomething1();
  doSomething2();
}
```

Contributed by @PriMee!

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: cfe-commits, klimek

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

llvm-svn: 312904

7 years ago[GlobalISel][X86] G_ANYEXT support.
Igor Breger [Mon, 11 Sep 2017 09:41:13 +0000 (09:41 +0000)]
[GlobalISel][X86] G_ANYEXT support.

Summary: G_ANYEXT support

Reviewers: zvi, delena

Reviewed By: delena

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 312903

7 years agoFixed a typo in llvm-cov/deferred-region.cpp test.
Ilya Biryukov [Mon, 11 Sep 2017 09:22:44 +0000 (09:22 +0000)]
Fixed a typo in llvm-cov/deferred-region.cpp test.

Input redirection was using `2&>1` instead of `2>&1`.

llvm-svn: 312902

7 years ago[clang-tidy] add more aliases for the hicpp module
Jonas Toth [Mon, 11 Sep 2017 09:20:07 +0000 (09:20 +0000)]
[clang-tidy] add more aliases for the hicpp module

This patch will introduce even more aliases for the hicpp-module to already existing
checks and is a follow up for D30383 finishing the other sections.
It fixes a forgotten highlight in hicpp-braces-around-statements.rst, too.

llvm-svn: 312901

7 years agoAMDGPU: trivial comment change
Tim Renouf [Mon, 11 Sep 2017 08:31:32 +0000 (08:31 +0000)]
AMDGPU: trivial comment change

... to check commit access for new committer.

llvm-svn: 312900

7 years ago[ARM] Use ADDCARRY / SUBCARRY
Roger Ferrer Ibanez [Mon, 11 Sep 2017 07:38:05 +0000 (07:38 +0000)]
[ARM] Use ADDCARRY / SUBCARRY

This is a preparatory step for D34515 and also is being recommitted as its
first version caused PR34045.

This change:
 - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
 - lowering is done by first converting the boolean value into the carry flag
   using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
   using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
   operations does the actual addition.
 - for subtraction, given that ISD::SUBCARRY second result is actually a
   borrow, we need to invert the value of the second operand and result before
   and after using ARMISD::SUBE. We need to invert the carry result of
   ARMISD::SUBE to preserve the semantics.
 - given that the generic combiner may lower ISD::ADDCARRY and
   ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
   as well otherwise i64 operations now would require branches. This implies
   updating the corresponding test for unsigned.
 - add new combiner to remove the redundant conversions from/to carry flags
   to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
 - fixes PR34045

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

llvm-svn: 312898

7 years agoRevert r312830: "Reinstall the patch "Use EmitPointerWithAlignment to get alignment...
Daniel Jasper [Mon, 11 Sep 2017 07:35:01 +0000 (07:35 +0000)]
Revert r312830: "Reinstall the patch "Use EmitPointerWithAlignment to get alignment information of the pointer used in atomic expr"."

This triggers llvm.org/PR31620 in several of our internal builds. I'll
forward reproduction instructions to the original author.

llvm-svn: 312897

7 years agoFixed a bug in splitting Scatter operation in the Type Legalizer.
Elena Demikhovsky [Mon, 11 Sep 2017 06:18:15 +0000 (06:18 +0000)]
Fixed a bug in splitting Scatter operation in the Type Legalizer.
After the split of the Scatter operation, the order of the new instructions is well defined - Lo goes before Hi. Otherwise the semantic of Scatter (from LSB to MSB) is broken.
I'm chaining 2 nodes to prevent reordering.

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

llvm-svn: 312894

7 years ago[ORC] Kill off a dead typedef.
Lang Hames [Mon, 11 Sep 2017 01:09:46 +0000 (01:09 +0000)]
[ORC] Kill off a dead typedef.

llvm-svn: 312893

7 years agoFix PR34298 - Allow std::function with an incomplete return type.
Eric Fiselier [Sun, 10 Sep 2017 23:41:20 +0000 (23:41 +0000)]
Fix PR34298 - Allow std::function with an incomplete return type.

This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
whenever the copy constructor or copy assignment operator
was required. This patch further constrains that constructor to short
circut before evaluating the troublesome SFINAE when `Tp` matches
std::function.

The original patch is from Alex Lorenz.

llvm-svn: 312892

7 years agoRevert "Fix PR34298 - Allow std::function with an incomplete return type."
Eric Fiselier [Sun, 10 Sep 2017 23:37:47 +0000 (23:37 +0000)]
Revert "Fix PR34298 - Allow std::function with an incomplete return type."

This reverts commit r312890 because the test case fails to compile for
older versions of Clang that reject initializing a const object without
a user defined constructor.

Since this patch should go into 5.0.1, I want to keep it an atomic change,
and will re-commit it with a fixed test case.

llvm-svn: 312891

7 years agoFix PR34298 - Allow std::function with an incomplete return type.
Eric Fiselier [Sun, 10 Sep 2017 23:12:33 +0000 (23:12 +0000)]
Fix PR34298 - Allow std::function with an incomplete return type.

This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
whenever the copy constructor or copy assignment operator
was required. This patch further constrains that constructor to short
circut before evaluating the troublesome SFINAE when `Tp` matches
std::function.

The original patch is from Alex Lorenz.

llvm-svn: 312890

7 years agoAdd objcImplementationDecl matcher
Dave Lee [Sun, 10 Sep 2017 21:00:15 +0000 (21:00 +0000)]
Add objcImplementationDecl matcher

Summary:
Add the `objcImplementationDecl` matcher. See related: D30854

Tested with:

```
./tools/clang/unittests/ASTMatchers/ASTMatchersTests
```

Reviewers: aaron.ballman, compnerd, alexshap

Reviewed By: aaron.ballman

Subscribers: klimek, cfe-commits

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

llvm-svn: 312889

7 years agoUse llvm_unreachable for unknown TargetCostKind.
Simon Pilgrim [Sun, 10 Sep 2017 18:42:23 +0000 (18:42 +0000)]
Use llvm_unreachable for unknown TargetCostKind.

TargetTransformInfo::getInstructionCost's switch covers all TargetCostKind cases so we shouldn't return for a default case.

llvm-svn: 312888

7 years ago[X86][SSE] Tidyup + clang-format combineX86ShuffleChain call. NFCI.
Simon Pilgrim [Sun, 10 Sep 2017 18:18:45 +0000 (18:18 +0000)]
[X86][SSE] Tidyup + clang-format combineX86ShuffleChain call. NFCI.

llvm-svn: 312887

7 years ago[X86][SSE] Move combineTo call out of combineX86ShufflesConstants. NFCI.
Simon Pilgrim [Sun, 10 Sep 2017 18:10:49 +0000 (18:10 +0000)]
[X86][SSE] Move combineTo call out of combineX86ShufflesConstants. NFCI.

Move towards making it possible to use the shuffle combines for cases where we don't want to call DCI.CombineTo() with the result.

llvm-svn: 312886

7 years ago[InstSimplify] refactor udiv/urem code and add tests; NFCI
Sanjay Patel [Sun, 10 Sep 2017 17:55:08 +0000 (17:55 +0000)]
[InstSimplify] refactor udiv/urem code and add tests; NFCI

This removes some duplicated code and makes it easier to support signed div/rem
in a similar way if we want to do that. Note that the existing comments were not
accurate - we don't need a constant divisor to simplify; icmp simplification does
more than that. But as the added tests show, it could go even further.

llvm-svn: 312885

7 years ago[X86][SSE] Move combineTo call out of combineX86ShuffleChain. NFCI.
Simon Pilgrim [Sun, 10 Sep 2017 14:06:41 +0000 (14:06 +0000)]
[X86][SSE] Move combineTo call out of combineX86ShuffleChain. NFCI.

First step towards making it possible to use the shuffle combines for cases where we don't want to call DCI.CombineTo() with the result.

llvm-svn: 312884

7 years agoAdded a test that demonstrates a ug in Scatter scheduling.
Elena Demikhovsky [Sun, 10 Sep 2017 13:20:42 +0000 (13:20 +0000)]
Added a test that demonstrates a ug in Scatter scheduling.
The bug is going to be fixed in an upcomming patch.

llvm-svn: 312883

7 years ago[clang][SemaStmtAsm] small refactoring, NFC.
Coby Tayree [Sun, 10 Sep 2017 12:39:21 +0000 (12:39 +0000)]
[clang][SemaStmtAsm] small refactoring, NFC.

llvm-svn: 312882

7 years ago[X86][X86AsmParser] adding const on InlineAsmIdentifierInfo in CreateMemForInlineAsm...
Coby Tayree [Sun, 10 Sep 2017 12:21:24 +0000 (12:21 +0000)]
[X86][X86AsmParser] adding const on InlineAsmIdentifierInfo in CreateMemForInlineAsm. NFC.

llvm-svn: 312881

7 years agoRevert "adding autoUpgrade support to broadcast[f|i]32x2 intrinsics"
Uriel Korach [Sun, 10 Sep 2017 09:07:21 +0000 (09:07 +0000)]
Revert "adding autoUpgrade support to broadcast[f|i]32x2 intrinsics"

This reverts commit r312879 - An accidental partial commit.

llvm-svn: 312880

7 years agoadding autoUpgrade support to broadcast[f|i]32x2 intrinsics
Uriel Korach [Sun, 10 Sep 2017 08:40:13 +0000 (08:40 +0000)]
adding autoUpgrade support to broadcast[f|i]32x2 intrinsics

llvm-svn: 312879

7 years agoTest commit
Uriel Korach [Sun, 10 Sep 2017 08:31:22 +0000 (08:31 +0000)]
Test commit

llvm-svn: 312878

7 years agoset the svn:executable property, seems that it is necessary for apache (discussed...
Sylvestre Ledru [Sun, 10 Sep 2017 08:00:03 +0000 (08:00 +0000)]
set the svn:executable property, seems that it is necessary for apache (discussed with Tanya by email)

llvm-svn: 312877

7 years ago[SCEV] Re-arrange public and private sections to be contiguous; NFC
Sanjoy Das [Sun, 10 Sep 2017 03:54:22 +0000 (03:54 +0000)]
[SCEV] Re-arrange public and private sections to be contiguous; NFC

llvm-svn: 312876

7 years ago[CodegenCleanup] Update cleanup passes according (old) PassManagerBuilder.
Michael Kruse [Sat, 9 Sep 2017 21:43:49 +0000 (21:43 +0000)]
[CodegenCleanup] Update cleanup passes according (old) PassManagerBuilder.

Update CodegenCleanup using the function-level passes added by
populatePassManager that run between EP_EarlyAsPossible and
EP_VectorizerStart in -O3.

The changes in particular are:
- Added pass create arguments, e.g. ExpensiveCombines for InstCombine.
- Remove reroll pass. The option -reroll-loops is disabled by default.
- Add passes run with UnitAtATime, which is the default.
- Add instances of LibCallsShrinkWrap, TailCallElimination, SCCP
  (sparse conditional constant propagation), Float2Int
  that did not run before.
- Add instances of GVN as in the default pipeline.

Notes:
- GVNHoist, GVNSink, NewGVN are still disabled in the -O3 pipeline.
- The optimization level and other optimization parameters are not
  accessible outside of PassManagerBuilder, hence we cannot add passes
  depending on these.

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

llvm-svn: 312875

7 years ago[X86] Add v2i4 store test case (PR20012)
Simon Pilgrim [Sat, 9 Sep 2017 20:28:50 +0000 (20:28 +0000)]
[X86] Add v2i4 store test case (PR20012)

llvm-svn: 312874

7 years ago[X86] Add v2i2 test case (PR20011)
Simon Pilgrim [Sat, 9 Sep 2017 20:22:35 +0000 (20:22 +0000)]
[X86] Add v2i2 test case (PR20011)

llvm-svn: 312873

7 years ago[asan] Fix tests broken by r312858
Vitaly Buka [Sat, 9 Sep 2017 20:07:45 +0000 (20:07 +0000)]
[asan] Fix tests broken by r312858

llvm-svn: 312872

7 years ago[X86][FMA] Regenerate FMA tests
Simon Pilgrim [Sat, 9 Sep 2017 19:25:59 +0000 (19:25 +0000)]
[X86][FMA] Regenerate FMA tests

llvm-svn: 312871

7 years agoclang fix for LLVM API change: isKnownNonNull -> isKnownNonZero
Nuno Lopes [Sat, 9 Sep 2017 18:25:36 +0000 (18:25 +0000)]
clang fix for LLVM API change: isKnownNonNull -> isKnownNonZero

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

llvm-svn: 312870

7 years agoMerge isKnownNonNull into isKnownNonZero
Nuno Lopes [Sat, 9 Sep 2017 18:23:11 +0000 (18:23 +0000)]
Merge isKnownNonNull into isKnownNonZero
It now knows the tricks of both functions.
Also, fix a bug that considered allocas of non-zero address space to be always non null

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

llvm-svn: 312869

7 years ago[X86][SSE] i32 vector multiplications test cases from PR6399
Simon Pilgrim [Sat, 9 Sep 2017 18:18:17 +0000 (18:18 +0000)]
[X86][SSE] i32 vector multiplications test cases from PR6399

llvm-svn: 312868

7 years ago[X86][MOVBE] Fix typo in MOVBE scheduling test names
Simon Pilgrim [Sat, 9 Sep 2017 17:52:44 +0000 (17:52 +0000)]
[X86][MOVBE] Fix typo in MOVBE scheduling test names

Copy+paste is not your friend

llvm-svn: 312867

7 years ago[X86] Don't disable slow INC/DEC if optimizing for size
Craig Topper [Sat, 9 Sep 2017 17:11:59 +0000 (17:11 +0000)]
[X86] Don't disable slow INC/DEC if optimizing for size

Summary:
Just because INC/DEC is a little slow on some processors doesn't mean we shouldn't prefer it when optimizing for size.

This appears to match gcc behavior.

Reviewers: chandlerc, zvi, RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 312866

7 years ago[Basic] Update CMakeLists.txt to handle repo
MinSeong Kim [Sat, 9 Sep 2017 14:18:53 +0000 (14:18 +0000)]
[Basic] Update CMakeLists.txt to handle repo

Summary:
The find_first_existing_file and find_first_existing_vc_file macros in
lib/Basic/CMakeLists.txt are removed. The macros are also defined in
{LLVM}/cmake/modules/AddLLVM.cmake for the same purpose. This change
serves the following 2 objectives:

    1. To remove the redundant code in clang to use the same
       macros in llvm,
    2. The macros in AddLLVM.cmake can also handle repo for
       displaying correct version information.

Reviewers: jordan_rose, cfe-commits, modocache, hintonda

Reviewed By: hintonda

Subscribers: mgorny

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

llvm-svn: 312865

7 years ago[CMake] Update GetSVN.cmake to handle repo
MinSeong Kim [Sat, 9 Sep 2017 14:17:52 +0000 (14:17 +0000)]
[CMake] Update GetSVN.cmake to handle repo

Summary:
When repo is used with git, 'clang --version' option does not display
the correct revision information (i.e. git hash on TOP) as the following:

clang version 6.0.0 --->
clang version 6.0.0 (clang version) (llvm version)

This is because repo also creates .git/svn folder as git-svn does and
this makes repo with git uses "git svn info" command, which is only for
git-svn, to retrieve its revision information, making null for the info.
To correctly distinguish between git-svn and repo with git, the folder
hierarchy to specify for git-svn should be .git/svn/refs as the "git svn
info" command depends on the revision data in .git/svn/refs. This patch
in turn makes repo with git passes through to the third macro,
get_source_info_git, in  get_source_info function, resulting in correctly
retrieving the revision information for repo with git using "git log ..."
command.

This patch is tested with git, svn, git-svn, and repo with git.

Reviewers: llvm-commits, probinson, rnk

Reviewed By: rnk

Subscribers: rnk, mehdi_amini, beanz, mgorny

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

llvm-svn: 312864

7 years ago[DivRemPairs] split tests per target to account for bots that don't build for all...
Sanjay Patel [Sat, 9 Sep 2017 14:10:59 +0000 (14:10 +0000)]
[DivRemPairs] split tests per target to account for bots that don't build for all targets

llvm-svn: 312863

7 years ago[DivRempairs] add a pass to optimize div/rem pairs (PR31028)
Sanjay Patel [Sat, 9 Sep 2017 13:38:18 +0000 (13:38 +0000)]
[DivRempairs] add a pass to optimize div/rem pairs (PR31028)

This is intended to be a superset of the functionality from D31037 (EarlyCSE) but implemented
as an independent pass, so there's no stretching of scope and feature creep for an existing pass.
I also proposed a weaker version of this for SimplifyCFG in D30910. And I initially had almost
this same functionality as an addition to CGP in the motivating example of PR31028:
https://bugs.llvm.org/show_bug.cgi?id=31028

The advantage of positioning this ahead of SimplifyCFG in the pass pipeline is that it can allow
more flattening. But it needs to be after passes (InstCombine) that could sink a div/rem and
undo the hoisting that is done here.

Decomposing remainder may allow removing some code from the backend (PPC and possibly others).

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

llvm-svn: 312862

7 years agoCoverageMappingTest.cpp: Suppress warnings. [-Wdocumentation]
NAKAMURA Takumi [Sat, 9 Sep 2017 06:19:53 +0000 (06:19 +0000)]
CoverageMappingTest.cpp: Suppress warnings. [-Wdocumentation]

llvm-svn: 312861

7 years ago[ubsan] Enable UBsan in sanitizer_common tests
Vitaly Buka [Sat, 9 Sep 2017 06:10:58 +0000 (06:10 +0000)]
[ubsan] Enable UBsan in sanitizer_common tests

Summary:
Failing tests just marked as UNSUPPORTED or XFAIL.
Some of them can be easily supported, but I'll do this in separate patches.

Reviewers: eugenis, alekseyshl

Subscribers: srhines, kubamracek, llvm-commits, mgorny

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

llvm-svn: 312860

7 years ago[compiler-rt] Move allow_user_segv.cc into sanitizer_common
Vitaly Buka [Sat, 9 Sep 2017 06:04:23 +0000 (06:04 +0000)]
[compiler-rt] Move allow_user_segv.cc into sanitizer_common

Summary: Part of https://github.com/google/sanitizers/issues/637

Reviewers: eugenis

Subscribers: kubamracek, dberris, llvm-commits

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

llvm-svn: 312859

7 years ago[asan] Use more generic string in error message
Vitaly Buka [Sat, 9 Sep 2017 05:58:52 +0000 (05:58 +0000)]
[asan] Use more generic string in error message

Summary: Part of https://github.com/google/sanitizers/issues/637

Reviewers: eugenis, alekseyshl

Subscribers: llvm-commits, kubamracek

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

llvm-svn: 312858

7 years ago[X86] Call removeDeadNode when we're done doing custom isel for mul, div and test
Craig Topper [Sat, 9 Sep 2017 05:57:20 +0000 (05:57 +0000)]
[X86] Call removeDeadNode when we're done doing custom isel for mul, div and test

Summary:
Once we've done our custom isel for these nodes, I think we should be calling removeDeadNode to prune them out of the DAG. Table driven isel ultimately either calls morphNodeTo which modifies a node and doesn't leave dead nodes. Or it emits new nodes and then calls removeDeadNode as part of Opc_CompleteMatch.

If you run a simple multiply test case like this through llc with -debug you'll see a umul_lohi node get printed as part of the dump for Instruction Selection ends.

```
define i64 @foo(i64 %a, i64 %b) local_unnamed_addr #0 {
entry:
  %conv = zext i64 %a to i128
  %conv1 = zext i64 %b to i128
  %mul = mul nuw nsw i128 %conv1, %conv
  %shr = lshr i128 %mul, 64
  %conv2 = trunc i128 %shr to i64
  ret i64 %conv2
}
```

Reviewers: RKSimon, spatel, zvi, guyblank, niravd

Reviewed By: niravd

Subscribers: llvm-commits

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

llvm-svn: 312857

7 years ago[X86] Use ReplaceNode instead of ReplaceUses when converting X86ISD::SHRUNKBLEND...
Craig Topper [Sat, 9 Sep 2017 05:57:19 +0000 (05:57 +0000)]
[X86] Use ReplaceNode instead of ReplaceUses when converting X86ISD::SHRUNKBLEND to ISD::VSELECT during isel.

This ensures that the SHRUNKBLEND node gets erased immediately.

llvm-svn: 312856

7 years ago[sanitizer-coverage] call appendToUsed once per module, not once per function (which...
Kostya Serebryany [Sat, 9 Sep 2017 05:30:13 +0000 (05:30 +0000)]
[sanitizer-coverage] call appendToUsed once per module, not once per function (which is too slow)

llvm-svn: 312855

7 years agointeger: Add popcount implementation using ctpop intrinsic
Aaron Watry [Sat, 9 Sep 2017 02:23:54 +0000 (02:23 +0000)]
integer: Add popcount implementation using ctpop intrinsic

Also copy/modify the unary_intrin.inc from math/ to make the
intrinsic declaration somewhat reusable.

Passes CL CTS integer_ops/test_integer_ops popcount tests for CL 1.2

Tested-by on GCN 1.0 (Pitcairn)

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

7 years ago[SLP] Fix buildbots, NFC.
Alexey Bataev [Sat, 9 Sep 2017 02:08:45 +0000 (02:08 +0000)]
[SLP] Fix buildbots, NFC.

llvm-svn: 312853

7 years agoRegAllocFast: Fix warning; NFC
Matthias Braun [Sat, 9 Sep 2017 01:16:59 +0000 (01:16 +0000)]
RegAllocFast: Fix warning; NFC

llvm-svn: 312852

7 years agoFix ownership of the MemoryBuffer in a FrontendInputFile.
Richard Smith [Sat, 9 Sep 2017 01:14:04 +0000 (01:14 +0000)]
Fix ownership of the MemoryBuffer in a FrontendInputFile.

This fixes a possible crash on certain kinds of corrupted AST file, but
checking in an AST file corrupted in just the right way will be a maintenance
nightmare because the format changes frequently.

llvm-svn: 312851

7 years ago[cxx_status] Change "Clang 5" items from yellow to green now that Clang 5 has been...
Richard Smith [Sat, 9 Sep 2017 01:11:04 +0000 (01:11 +0000)]
[cxx_status] Change "Clang 5" items from yellow to green now that Clang 5 has been released.

llvm-svn: 312850

7 years ago[libFuzzer] remove a couple of reduntant includes
Kostya Serebryany [Sat, 9 Sep 2017 00:56:34 +0000 (00:56 +0000)]
[libFuzzer] remove a couple of reduntant includes

llvm-svn: 312848

7 years agoRegAllocFast: Cleanup; NFC
Matthias Braun [Sat, 9 Sep 2017 00:52:46 +0000 (00:52 +0000)]
RegAllocFast: Cleanup; NFC

- Use range based for
- Variable names should start with upper case
- Add `const`
- Change class name to match filename
- Fix doxygen comments
- Use MCPhysReg instead of unsigned
- Use references instead of pointers where things cannot be nullptr
- Misc coding style improvements

llvm-svn: 312846

7 years agoRegAllocFast: Move vector to class level to avoid reallocation; NFC
Matthias Braun [Sat, 9 Sep 2017 00:52:45 +0000 (00:52 +0000)]
RegAllocFast: Move vector to class level to avoid reallocation; NFC

llvm-svn: 312845

7 years agoRegAllocFast: Remove write-only set; NFC
Matthias Braun [Sat, 9 Sep 2017 00:52:42 +0000 (00:52 +0000)]
RegAllocFast: Remove write-only set; NFC

llvm-svn: 312844

7 years agoPPC: Don't select lxv/stxv for insufficiently aligned stack slots.
Kyle Butt [Sat, 9 Sep 2017 00:37:56 +0000 (00:37 +0000)]
PPC: Don't select lxv/stxv for insufficiently aligned stack slots.

The lxv/stxv instructions require an offset that is 0 % 16. Previously we were
selecting lxv/stxv for loads and stores to the stack where the offset from the
slot was a multiple of 16, but the stack slot was not 16 or more byte aligned.
When the frame gets lowered these transform to r(1|31) + slot + offset.
If slot is not aligned, slot + offset may not be 0 % 16.
Now we require 16 byte or more alignment for select lxv/stxv to stack slots.

Includes a testcase that shows both sufficiently and insufficiently aligned
stack slots.

llvm-svn: 312843

7 years agoCatch more cases with -Wenum-compare
Richard Trieu [Sat, 9 Sep 2017 00:25:05 +0000 (00:25 +0000)]
Catch more cases with -Wenum-compare

Treat typedef enum as named enums instead of anonymous enums.  Anonymous enums
are ignored by the warning, so previously, typedef enums were ignored as well.

llvm-svn: 312842

7 years agoPlugins: fix resolution ambiguity in PDB plugin
Saleem Abdulrasool [Sat, 9 Sep 2017 00:13:49 +0000 (00:13 +0000)]
Plugins: fix resolution ambiguity in PDB plugin

A clang change caused the inclusion of `llvm::Type` and
`lldb_private::Type` to be pulled into the global namespace due to the
`using namespace llvm;` and `using namespace lldb_private;`.  Explicitly
qualify the `Type` to resolve the ambiguity.  NFC

llvm-svn: 312841