platform/upstream/llvm.git
8 years ago[OpenCL] Extended diagnostics for atomic initialization
Egor Churaev [Wed, 5 Apr 2017 12:47:10 +0000 (12:47 +0000)]
[OpenCL] Extended diagnostics for atomic initialization

Summary:
I saw the same changes in the following review: https://reviews.llvm.org/D17438

I don't know in that way I could determine that atomic variable was initialized by macro ATOMIC_VAR_INIT. Anyway I added check that atomic variables can be initialize only in global scope.
I think that we can discuss this change.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

llvm-svn: 299537

8 years ago[AMDGPU] SDWA peephole: enable by default
Sam Kolton [Wed, 5 Apr 2017 12:00:45 +0000 (12:00 +0000)]
[AMDGPU] SDWA peephole: enable by default

Reviewers: vpykhtin, rampitec, arsenm

Subscribers: qcolombet, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

llvm-svn: 299536

8 years agoFix WebAssembly after r299529.
Alexander Kornienko [Wed, 5 Apr 2017 11:50:43 +0000 (11:50 +0000)]
Fix WebAssembly after r299529.

llvm-svn: 299535

8 years agoAdd two Polly images
Tobias Grosser [Wed, 5 Apr 2017 11:50:31 +0000 (11:50 +0000)]
Add two Polly images

llvm-svn: 299534

8 years agoclang-format: [JS] fix whitespace around "of" operator.
Martin Probst [Wed, 5 Apr 2017 10:56:07 +0000 (10:56 +0000)]
clang-format: [JS] fix whitespace around "of" operator.

Summary:
Previously:
    import {of } from 'x';
    of (null);

Now:
    import {of} from 'x';
    of(null);

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 299533

8 years ago[X86][SSE] Renamed combine to make it clear that it only handles the vector shift...
Simon Pilgrim [Wed, 5 Apr 2017 10:44:42 +0000 (10:44 +0000)]
[X86][SSE] Renamed combine to make it clear that it only handles the vector shift by immediate opcodes. NFCI

llvm-svn: 299532

8 years ago[AArch64] Crypto requires FP.
James Molloy [Wed, 5 Apr 2017 10:44:38 +0000 (10:44 +0000)]
[AArch64] Crypto requires FP.

So if FP is disabled, crypto should also be disabled.

llvm-svn: 299531

8 years ago[ELF] Make createThunks a class [NFC]
Peter Smith [Wed, 5 Apr 2017 10:30:09 +0000 (10:30 +0000)]
[ELF] Make createThunks a class [NFC]

For range extension thunks we will need to repeatedly call createThunks()
until no more thunks are created. We will need to retain the state of
Thunks that we have created so far to avoid recreating them on later
passes. This change does not change the functionality of createThunks().

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

llvm-svn: 299530

8 years agoAdd MCContext argument to MCAsmBackend::applyFixup for error reporting
Alex Bradbury [Wed, 5 Apr 2017 10:16:14 +0000 (10:16 +0000)]
Add MCContext argument to MCAsmBackend::applyFixup for error reporting

A number of backends (AArch64, MIPS, ARM) have been using
MCContext::reportError to report issues such as out-of-range fixup values in
their TgtAsmBackend. This is great, but because MCContext couldn't easily be
threaded through to the adjustFixupValue helper function from its usual
callsite (applyFixup), these backends ended up adding an MCContext* argument
and adding another call to applyFixup to processFixupValue. Adding an
MCContext parameter to applyFixup makes this unnecessary, and even better -
applyFixup can take a reference to MCContext rather than a potentially null
pointer.

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

llvm-svn: 299529

8 years ago[ELF] - Define __bss_start symbol.
George Rimar [Wed, 5 Apr 2017 10:03:25 +0000 (10:03 +0000)]
[ELF] - Define __bss_start symbol.

GNU linkers define __bss_start symbol.
Patch teaches LLD to do that. This is PR32051.

Below is part of standart ld.bfd script:

.data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss            :
  {
Currently LLD can emit up to 3 .bss* sections as one of testcase shows.
Implementation inserts this symbol before first .bss* output section.

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

llvm-svn: 299528

8 years agoFix a typo introduce in r299200.
Nitesh Jain [Wed, 5 Apr 2017 09:31:43 +0000 (09:31 +0000)]
Fix a typo introduce in r299200.

llvm-svn: 299527

8 years ago[LAA] Correctly return a half-open range in expandBounds
James Molloy [Wed, 5 Apr 2017 09:24:26 +0000 (09:24 +0000)]
[LAA] Correctly return a half-open range in expandBounds

This is a latent bug that's been hanging around for a while. For a loop-invariant
pointer, expandBounds would return the range {Ptr, Ptr}, but this was interpreted
as a half-open range, not a closed range. So we ended up planting incorrect
bounds checks. Even worse, they were tautological, so we ended up incorrectly
executing the optimized loop.

llvm-svn: 299526

8 years agoRevert r299506 "Simplify. NFC."
George Rimar [Wed, 5 Apr 2017 09:19:29 +0000 (09:19 +0000)]
Revert r299506 "Simplify. NFC."

It was not NFC unfortunaly,
one of changes decrements begin() iterator and
that is not allowed by MSVS.

llvm-svn: 299525

8 years ago[OpenCL] Enables passing sampler initializer to function argument
Egor Churaev [Wed, 5 Apr 2017 09:02:56 +0000 (09:02 +0000)]
[OpenCL] Enables passing sampler initializer to function argument

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: yaxunl, bader

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

llvm-svn: 299524

8 years ago[analyzer] alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression...
Daniel Marjamaki [Wed, 5 Apr 2017 08:57:04 +0000 (08:57 +0000)]
[analyzer] alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe

Summary:
The alpha.core.Conversion was too strict about compound assignments and could warn even though there is no problem.

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

llvm-svn: 299523

8 years agoDon't issue a warning if the shadowing declaration is in a class
Stephan Bergmann [Wed, 5 Apr 2017 08:36:58 +0000 (08:36 +0000)]
Don't issue a warning if the shadowing declaration is in a class

Follow-up to r299363 "Enhance -Wshadow to warn when shadowing typedefs or type
aliases".

Patch by Ahmed Asadi.

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

llvm-svn: 299522

8 years agoMake readAssert() to return an AssertCommand object.
Rui Ueyama [Wed, 5 Apr 2017 05:50:28 +0000 (05:50 +0000)]
Make readAssert() to return an AssertCommand object.

llvm-svn: 299521

8 years agoAdd a file comment.
Rui Ueyama [Wed, 5 Apr 2017 05:50:08 +0000 (05:50 +0000)]
Add a file comment.

llvm-svn: 299520

8 years agoSimplify. NFC.
Rui Ueyama [Wed, 5 Apr 2017 05:40:21 +0000 (05:40 +0000)]
Simplify. NFC.

Looks like we can use consume() in many more places.

llvm-svn: 299519

8 years agoInline leftShift and rightShift. NFC.
Rui Ueyama [Wed, 5 Apr 2017 05:40:01 +0000 (05:40 +0000)]
Inline leftShift and rightShift. NFC.

llvm-svn: 299518

8 years ago[coroutines] Add syntax coloring to examples in Coroutines.rst
Gor Nishanov [Wed, 5 Apr 2017 05:26:26 +0000 (05:26 +0000)]
[coroutines] Add syntax coloring to examples in Coroutines.rst

Subscribers: EricWF

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

llvm-svn: 299517

8 years agoDo not make ScriptParser class public.
Rui Ueyama [Wed, 5 Apr 2017 05:08:01 +0000 (05:08 +0000)]
Do not make ScriptParser class public.

This class is used only within this file, so it can be file-local.

llvm-svn: 299516

8 years agoMove the parser for the linker script to a separate file.
Rui Ueyama [Wed, 5 Apr 2017 05:07:39 +0000 (05:07 +0000)]
Move the parser for the linker script to a separate file.

LinkerScript.cpp contains both the linker script processor and the
linker script parser. I put both into a single file, but the file grown
too large, so it's time to put them into two different files.

llvm-svn: 299515

8 years agoRemove unused typedef.
Rui Ueyama [Wed, 5 Apr 2017 05:07:18 +0000 (05:07 +0000)]
Remove unused typedef.

llvm-svn: 299514

8 years agoDo not use public inheritance where it is not needed.
Rui Ueyama [Wed, 5 Apr 2017 05:06:58 +0000 (05:06 +0000)]
Do not use public inheritance where it is not needed.

ScriptParser is not a ScriptLexer, so this should be a private inheritance.

llvm-svn: 299513

8 years agoSimplify. NFC.
Rui Ueyama [Wed, 5 Apr 2017 05:06:37 +0000 (05:06 +0000)]
Simplify. NFC.

llvm-svn: 299512

8 years agoSimplify. NFC.
Rui Ueyama [Wed, 5 Apr 2017 05:06:17 +0000 (05:06 +0000)]
Simplify. NFC.

A for-loop is more boring than a find_if, but I think this is easier to read.

llvm-svn: 299511

8 years ago[coroutines] Add coro.end handling
Gor Nishanov [Wed, 5 Apr 2017 04:55:03 +0000 (04:55 +0000)]
[coroutines] Add coro.end handling

Summary:
For WinEH, We add a funclet bundle to a coro.end call, so that CoroSplit in LLVM can replace it with cleanup ret and cut the rest out.
For landing pad, we add a branch to resume block if coro.end returns true.

LLVM Part: https://reviews.llvm.org/D25445

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: EricWF, cfe-commits, rsmith, mehdi_amini

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

llvm-svn: 299510

8 years agoFix memory leak found by asan.
Rui Ueyama [Wed, 5 Apr 2017 03:52:47 +0000 (03:52 +0000)]
Fix memory leak found by asan.

llvm-svn: 299509

8 years agoSimplify and update comment.
Rui Ueyama [Wed, 5 Apr 2017 03:52:28 +0000 (03:52 +0000)]
Simplify and update comment.

llvm-svn: 299508

8 years ago[ObjCArc] Do not dereference an invalidated iterator.
Akira Hatanaka [Wed, 5 Apr 2017 03:44:09 +0000 (03:44 +0000)]
[ObjCArc] Do not dereference an invalidated iterator.

Fix a bug in ARC contract pass where an iterator that pointed to a
deleted instruction was dereferenced.

It appears that tryToContractReleaseIntoStoreStrong was incorrectly
assuming that a call to objc_retain would not immediately follow a call
to objc_release.

rdar://problem/25276306

llvm-svn: 299507

8 years agoSimplify. NFC.
Rui Ueyama [Wed, 5 Apr 2017 03:21:01 +0000 (03:21 +0000)]
Simplify. NFC.

llvm-svn: 299506

8 years agoUse make to create linker script command objects.
Rui Ueyama [Wed, 5 Apr 2017 03:20:42 +0000 (03:20 +0000)]
Use make to create linker script command objects.

It simplifies variable types.

llvm-svn: 299505

8 years agoRemove default arguments because they don't improve readability.
Rui Ueyama [Wed, 5 Apr 2017 03:20:22 +0000 (03:20 +0000)]
Remove default arguments because they don't improve readability.

llvm-svn: 299504

8 years agoAdd parentheses around `&`.
Rui Ueyama [Wed, 5 Apr 2017 03:20:03 +0000 (03:20 +0000)]
Add parentheses around `&`.

llvm-svn: 299503

8 years agoUpdate comment.
Rui Ueyama [Wed, 5 Apr 2017 03:19:43 +0000 (03:19 +0000)]
Update comment.

llvm-svn: 299502

8 years agoUse empty() instead of size().
Rui Ueyama [Wed, 5 Apr 2017 03:19:24 +0000 (03:19 +0000)]
Use empty() instead of size().

`!V.size()` where V is a vector is equivalent to `V.empty()`.

llvm-svn: 299501

8 years agoSimplify. NFC.
Rui Ueyama [Wed, 5 Apr 2017 03:19:06 +0000 (03:19 +0000)]
Simplify. NFC.

llvm-svn: 299500

8 years agoMake variable names consistent. NFC.
Rui Ueyama [Wed, 5 Apr 2017 03:18:46 +0000 (03:18 +0000)]
Make variable names consistent. NFC.

llvm-svn: 299499

8 years agoReturn a result from computeInputSections instead of mutating its argument.
Rui Ueyama [Wed, 5 Apr 2017 02:05:48 +0000 (02:05 +0000)]
Return a result from computeInputSections instead of mutating its argument.

This should improve readability.

llvm-svn: 299498

8 years ago[RuntimeDyld] Remove an unused static member left over from r299449.
Lang Hames [Wed, 5 Apr 2017 01:43:59 +0000 (01:43 +0000)]
[RuntimeDyld] Remove an unused static member left over from r299449.

llvm-svn: 299497

8 years ago[COFF] support /ERRORLIMIT option
Bob Haarman [Wed, 5 Apr 2017 00:43:54 +0000 (00:43 +0000)]
[COFF] support /ERRORLIMIT option

Summary:
This adds support for reporting multiple errors in a single invocation of lld-link. The limit defaults to 20 and can be changed with the /ERRORLIMIT command line parameter, or set to unlimited by passing a value of 0.

This is a new attempt after r295507, which was reverted because opening files raced with exiting early, causing the test to be flaky. This version avoids the race by exiting before calling enqueuePath.

Reviewers: pcc, ruiu

Reviewed By: ruiu

Subscribers: llvm-commits, dblaikie

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

llvm-svn: 299496

8 years agoRemove `=` from a lambda that doesn't capture any variable.
Rui Ueyama [Wed, 5 Apr 2017 00:43:45 +0000 (00:43 +0000)]
Remove `=` from a lambda that doesn't capture any variable.

llvm-svn: 299495

8 years agoInline small functions that are used only once as lambdas.
Rui Ueyama [Wed, 5 Apr 2017 00:43:25 +0000 (00:43 +0000)]
Inline small functions that are used only once as lambdas.

llvm-svn: 299494

8 years agoAdd newlines.
Rui Ueyama [Wed, 5 Apr 2017 00:43:05 +0000 (00:43 +0000)]
Add newlines.

llvm-svn: 299493

8 years agoMake dummy variable's scope smaller.
Rui Ueyama [Wed, 5 Apr 2017 00:42:45 +0000 (00:42 +0000)]
Make dummy variable's scope smaller.

llvm-svn: 299492

8 years agoThinLTOBitcodeWriter: handle aliases first in filterModule
Bob Haarman [Wed, 5 Apr 2017 00:42:07 +0000 (00:42 +0000)]
ThinLTOBitcodeWriter: handle aliases first in filterModule

Summary: This change fixes a "local linkage requires default visibility" assert when attempting to build LLVM with ThinLTO on Windows.

Reviewers: pcc, tejohnson, mehdi_amini

Reviewed By: pcc

Subscribers: llvm-commits, Prazek

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

llvm-svn: 299491

8 years ago[X86] Relax assert in broadcast-of-subvector lowering.
Ahmed Bougacha [Wed, 5 Apr 2017 00:14:39 +0000 (00:14 +0000)]
[X86] Relax assert in broadcast-of-subvector lowering.

Before r294774, there was a problem when lowering broadcasts to use
128-bit subvectors.

When we looked through a bitcast to find the broadcast input, we'd keep
using the original type, so you'd end up with things like:
  (v8f32 (broadcast
    (v4f32 (extract_subvector
      (v8i32 V),
      ...))
    ))

r294774 fixed it to always emit subvectors with the scalar type of the
original source.

It also introduced some asserts, to check that we use scalars with
the same size, and vectors with the same number of elements.

The scalar size equality is checked earlier when looking through bitcasts,
and is a useful assert.

However, the number of elements don't have to be identical: we're always
going to extract a 128-bit subvector, and we can have different size
inputs if we looked through a concat_vector to find a 256-bit source.

Relax the overzealous assert.

Replace it with a check of the original source vector being 256 or 512
bits.  If it's 128 bits, we can't extract_subvector from it.

Fixes PR32371.

llvm-svn: 299490

8 years agoReverting r299374 & r299402 due to testsuite failure.
Jim Ingham [Wed, 5 Apr 2017 00:08:21 +0000 (00:08 +0000)]
Reverting r299374 & r299402 due to testsuite failure.

This caused a failure in the test case:

  functionalities/breakpoint/objc/TestObjCBreakpoints.py

When we are parsing up names we stick interesting parts of the names
in various buckets, one of which is the ObjC selector bucket.  The new
C++ name parser must be interfering with this process somehow.

<rdar://problem/31439305>

llvm-svn: 299489

8 years agoAnother attempt to fix the sphinx warning from r299470
Adam Nemet [Tue, 4 Apr 2017 23:46:34 +0000 (23:46 +0000)]
Another attempt to fix the sphinx warning from r299470

llvm-svn: 299488

8 years agoAllow targets to opt-in to codegen in SCC order
Matt Arsenault [Tue, 4 Apr 2017 23:44:46 +0000 (23:44 +0000)]
Allow targets to opt-in to codegen in SCC order

Decouple this setting from EnableIRPA.

To support function calls on AMDGPU, it is necessary to
report the global register usage throughout the kernel's
call graph, so callees need to be handled first.

llvm-svn: 299487

8 years agoRe-apply MemorySSA: Add support for caching clobbering access in
Daniel Berlin [Tue, 4 Apr 2017 23:43:10 +0000 (23:43 +0000)]
Re-apply MemorySSA: Add support for caching clobbering access in
stores with some fixes.

Summary:
This enables us to cache the clobbering access for stores, despite the
fact that we can't rewrite the use-def chains themselves.

Early testing shows that, after this change, for larger testcases, it
will be a significant net positive (memory and time) to remove the
walker caching.

Reviewers: george.burgess.iv, davide

Subscribers: Prazek, llvm-commits

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

llvm-svn: 299486

8 years agoRevert "MemorySSA: Add support for caching clobbering access in stores"
Daniel Berlin [Tue, 4 Apr 2017 23:43:04 +0000 (23:43 +0000)]
Revert "MemorySSA: Add support for caching clobbering access in stores"

This reverts revision r299322.

llvm-svn: 299485

8 years ago[MC] Set defaults based on section names and support name suffixes
Petr Hosek [Tue, 4 Apr 2017 23:32:45 +0000 (23:32 +0000)]
[MC] Set defaults based on section names and support name suffixes

Set correct default flags and section type based on its name for .text,
.data, .bss, .init_array, .fini_array, .preinit_array, .tdata, and .tbss
and support section name suffixes for .data.*, .rodata.*, .text.*,
.bss.*, .tdata.* and .tbss.* which matches the behavior of GAS.

Fixes PR31888.

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

llvm-svn: 299484

8 years ago[AArch64] Avoid partial register deps on insertelt of load into lane 0.
Ahmed Bougacha [Tue, 4 Apr 2017 22:55:53 +0000 (22:55 +0000)]
[AArch64] Avoid partial register deps on insertelt of load into lane 0.

This improves upon r246462: that prevented FMOVs from being emitted
for the cross-class INSERT_SUBREGs by disabling the formation of
INSERT_SUBREGs of LOAD.  But the ld1.s that we started selecting
caused us to introduce partial dependencies on the vector register.

Avoid that by using SCALAR_TO_VECTOR: it's a first-class citizen that
is folded away by many patterns, including the scalar LDRS that we
want in this case.

Credit goes to Adam for finding the issue!

llvm-svn: 299482

8 years agoFix sphinx warning from r299470
Adam Nemet [Tue, 4 Apr 2017 22:45:20 +0000 (22:45 +0000)]
Fix sphinx warning from r299470

llvm-svn: 299481

8 years agoChange section flag character for SHF_LINK_ORDER to "o".
Evgeniy Stepanov [Tue, 4 Apr 2017 22:35:16 +0000 (22:35 +0000)]
Change section flag character for SHF_LINK_ORDER to "o".

See matching MC change in https://reviews.llvm.org/D31554.

llvm-svn: 299480

8 years agoChange section flag character for SHF_LINK_ORDER to "o".
Evgeniy Stepanov [Tue, 4 Apr 2017 22:35:08 +0000 (22:35 +0000)]
Change section flag character for SHF_LINK_ORDER to "o".

GAS uses "m" as a compatibility alias for "M" (SHF_MERGE).

"o" is free, except on ia64, where it already means SHF_LINK_ORDER.

llvm-svn: 299479

8 years agoAvoid calling basename to compute xdynamiclib_namespec.
Rafael Espindola [Tue, 4 Apr 2017 22:33:02 +0000 (22:33 +0000)]
Avoid calling basename to compute xdynamiclib_namespec.

This also exposes a xdynamiclib_filename that can be used to simplify
a few tests.

llvm-svn: 299478

8 years ago[InstCombine] Add test cases for various add/subtracts of constants(scalar, splat...
Craig Topper [Tue, 4 Apr 2017 22:22:30 +0000 (22:22 +0000)]
[InstCombine] Add test cases for various add/subtracts of constants(scalar, splat, and vector) with phis and selects. Improvements coming in a future commit.

llvm-svn: 299476

8 years ago[lit] Add a minimum export implementation.
Rafael Espindola [Tue, 4 Apr 2017 22:20:18 +0000 (22:20 +0000)]
[lit] Add a minimum export implementation.

llvm-svn: 299475

8 years ago[InstCombine] rename variable for easier reading; NFC
Sanjay Patel [Tue, 4 Apr 2017 22:06:03 +0000 (22:06 +0000)]
[InstCombine] rename variable for easier reading; NFC

We usually give constants a 'C' somewhere in the name...

llvm-svn: 299474

8 years ago[Driver] Add option to print the resource directory
Meador Inge [Tue, 4 Apr 2017 21:46:50 +0000 (21:46 +0000)]
[Driver] Add option to print the resource directory

This patch adds the option -print-resource-dir. It simply
prints the resource directory. This information will eventually
be used in compiler-rt to setup COMPILER_RT_LIBRARY_INSTALL_DIR.

Patch by Catherine Moore!

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

llvm-svn: 299473

8 years ago[InstCombine] Turn subtract of vectors of i1 into xor like we do for scalar i1. Match...
Craig Topper [Tue, 4 Apr 2017 21:44:56 +0000 (21:44 +0000)]
[InstCombine] Turn subtract of vectors of i1 into xor like we do for scalar i1. Matches what we already do for add.

llvm-svn: 299472

8 years agoDon't remove the cwd.
Rafael Espindola [Tue, 4 Apr 2017 21:42:59 +0000 (21:42 +0000)]
Don't remove the cwd.

This works with a regular shell since the kernel can keep track of a
deleted cwd. Since we just keep a path string, the following
subprocess invocations fail.

I think this would also fail on windows.

llvm-svn: 299471

8 years agoAdd #pragma clang fp
Adam Nemet [Tue, 4 Apr 2017 21:18:36 +0000 (21:18 +0000)]
Add #pragma clang fp

This adds the new pragma and the first variant, contract(on/off/fast).

The pragma has the same block scope rules as STDC FP_CONTRACT, i.e. it can be
placed at the beginning of a compound statement or at file scope.

Similarly to STDC FP_CONTRACT there is no need to use attributes.  First an
annotate token is inserted with the parsed details of the pragma.  Then the
annotate token is parsed in the proper contexts and the Sema is updated with
the corresponding FPOptions using the shared ActOn function with STDC
FP_CONTRACT.

After this the FPOptions from the Sema is propagated into the AST expression
nodes.  There is no change here.

I was going to add a 'default' option besides 'on/off/fast' similar to STDC
FP_CONTRACT but then decided against it. I think that we'd have to make option
uppercase then to avoid using 'default' the keyword.  Also because of the
scoped activation of pragma I am not sure there is really a need a for this.

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

llvm-svn: 299470

8 years agoSet FMF for -ffp-contract=fast
Adam Nemet [Tue, 4 Apr 2017 21:18:30 +0000 (21:18 +0000)]
Set FMF for -ffp-contract=fast

With this, FMF(contract) becomes an alternative way to express the request to
contract.

These are currently only propagated for FMul, FAdd and FSub.  The rest will be
added as more FMFs are hooked up for this.

This is toward fixing PR25721.

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

llvm-svn: 299469

8 years ago[AArch64] Add missing schedinfo, check completeness for Falkor.
Balaram Makam [Tue, 4 Apr 2017 21:15:53 +0000 (21:15 +0000)]
[AArch64] Add missing schedinfo, check completeness for Falkor.

llvm-svn: 299468

8 years ago[ExecutionDepsFix] Don't revisit true dependencies
Keno Fischer [Tue, 4 Apr 2017 20:30:47 +0000 (20:30 +0000)]
[ExecutionDepsFix] Don't revisit true dependencies

If an instruction has a true dependency, it makes sense for to use that
register for any undef read operands in the same instruction (we'll have
to wait for that register to become available anyway). This logic
was already implemented. However, the code would then still try to
revisit that instruction and break the dependency (and always fail,
since by definition a true dependency has to be live before the
instruction). Avoid revisiting such instructions as a performance
optimization. No functional change.

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

llvm-svn: 299467

8 years ago[InstCombine] Support folding and/or/xor with a constant vector RHS into selects...
Craig Topper [Tue, 4 Apr 2017 20:26:25 +0000 (20:26 +0000)]
[InstCombine] Support folding and/or/xor with a constant vector RHS into selects and phis

Currently we only fold with ConstantInt RHS. This generalizes to any Constant RHS.

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

llvm-svn: 299466

8 years ago[clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)
Matthias Gehre [Tue, 4 Apr 2017 20:11:13 +0000 (20:11 +0000)]
[clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)

Summary:
The new test case was crashing before. Now it passes
as expected.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 299465

8 years agoDon't resolve hidden undef to a DSO.
Rafael Espindola [Tue, 4 Apr 2017 20:03:34 +0000 (20:03 +0000)]
Don't resolve hidden undef to a DSO.

The ELF spec says:

all of the non-default visibility attributes, when applied to a symbol
reference, imply that a definition to satisfy that reference must be
provided within the current executable or shared object.

But we were trying to resolve those undef references to shared
symbols. That causes odd results like creating a got entry with
a relocation pointing to 0.

llvm-svn: 299464

8 years ago[analyzer] Add new Z3 constraint manager backend
Dominic Chen [Tue, 4 Apr 2017 19:52:25 +0000 (19:52 +0000)]
[analyzer] Add new Z3 constraint manager backend

Summary: Implement new Z3 constraint manager backend.

Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun

Subscribers: mgorny, cfe-commits

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

llvm-svn: 299463

8 years ago[AArch64][Fuchsia] Allow -mcmodel=kernel for --target=aarch64-fuchsia
Petr Hosek [Tue, 4 Apr 2017 19:51:53 +0000 (19:51 +0000)]
[AArch64][Fuchsia] Allow -mcmodel=kernel for --target=aarch64-fuchsia

This mode is just like -mcmodel=small except that it moves the
thread pointer from TPIDR_EL0 to TPIDR_EL1.

Patch by Roland McGrath.

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

llvm-svn: 299462

8 years ago[clangd] Link against clangSema
Jonas Devlieghere [Tue, 4 Apr 2017 19:42:29 +0000 (19:42 +0000)]
[clangd] Link against clangSema

Fixes linking issue introduced by rL299421 when building LLVM with
shared libraries.

llvm-svn: 299461

8 years ago[InstCombine] Add test cases for missing combines of phis with and/or/xor with consta...
Craig Topper [Tue, 4 Apr 2017 19:31:21 +0000 (19:31 +0000)]
[InstCombine] Add test cases for missing combines of phis with and/or/xor with constant argument. NFC

llvm-svn: 299460

8 years ago[fixup][X86][inline-asm] Add support for MS 'EVEN' directive
Coby Tayree [Tue, 4 Apr 2017 19:20:21 +0000 (19:20 +0000)]
[fixup][X86][inline-asm] Add support for MS 'EVEN' directive

refining tested targets resolution, to amend failures caused by rL299454

llvm-svn: 299459

8 years agoImplement host CPU detection for AArch64
Yi Kong [Tue, 4 Apr 2017 19:06:04 +0000 (19:06 +0000)]
Implement host CPU detection for AArch64

This shares detection logic with ARM(32), since AArch64 capable CPUs may
also run in 32-bit system mode.

We observe weird /proc/cpuinfo output for MSM8992 and MSM8994, where
they report all CPU cores as one single model, depending on which CPU
core the kernel is running on. As a workaround, we hardcode the known
CPU part name for these SoCs.

For big.LITTLE systems, this patch would only return the part name of
the first core (usually the little core). Proper support will be added
in a follow-up change.

Differential Revision: D31675

llvm-svn: 299458

8 years agoVerifier: Check some amdgpu calling convention restrictions
Matt Arsenault [Tue, 4 Apr 2017 18:43:11 +0000 (18:43 +0000)]
Verifier: Check some amdgpu calling convention restrictions

llvm-svn: 299457

8 years ago[AArch64] Refine Falkor Machine Model - Part 2
Balaram Makam [Tue, 4 Apr 2017 18:42:14 +0000 (18:42 +0000)]
[AArch64] Refine Falkor Machine Model - Part 2

llvm-svn: 299456

8 years ago[X86][inline-asm] Add support for MS 'EVEN' directive
Coby Tayree [Tue, 4 Apr 2017 17:58:28 +0000 (17:58 +0000)]
[X86][inline-asm] Add support for MS 'EVEN' directive

MS assembly syntax provide us with the 'EVEN' directive as a synonymous to at&t '.even'.
This patch include the (small, simple) changes need to allow it.

llvm-side:
https://reviews.llvm.org/D27417

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

llvm-svn: 299454

8 years ago[X86][inline-asm] Add support for MS 'EVEN' directive
Coby Tayree [Tue, 4 Apr 2017 17:57:23 +0000 (17:57 +0000)]
[X86][inline-asm] Add support for MS 'EVEN' directive

MS assembly syntax provide us with the 'EVEN' directive as a synonymous to at&t '.even'.
This patch include the (small, simple) changes need to allow it.

Test is provided at the following (clang-side) review:
https://reviews.llvm.org/D27418

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

llvm-svn: 299453

8 years agoAvoid sub shell.
Rafael Espindola [Tue, 4 Apr 2017 17:49:45 +0000 (17:49 +0000)]
Avoid sub shell.

Another step in getting these tests to run with the integrated one.

llvm-svn: 299452

8 years agoTone down the "lldb types" log a bit.
Jim Ingham [Tue, 4 Apr 2017 17:48:21 +0000 (17:48 +0000)]
Tone down the "lldb types" log a bit.

Change the get shared class info function to only
dump its results to the inferior stdout when the
log is verbose.  This matches the lldb side of the
same process, which only logs what it found if the
log is on verbose.

llvm-svn: 299451

8 years ago[InstCombine] Add more test cases for missing combines of selects with and/or/xor...
Craig Topper [Tue, 4 Apr 2017 17:48:08 +0000 (17:48 +0000)]
[InstCombine] Add more test cases for missing combines of selects with and/or/xor with constant argument. NFC

llvm-svn: 299450

8 years ago[RuntimeDyld] Make RuntimeDyld honor the ProcessAllSections flag.
Lang Hames [Tue, 4 Apr 2017 17:03:49 +0000 (17:03 +0000)]
[RuntimeDyld] Make RuntimeDyld honor the ProcessAllSections flag.

When the ProcessAllSections flag (introduced in r204398) is set RuntimeDyld is
supposed to make a call to the client's memory manager for every section in each
object that is loaded. Due to some missing checks, this was not happening in all
cases. This patch adds the missing cases, and fixes the Orc unit test that
verifies correct behavior for ProcessAllSections (The unit test had been
silently bailing out due to an ordering issue: a change in the test order meant
that this unit-test was running before the native target was registered. This
issue has also been fixed in this patch).

This fixes <rdar://problem/22789965>

llvm-svn: 299449

8 years ago[x86] remove dead select-of-constants transform; NFCI
Sanjay Patel [Tue, 4 Apr 2017 16:54:58 +0000 (16:54 +0000)]
[x86] remove dead select-of-constants transform; NFCI

https://reviews.llvm.org/D30537 / https://reviews.llvm.org/rL296977 added these transforms
and other related transforms to the generic DAGCombiner (with a hook that x86 sets to true),
so these patterns should not exist by the time we reach the target-specific combiner hook.

llvm-svn: 299448

8 years ago[Bug 25404] Fix crash on typedef in OpenCL 2.0
Anastasia Stulova [Tue, 4 Apr 2017 16:50:46 +0000 (16:50 +0000)]
[Bug 25404] Fix crash on typedef in OpenCL 2.0

Fixed the assertion due to absence of source location for
implicitly defined types (using addImplicitTypedef()).
During Sema checks the source location is being expected
and therefore an assertion is triggered.

The change is not specific to OpenCL. But it is particularly
common for OpenCL types to be declared implicitly in Clang
to support the mode without the standard header.

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

llvm-svn: 299447

8 years ago[PGO] Memory intrinsic calls optimization based on profiled size
Rong Xu [Tue, 4 Apr 2017 16:42:20 +0000 (16:42 +0000)]
[PGO] Memory intrinsic calls optimization based on profiled size

This patch optimizes two memory intrinsic operations: memset and memcpy based
on the profiled size of the operation. The high level transformation is like:
  mem_op(..., size)
  ==>
  switch (size) {
    case s1:
       mem_op(..., s1);
       goto merge_bb;
    case s2:
       mem_op(..., s2);
       goto merge_bb;
    ...
    default:
       mem_op(..., size);
       goto merge_bb;
    }
  merge_bb:

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

llvm-svn: 299446

8 years agoPreserve vec3 type.
Jin-Gu Kang [Tue, 4 Apr 2017 16:40:25 +0000 (16:40 +0000)]
Preserve vec3 type.

Summary: Preserve vec3 type with CodeGen option.

Reviewers: Anastasia, bruno

Reviewed By: Anastasia

Subscribers: bruno, ahatanak, cfe-commits

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

llvm-svn: 299445

8 years agoAMDGPU: Remove legacy export intrinsic
Matt Arsenault [Tue, 4 Apr 2017 16:34:39 +0000 (16:34 +0000)]
AMDGPU: Remove legacy export intrinsic

llvm-svn: 299444

8 years agoAMDGPU: Remove legacy image intrinsics
Matt Arsenault [Tue, 4 Apr 2017 16:34:35 +0000 (16:34 +0000)]
AMDGPU: Remove legacy image intrinsics

llvm-svn: 299443

8 years agoFix problem with test.
Michael Zuckerman [Tue, 4 Apr 2017 15:44:06 +0000 (15:44 +0000)]
Fix problem with test.

llvm-svn: 299442

8 years ago[clangd] Fix completion test to not depend on the standard library
Krasimir Georgiev [Tue, 4 Apr 2017 15:08:42 +0000 (15:08 +0000)]
[clangd] Fix completion test to not depend on the standard library

llvm-svn: 299440

8 years ago[X86][MS-compatability]Allow named synonymous for MS-assembly operators
Coby Tayree [Tue, 4 Apr 2017 14:43:23 +0000 (14:43 +0000)]
[X86][MS-compatability]Allow named synonymous for MS-assembly operators

This patch enhances X86AsmParser's immediate expression parsing abilities, to include a named synonymous for selected binary/unary bitwise operators: {and,shl,shr,or,xor,not}, ultimately achieving better MS-compatability
MASM reference:
https://msdn.microsoft.com/en-us/library/94b6khh4.aspx

Differential Revision: D31277

llvm-svn: 299439

8 years agoStrip trailing whitespace
Simon Pilgrim [Tue, 4 Apr 2017 14:40:53 +0000 (14:40 +0000)]
Strip trailing whitespace

llvm-svn: 299438

8 years agoTest cancellation_for_sections.c expectedly fails on GCC
Olga Malysheva [Tue, 4 Apr 2017 14:39:52 +0000 (14:39 +0000)]
Test cancellation_for_sections.c expectedly fails on GCC

llvm-svn: 299437

8 years ago[globalisel][tablegen] Fix non-determinism introduced in r299430.
Daniel Sanders [Tue, 4 Apr 2017 14:27:06 +0000 (14:27 +0000)]
[globalisel][tablegen] Fix non-determinism introduced in r299430.

This should fix the last issue on llvm-clang-x86_64-expensive-checks-win.

llvm-svn: 299436

8 years agoFix exception address alignment test for EHABI
Asiri Rathnayake [Tue, 4 Apr 2017 14:03:54 +0000 (14:03 +0000)]
Fix exception address alignment test for EHABI

This test fails on ARM bare-metal targets because it assumes the Itanium ABI,
whereas EHABI requires the exception address to be 8-byte aligned.

I was a bit puzzled at first because this should've failed on the public
arm-linux builder too. I think the reason it passes there is because we don't
include libunwind headers in the include path when running the libcxxabi tests,
so the system unwind.h gets picked up.

Reviewers: rengolin, EricWF
Differential revision: https://reviews.llvm.org/D31178

llvm-svn: 299435

8 years agoReset cancellation status for 'parallel', 'sections' and 'for' constracts.
Olga Malysheva [Tue, 4 Apr 2017 13:56:50 +0000 (13:56 +0000)]
Reset cancellation status for 'parallel', 'sections' and 'for' constracts.

Without this fix cancellation status for parallel, sections and for persists
across construct boundaries.

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

llvm-svn: 299434