platform/upstream/llvm.git
6 years ago[globalisel][tablegen] Add support for C++ predicates on PatFrags and use it to suppo...
Daniel Sanders [Fri, 15 Jun 2018 23:13:43 +0000 (23:13 +0000)]
[globalisel][tablegen] Add support for C++ predicates on PatFrags and use it to support BFC on ARM.

So far, we've only handled special cases of PatFrag like ImmLeaf. This patch
adds support for the remaining cases using similar mechanisms.

Like most C++ code from SelectionDAG, GISel and DAGISel expect to operate on
different types and representations and as such the code is not compatible
between the two. It's therefore necessary to add an alternative implementation
in the GISelPredicateCode field.

The target test for this feature could easily be done with IntImmLeaf and this
would save on a little boilerplate. The reason I've chosen to implement this
using PatFrag.GISelPredicateCode and not IntImmLeaf is because I was unable to
find a rule that was blocked solely by lack of support for PatFrag predicates. I
found that the ones I investigated as being likely candidates for the test
were further blocked by other things.

llvm-svn: 334871

6 years ago[docs] -fsanitize=cfi only allowed with -fvisibility=
Fangrui Song [Fri, 15 Jun 2018 23:11:18 +0000 (23:11 +0000)]
[docs] -fsanitize=cfi only allowed with -fvisibility=

llvm-svn: 334870

6 years agoRevert r334729 "[DAG] Avoid needing to walk out legalization tables. NFCI."
Francis Visoiu Mistrih [Fri, 15 Jun 2018 23:05:41 +0000 (23:05 +0000)]
Revert r334729 "[DAG] Avoid needing to walk out legalization tables. NFCI."

This reverts commit r334729.

llvm-svn: 334869

6 years agoRevert r334731 "Avoid unused variable in non-assert builds."
Francis Visoiu Mistrih [Fri, 15 Jun 2018 23:05:40 +0000 (23:05 +0000)]
Revert r334731 "Avoid unused variable in non-assert builds."

This reverts commit r334731.

It breaks EXPENSIVE_CHECKS bots.

llvm-svn: 334868

6 years ago[X86] Add more instructions to the hasUndefRegUpdate list.
Craig Topper [Fri, 15 Jun 2018 22:25:04 +0000 (22:25 +0000)]
[X86] Add more instructions to the hasUndefRegUpdate list.

Not sure any of these matter today because I don't think we ever produce them with IMPLICIT_DEF as an input. But by listing them we don't be suprised in the future.

llvm-svn: 334867

6 years ago[asan] Move long-object-path.cc test to Linux
Vitaly Buka [Fri, 15 Jun 2018 21:25:42 +0000 (21:25 +0000)]
[asan] Move long-object-path.cc test to Linux

Reviewers: Lekensteyn

Reviewed By: Lekensteyn

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 334866

6 years ago[BPI] Remove unnecessary std::list
Benjamin Kramer [Fri, 15 Jun 2018 21:06:43 +0000 (21:06 +0000)]
[BPI] Remove unnecessary std::list

vector is sufficient here. No functionality change intended.

llvm-svn: 334865

6 years ago[libFuzzer] Avoid -fuse-ld=lld on gc-sections.
Matt Morehouse [Fri, 15 Jun 2018 21:01:56 +0000 (21:01 +0000)]
[libFuzzer] Avoid -fuse-ld=lld on gc-sections.

The bot doesn't recognize lld as a linker even though it has the
property lld-available.

llvm-svn: 334864

6 years ago[FPEnv] Expand constrained FP POWI
Cameron McInally [Fri, 15 Jun 2018 20:57:55 +0000 (20:57 +0000)]
[FPEnv] Expand constrained FP POWI

Modify ExpandStrictFPOp(...) to handle nodes that have scalar
operands.

Also, add a Strict FMA test and do some other light cleanup in the
Strict FP code.

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

llvm-svn: 334863

6 years agoUtilize new SDNode flag functionality to expand current support for fdiv
Michael Berg [Fri, 15 Jun 2018 20:44:55 +0000 (20:44 +0000)]
Utilize new SDNode flag functionality to expand current support for fdiv

Summary: This patch originated from D46562 and is a proper subset, with some issues addressed.

Reviewers: spatel, hfinkel, wristow, arsenm

Reviewed By: spatel

Subscribers: wdng, nhaehnle

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

llvm-svn: 334862

6 years agoFix TestExec after r334783
Frederic Riss [Fri, 15 Jun 2018 20:36:03 +0000 (20:36 +0000)]
Fix TestExec after r334783

The second makefile that was added has implicit rules which meant
that secondprog.cpp would be built once into a secondprog binary,
but it would also be compiled as a.out overwriting the main binary.
This lead to spurious failures.

This commit simplifies the Makefile to build only once with the correct
executable name.

llvm-svn: 334861

6 years agoRevert "[lldb-mi] Add overload method for setting an error"
Alexander Polyakov [Fri, 15 Jun 2018 20:20:39 +0000 (20:20 +0000)]
Revert "[lldb-mi] Add overload method for setting an error"

Summary: This reverts commit r334245 because it duplicates
functionality of Status::AsCString used in SBError.

Reviewers: aprantl, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, ki.stfu

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

llvm-svn: 334860

6 years ago[Modules] Improve .Private fix-its to handle 'explicit' and 'framework'
Bruno Cardoso Lopes [Fri, 15 Jun 2018 20:13:28 +0000 (20:13 +0000)]
[Modules] Improve .Private fix-its to handle 'explicit' and 'framework'

When in the context of suggestion the fix-it from .Private to _Private
for private modules, trim off the 'explicit' and add 'framework' when
appropriate.

rdar://problem/41030554

llvm-svn: 334859

6 years ago[SanitizerCoverage] Add associated metadata to pc-tables.
Matt Morehouse [Fri, 15 Jun 2018 20:12:58 +0000 (20:12 +0000)]
[SanitizerCoverage] Add associated metadata to pc-tables.

Summary:
Using associated metadata rather than llvm.used allows linkers to
perform dead stripping with -fsanitize-coverage=pc-table.  Unfortunately
in my local tests, LLD was the only linker that made use of this metadata.

Partially addresses https://bugs.llvm.org/show_bug.cgi?id=34636 and fixes
https://github.com/google/sanitizers/issues/971.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: Dor1s, hiraditya, llvm-commits, kcc

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

llvm-svn: 334858

6 years agoUpdate my information in the CREDITS file.
Geoff Berry [Fri, 15 Jun 2018 20:02:11 +0000 (20:02 +0000)]
Update my information in the CREDITS file.

llvm-svn: 334857

6 years ago[PowerPC] Add support for high and higha symbol modifiers on tls modifers.
Sean Fertile [Fri, 15 Jun 2018 19:47:16 +0000 (19:47 +0000)]
[PowerPC] Add support for high and higha symbol modifiers on tls modifers.

Enables using the high and high-adjusted symbol modifiers on thread local
storage modifers in powerpc assembly. Needed to be able to support 64 bit
thread-pointer and dynamic-thread-pointer access sequences.

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

llvm-svn: 334856

6 years ago[PPC64] Support "symbol@high" and "symbol@higha" symbol modifers.
Sean Fertile [Fri, 15 Jun 2018 19:47:11 +0000 (19:47 +0000)]
[PPC64] Support "symbol@high" and "symbol@higha" symbol modifers.

Add support for the "@high" and "@higha" symbol modifiers in powerpc64 assembly.
The modifiers represent accessing the segment consiting of bits 16-31 of a
64-bit address/offset.

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

llvm-svn: 334855

6 years agoMove redundant-vf2-cost.ll test to X86 directory
Diego Caballero [Fri, 15 Jun 2018 18:46:03 +0000 (18:46 +0000)]
Move redundant-vf2-cost.ll test to X86 directory

redundant-vf2-cost.ll is X86 specific. Moved from
test/Transforms/LoopVectorize/redundant-vf2-cost.ll to
test/Transforms/LoopVectorize/X86/redundant-vf2-cost.ll

llvm-svn: 334854

6 years ago[llvm-mca][x86] Add Generic cpu resource tests
Simon Pilgrim [Fri, 15 Jun 2018 18:35:25 +0000 (18:35 +0000)]
[llvm-mca][x86] Add Generic cpu resource tests

Added a Generic x86 cpu set of resource tests to allow us to check all ISAs.

We currently use SandyBridge as our generic CPU model, but it's better if we actually duplicate these tests for if/when we change the model, it also means we don't end up polluting the SandyBridge folder with tests for ISAs it doesn't support.

llvm-svn: 334853

6 years ago[Fuzzer] Don't hardcode target architecture for Fuzzer tests
Petr Hosek [Fri, 15 Jun 2018 18:21:02 +0000 (18:21 +0000)]
[Fuzzer] Don't hardcode target architecture for Fuzzer tests

Don't hardcode the architecture for Fuzzer tests which breaks when
compiler-rt is being compiled for architectures other than x86_64.

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

llvm-svn: 334852

6 years ago[ELF][MIPS] Fix stable_sort predicate to satisfy strict-ordering requirement. NFC
Simon Atanasyan [Fri, 15 Jun 2018 18:15:26 +0000 (18:15 +0000)]
[ELF][MIPS] Fix stable_sort predicate to satisfy strict-ordering requirement. NFC

Fix for PR37785.

llvm-svn: 334851

6 years ago[X86] Lowering sqrt intrinsics to native IR
Tomasz Krupa [Fri, 15 Jun 2018 18:05:59 +0000 (18:05 +0000)]
[X86] Lowering sqrt intrinsics to native IR

Reviewers: craig.topper, spatel, RKSimon, igorb, uriel.k

Reviewed By: craig.topper

Subscribers: tkrupa, cfe-commits

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

llvm-svn: 334850

6 years ago[X86] Lowering sqrt intrinsics to native IR
Tomasz Krupa [Fri, 15 Jun 2018 18:05:24 +0000 (18:05 +0000)]
[X86] Lowering sqrt intrinsics to native IR

Summary: Complementary patch to lowering sqrt intrinsics in Clang.

Reviewers: craig.topper, spatel, RKSimon, DavidKreitzer, uriel.k

Reviewed By: craig.topper

Subscribers: tkrupa, mike.dvoretsky, llvm-commits

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

llvm-svn: 334849

6 years ago[X86] Prevent folding stack reloads into instructions in hasUndefRegUpdate.
Craig Topper [Fri, 15 Jun 2018 17:56:17 +0000 (17:56 +0000)]
[X86] Prevent folding stack reloads into instructions in hasUndefRegUpdate.

An earlier commit prevented folds from the peephole pass by checking for IMPLICIT_DEF. But later in the pipeline IMPLICIT_DEF just becomes and Undef flag on the input register so we need to check for that case too.

llvm-svn: 334848

6 years ago[X86] __builtin_ia32_prord512_mask, __builtin_ia32_prorq512_mask, __builtin_ia32_shuf...
Craig Topper [Fri, 15 Jun 2018 17:40:37 +0000 (17:40 +0000)]
[X86] __builtin_ia32_prord512_mask, __builtin_ia32_prorq512_mask, __builtin_ia32_shufpd should only accept an ICE constant.

The rotates also need to check for the immediate to fit in 8-bits. Shufpd already checks its immediate range.

llvm-svn: 334847

6 years ago[X86] The immediate argument to getmantpd*_mask should be an ICE and it should only...
Craig Topper [Fri, 15 Jun 2018 17:03:32 +0000 (17:03 +0000)]
[X86] The immediate argument to getmantpd*_mask should be an ICE and it should only be 4 bits wide.

We already checked this for the scalar version, but missed the vector version somehow.

llvm-svn: 334846

6 years agoRemove <undef> from rematerialized full register
Krzysztof Parzyszek [Fri, 15 Jun 2018 16:58:22 +0000 (16:58 +0000)]
Remove <undef> from rematerialized full register

When coalescing a small register into a subregister of a larger register,
if the larger register is rematerialized, the function updateRegDefUses
can add an <undef> flag to the rematerialized definition (since it's
treating it as only definining the coalesced subregister). While with that
assumption doing so is not incorrect, make sure to remove the flag later
on after the call to updateRegDefUses.

llvm-svn: 334845

6 years ago[InstCombine] Avoid iteration/mutation conflict
Joseph Tremoulet [Fri, 15 Jun 2018 16:52:40 +0000 (16:52 +0000)]
[InstCombine] Avoid iteration/mutation conflict

Summary:
When iterating users of a multiply in processUMulZExtIdiom, the
call to setOperand in the truncation case may replace the use
being visited; make sure the iterator has been advanced before
doing that replacement.

Reviewers: majnemer, davide

Reviewed By: davide

Subscribers: llvm-commits

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

llvm-svn: 334844

6 years ago[scudo] Add verbose failures in place of CHECK(0)
Kostya Kortchinsky [Fri, 15 Jun 2018 16:45:19 +0000 (16:45 +0000)]
[scudo] Add verbose failures in place of CHECK(0)

Summary:
The current `FailureHandler` mechanism was fairly opaque with regard to the
failure reason due to using `CHECK(0)`. Scudo is a bit different from the other
Sanitizers as it prefers to avoid spurious processing in its failure path. So
we just `dieWithMessage` using a somewhat explicit string.

Adapted the tests for the new strings.

While this takes care of the `OnBadRequest` & `OnOOM` failures, the next step
is probably to migrate the other Scudo failures in the same failes (header
corruption, invalid state and so on).

Reviewers: alekseyshl

Reviewed By: alekseyshl

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

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

llvm-svn: 334843

6 years ago[AArch64][SVE] Asm: Support for CPY SIMD/FP and GPR instructions.
Sander de Smalen [Fri, 15 Jun 2018 16:39:46 +0000 (16:39 +0000)]
[AArch64][SVE] Asm: Support for CPY SIMD/FP and GPR instructions.

Predicated splat/copy of SIMD/FP register or general purpose
register to SVE vector, along with MOV-aliases.

llvm-svn: 334842

6 years agoAvoid copying PrettyStackTrace messages an extra time on Apple OSs
Jordan Rose [Fri, 15 Jun 2018 16:35:31 +0000 (16:35 +0000)]
Avoid copying PrettyStackTrace messages an extra time on Apple OSs

We were unnecessarily going from SmallString to std::string just to
get a null-terminated C string. So just...don't do that. Crash
slightly faster!

llvm-svn: 334841

6 years ago[LV] Prevent LV to run cost model twice for VF=2
Diego Caballero [Fri, 15 Jun 2018 16:21:35 +0000 (16:21 +0000)]
[LV] Prevent LV to run cost model twice for VF=2

This is a minor fix for LV cost model, where the cost for VF=2 was
computed twice when the vectorization of the loop was forced without
specifying a VF.

Reviewers: xusx595, hsaito, fhahn, mkuper

Reviewed By: hsaito, xusx595

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

llvm-svn: 334840

6 years agobpf: recognize target specific option -mattr=dwarfris in clang
Yonghong Song [Fri, 15 Jun 2018 15:53:31 +0000 (15:53 +0000)]
bpf: recognize target specific option -mattr=dwarfris in clang

The following is the usage example with clang:
  bash-4.2$ clang -target bpf -O2 -g -c -Xclang -target-feature -Xclang +dwarfris t.c
  bash-4.2$ llvm-objdump -S -d t.o

  t.o:    file format ELF64-BPF

  Disassembly of section .text:
  test:
  ; int test(void) {
       0:       b7 00 00 00 00 00 00 00         r0 = 0
  ; return 0;
         1:       95 00 00 00 00 00 00 00         exit
  bash-4.2$ cat t.c
  int test(void) {
    return 0;
  }
  bash-4.2$

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

6 years ago[AArch64][SVE] Asm: Support for INC/DEC (scalar) instructions.
Sander de Smalen [Fri, 15 Jun 2018 15:47:44 +0000 (15:47 +0000)]
[AArch64][SVE] Asm: Support for INC/DEC (scalar) instructions.

Increment/decrement scalar register by (scaled) element count given by
predicate pattern, e.g. 'incw x0, all, mul #4'.

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

Reviewed By: SjoerdMeijer

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

llvm-svn: 334838

6 years ago[NFC] Add CreateMemTempWithoutCast and CreateTempAllocaWithoutCast
Yaxun Liu [Fri, 15 Jun 2018 15:33:22 +0000 (15:33 +0000)]
[NFC] Add CreateMemTempWithoutCast and CreateTempAllocaWithoutCast

This is partial re-commit of r332982

llvm-svn: 334837

6 years agoAMDGPU: Add combine for short vector extract_vector_elts
Matt Arsenault [Fri, 15 Jun 2018 15:31:36 +0000 (15:31 +0000)]
AMDGPU: Add combine for short vector extract_vector_elts

Try to access pieces 4 bytes at a time. This helps
various hasOneUse extract_vector_elt combines, such
as load width reductions.

Avoids test regressions in a future commit.

llvm-svn: 334836

6 years agoAMDGPU: Make v4i16/v4f16 legal
Matt Arsenault [Fri, 15 Jun 2018 15:15:46 +0000 (15:15 +0000)]
AMDGPU: Make v4i16/v4f16 legal

Some image loads return these, and it's awkward working
around them not being legal.

llvm-svn: 334835

6 years ago[llvm-readobj] Add -string-dump (-p) option
Paul Semel [Fri, 15 Jun 2018 14:15:02 +0000 (14:15 +0000)]
[llvm-readobj] Add -string-dump (-p) option

This option prints the section content as a string.

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

llvm-svn: 334834

6 years ago[MCA] Add -summary-view option
Roman Lebedev [Fri, 15 Jun 2018 14:01:43 +0000 (14:01 +0000)]
[MCA] Add -summary-view option

Summary:
While that is indeed a quite interesting summary stat,
there are cases where it does not really add anything
other than consuming extra lines.

Declutters the output of D48190.

Reviewers: RKSimon, andreadb, courbet, craig.topper

Reviewed By: andreadb

Subscribers: javed.absar, gbedwell, llvm-commits

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

llvm-svn: 334833

6 years ago[MCA][x86][NFC] Add tests for -register-file-stats, -scheduler-stats
Roman Lebedev [Fri, 15 Jun 2018 14:01:35 +0000 (14:01 +0000)]
[MCA][x86][NFC] Add tests for -register-file-stats, -scheduler-stats

Summary:
There does not seem to be any other tests for this.
Split off from D47676.

Reviewers: RKSimon, craig.topper, courbet, andreadb

Reviewed By: andreadb

Subscribers: javed.absar, gbedwell, llvm-commits

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

llvm-svn: 334832

6 years ago[AArch64][SVE] Asm: Support for FADD, FMUL and FMAX immediate instructions.
Sander de Smalen [Fri, 15 Jun 2018 13:57:51 +0000 (13:57 +0000)]
[AArch64][SVE] Asm: Support for FADD, FMUL and FMAX immediate instructions.

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

Reviewed By: javed.absar

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

llvm-svn: 334831

6 years agoRe-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"
Bjorn Pettersson [Fri, 15 Jun 2018 13:48:55 +0000 (13:48 +0000)]
Re-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"

This is r334704 (which was reverted in r334732) with a fix for
types like x86_fp80. We need to use getTypeAllocSizeInBits and
not getTypeStoreSizeInBits to avoid dropping debug info for
such types.

Original commit msg:
> Summary:
> Do not convert a DbgDeclare to DbgValue if the store
> instruction only refer to a fragment of the variable
> described by the DbgDeclare.
>
> Problem was seen when for example having an alloca for an
> array or struct, and there were stores to individual elements.
> In the past we inserted a DbgValue intrinsics for each store,
> just as if the store wrote the whole variable.
>
> When handling store instructions we insert a DbgValue that
> indicates that the variable is "undefined", as we do not know
> which part of the variable that is updated by the store.
>
> When ConvertDebugDeclareToDebugValue is used with a load/phi
> instruction we assert that the referenced value is large enough
> to cover the whole variable. Afaict this should be true for all
> scenarios where those methods are used on trunk. If the assert
> blows in the future I guess we could simply skip to insert a
> dbg.value instruction.
>
> In the future I think we should examine which part of the variable
> that is accessed, and add a DbgValue instrinsic with an appropriate
> DW_OP_LLVM_fragment expression.
>
> Reviewers: dblaikie, aprantl, rnk
>
> Reviewed By: aprantl
>
> Subscribers: JDevlieghere, llvm-commits
>
> Tags: #debug-info
>
> Differential Revision: https://reviews.llvm.org/D48024

llvm-svn: 334830

6 years ago[clang-tidy] This patch is a fix for D45405 where spaces were mistakenly considered...
Zinovy Nis [Fri, 15 Jun 2018 13:35:40 +0000 (13:35 +0000)]
[clang-tidy] This patch is a fix for D45405 where spaces were mistakenly considered as a part of a type name. So length("int *") was 5 instead of 3 with RemoveStars=0 or 4 with RemoveStars=1

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

llvm-svn: 334829

6 years ago[clangd] UI for completion items that would trigger include insertion.
Eric Liu [Fri, 15 Jun 2018 13:34:18 +0000 (13:34 +0000)]
[clangd] UI for completion items that would trigger include insertion.

Summary:
For completion items that would trigger include insertions (i.e. index symbols
that are not #included yet), add a visual indicator "+" before the completion
label. The inserted headers will appear in the completion detail.

Open to suggestions for better visual indicators; "+" was picked because it
seems cleaner than a few other candidates I've tried (*, #, @ ...).

The displayed header would be like a/b/c.h (without quote) or <vector> for system
headers. I didn't add quotation or "#include" because they can take up limited
space and do not provide additional information after users know what the
headers are. I think a header alone should be obvious for users to infer that
this is an include header..

To align indentation, also prepend ' ' to labels of candidates that would not
trigger include insertions (only for completions where index results are
possible).

Vim:
{F6357587}

vscode:
{F6357589}
{F6357591}

Reviewers: sammccall, ilya-biryukov, hokein

Reviewed By: sammccall

Subscribers: MaskRay, jkorous, cfe-commits

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

llvm-svn: 334828

6 years ago[mips] Add licensing information of the microMIPS tablegen files. (NFC)
Simon Dardis [Fri, 15 Jun 2018 13:29:35 +0000 (13:29 +0000)]
[mips] Add licensing information of the microMIPS tablegen files. (NFC)

llvm-svn: 334827

6 years ago[AArch64][SVE] Asm: Add parsing/printing support for exact FP immediates.
Sander de Smalen [Fri, 15 Jun 2018 13:11:49 +0000 (13:11 +0000)]
[AArch64][SVE] Asm: Add parsing/printing support for exact FP immediates.

Some instructions require of a limited set of FP immediates as operands,
for example '#0.5 or #1.0' for SVE's FADD instruction.

This patch adds support for parsing and printing such FP immediates as
exact values (e.g. #0.499999 is not accepted for #0.5).

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

Reviewed By: SjoerdMeijer

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

llvm-svn: 334826

6 years ago[NFC] chmod +x utils/update_analyze_test_checks.py
Roman Lebedev [Fri, 15 Jun 2018 12:41:50 +0000 (12:41 +0000)]
[NFC] chmod +x utils/update_analyze_test_checks.py

Looks like a simple oversight.

llvm-svn: 334825

6 years ago[clangd] context key constructor is constexpr. NFC
Sam McCall [Fri, 15 Jun 2018 12:39:21 +0000 (12:39 +0000)]
[clangd] context key constructor is constexpr. NFC

llvm-svn: 334824

6 years agoDAG: Fix creating concat_vectors with illegal type
Matt Arsenault [Fri, 15 Jun 2018 12:09:15 +0000 (12:09 +0000)]
DAG: Fix creating concat_vectors with illegal type

Test passes as is, but fails with future patch to make v4i16/v4f16
legal.

llvm-svn: 334823

6 years ago[clangd] Add option to fold overloads into a single completion item.
Sam McCall [Fri, 15 Jun 2018 11:06:29 +0000 (11:06 +0000)]
[clangd] Add option to fold overloads into a single completion item.

Summary:
Adds a CodeCompleteOption to folds together compatible function/method overloads
into a single item. This feels pretty good (for editors with signatureHelp
support), but has limitations.

This happens in the code completion merge step, so there may be inconsistencies
(e.g. if only one overload made it into the index result list, no folding).

We don't want to bundle together completions that have different side-effects
(include insertion), because we can't constructo a coherent CompletionItem.
This may be confusing for users, as the reason for non-bundling may not
be immediately obvious. (Also, the implementation seems a little fragile)

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 334822

6 years ago[SLP][X86] Add AVX2 run to POW2 SDIV Tests
Simon Pilgrim [Fri, 15 Jun 2018 10:29:37 +0000 (10:29 +0000)]
[SLP][X86] Add AVX2 run to POW2 SDIV Tests

Non-uniform pow2 tests are only make sense on targets with fast (low cost) non-uniform shifts

llvm-svn: 334821

6 years ago[AArch64] Reverted rC334696 with Clang VCVTA test fix
Luke Geeson [Fri, 15 Jun 2018 10:10:45 +0000 (10:10 +0000)]
[AArch64] Reverted  rC334696 with Clang VCVTA test fix

llvm-svn: 334820

6 years ago[SLP][X86] Regenerate POW2 SDIV Tests
Simon Pilgrim [Fri, 15 Jun 2018 10:07:03 +0000 (10:07 +0000)]
[SLP][X86] Regenerate POW2 SDIV Tests

Added non-uniform pow2 test as well

llvm-svn: 334819

6 years ago[InstCombine] Recommit: Fold (x << y) >> y -> x & (-1 >> y)
Roman Lebedev [Fri, 15 Jun 2018 09:56:52 +0000 (09:56 +0000)]
[InstCombine] Recommit: Fold  (x << y) >> y  ->  x & (-1 >> y)

Summary:
We already do it for splat constants, but not just values.
Also, undef cases are mostly non-functional.

The original commit was reverted because
it broke tests for amdgpu backend, which i didn't check.
Now, the backed was updated to recognize these new
patterns, so we are good.

https://bugs.llvm.org/show_bug.cgi?id=37603
https://rise4fun.com/Alive/cplX

Reviewers: spatel, craig.topper, mareko, bogner, rampitec, nhaehnle, arsenm

Reviewed By: spatel, rampitec, nhaehnle

Subscribers: wdng, nhaehnle, llvm-commits

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

llvm-svn: 334818

6 years ago[AMDGPU] Recognize x & ~(-1 << y) pattern.
Roman Lebedev [Fri, 15 Jun 2018 09:56:45 +0000 (09:56 +0000)]
[AMDGPU] Recognize x & ~(-1 << y) pattern.

Summary: The same pattern as D48010, but this one is IR-canonical as of D47428.

Reviewers: nhaehnle, bogner, tstellar, arsenm

Reviewed By: arsenm

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

Tags: #amdgpu

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

llvm-svn: 334817

6 years ago[AMDGPU] Recognize x & ((1 << y) - 1) pattern.
Roman Lebedev [Fri, 15 Jun 2018 09:56:39 +0000 (09:56 +0000)]
[AMDGPU] Recognize x & ((1 << y) - 1) pattern.

Summary:
As a followup for D48007.

Since we already handle `x << (bitwidth - y) >> (bitwidth - y)` pattern,
which does not have ub for both the edge cases (`y == 0`, `y == bitwidth`),
i think also handling a pattern that is ub for `y == bitwidth` should be fine.

Reviewers: nhaehnle, bogner, tstellar, arsenm

Reviewed By: arsenm

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

Tags: #amdgpu

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

llvm-svn: 334816

6 years ago[AMDGPU] Recognize x & (-1 >> (32 - y)) pattern.
Roman Lebedev [Fri, 15 Jun 2018 09:56:31 +0000 (09:56 +0000)]
[AMDGPU] Recognize  x &  (-1 >> (32 - y))  pattern.

Summary:
D47980 will canonicalize the `x << (32 - y) >> (32 - y)`,
which is the pattern the AMDGPU expects to `x &  (-1 >> (32 - y))`,
which is not recognized by AMDGPU.

Thus, it needs to be recognized, too.

Reviewers: nhaehnle, bogner, tstellar, arsenm

Reviewed By: arsenm

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

Tags: #amdgpu

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

llvm-svn: 334815

6 years ago[MC] Move bundling and MCSubtargetInfo to MCEncodedFragment [NFC]
Peter Smith [Fri, 15 Jun 2018 09:48:18 +0000 (09:48 +0000)]
[MC] Move bundling and MCSubtargetInfo to MCEncodedFragment [NFC]

Instruction bundling is only supported on descendants of the
MCEncodedFragment type. By moving the bundling functionality and
MCSubtargetInfo to this class it makes it easier to set and extract the
MCSubtargetInfo when it is necessary.

This is a refactoring change that will make it easier to pass the
MCSubtargetInfo through to writeNops when nop padding is required.

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

llvm-svn: 334814

6 years ago[llvm-exegesis][NFC] Remove dead variable.
Clement Courbet [Fri, 15 Jun 2018 09:46:57 +0000 (09:46 +0000)]
[llvm-exegesis][NFC] Remove dead variable.

llvm-svn: 334813

6 years ago[clangd] Fix buildbot error.
Haojian Wu [Fri, 15 Jun 2018 09:32:36 +0000 (09:32 +0000)]
[clangd] Fix buildbot error.

llvm-svn: 334812

6 years ago[llvm-exegesis][NFC] Add more comments.
Clement Courbet [Fri, 15 Jun 2018 09:27:12 +0000 (09:27 +0000)]
[llvm-exegesis][NFC] Add more comments.

llvm-svn: 334811

6 years ago[clangd] Boost completion score according to file proximity.
Eric Liu [Fri, 15 Jun 2018 08:58:12 +0000 (08:58 +0000)]
[clangd] Boost completion score according to file proximity.

Summary:
Also move unittest: URI scheme to TestFS so that it can be shared by
different tests.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits

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

llvm-svn: 334810

6 years ago[clangd] Customizable URI schemes for dynamic index.
Eric Liu [Fri, 15 Jun 2018 08:55:00 +0000 (08:55 +0000)]
[clangd] Customizable URI schemes for dynamic index.

Summary:
This allows dynamic index to have consistent URI schemes with the
static index which can have customized URI schemes, which would make file
proximity scoring based on URIs easier.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits

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

llvm-svn: 334809

6 years agoadd myself to the CREDITS.TXT
QingShan Zhang [Fri, 15 Jun 2018 08:34:41 +0000 (08:34 +0000)]
add myself to the CREDITS.TXT

llvm-svn: 334808

6 years ago[clangd] Do not report comments that only have special chars.
Ilya Biryukov [Fri, 15 Jun 2018 08:31:17 +0000 (08:31 +0000)]
[clangd] Do not report comments that only have special chars.

Summary:
Like the following:
  // -------
  // =======
  // *******

It does not cover all the cases, but those are definitely not very
useful.

Reviewers: sammccall, ioeric, hokein

Reviewed By: sammccall

Subscribers: MaskRay, jkorous, cfe-commits

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

llvm-svn: 334807

6 years agoNFC: Regenerating x86-sse41.ll test for InstCombine
Mikhail Dvoretckii [Fri, 15 Jun 2018 07:59:29 +0000 (07:59 +0000)]
NFC: Regenerating x86-sse41.ll test for InstCombine

Test regenerated to reduce noise in further patches.

llvm-svn: 334806

6 years ago[llvm-exegesis] Print the whole snippet in analysis.
Clement Courbet [Fri, 15 Jun 2018 07:30:45 +0000 (07:30 +0000)]
[llvm-exegesis] Print the whole snippet in analysis.

Summary:
On hover, the whole asm snippet is displayed, including operands.

This requires the actual assembly output instead of just the MCInsts:
This is because some pseudo-instructions get lowered to actual target
instructions during codegen (e.g. ABS_Fp32 -> SSE or X87).

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 334805

6 years ago[ASTImporter] Corrected diagnostic client handling in tests.
Adam Balogh [Fri, 15 Jun 2018 06:45:39 +0000 (06:45 +0000)]
[ASTImporter] Corrected diagnostic client handling in tests.

ASTImporter tests may produce source file related warnings, the diagnostic
client should be in correct state to handle it. Added 'beginSourceFile' to set
the client state.

Patch by: Balázs Kéri

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

llvm-svn: 334804

6 years agoRevert r334802 "[X86] Prevent folding stack reloads with instructions that have an...
Craig Topper [Fri, 15 Jun 2018 06:15:26 +0000 (06:15 +0000)]
Revert r334802 "[X86] Prevent folding stack reloads with instructions that have an undefined register update."

There's a typo causing the build to fail.

llvm-svn: 334803

6 years ago[X86] Prevent folding stack reloads with instructions that have an undefined register...
Craig Topper [Fri, 15 Jun 2018 06:11:36 +0000 (06:11 +0000)]
[X86] Prevent folding stack reloads with instructions that have an undefined register update.

We want to keep the load unfolded so we can use the same register for both sources to avoid a false dependency.

llvm-svn: 334802

6 years ago[Format] Do not use a global static value for EOF within ScopedMacroState.
David L. Jones [Fri, 15 Jun 2018 06:08:54 +0000 (06:08 +0000)]
[Format] Do not use a global static value for EOF within ScopedMacroState.

ScopedMacroState injects its own EOF token under certain conditions, and the
returned token may be modified in several different locations. If multiple
reformat operations are started in different threads, then they will both see
the same fake EOF token, and may both try to modify it. This is a data race.

This bug was caught with tsan.

Reviewers: klimek

Subscribers: cfe-commits

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

llvm-svn: 334801

6 years ago[X86] Add more instructions to the memory folding tables using the autogenerated...
Craig Topper [Fri, 15 Jun 2018 05:49:19 +0000 (05:49 +0000)]
[X86] Add more instructions to the memory folding tables using the autogenerated table as a guide.

I think this covers most of the unmasked vector instructions. We're still missing a lot of the masked instructions.

There are some test changes here because of the new folding support. I don't think these particular cases should be folded because it creates an undef register dependency. I think the changes introduced in r334175 are not handling stack folding. They're only blocking the peephole pass.

llvm-svn: 334800

6 years ago[NFC] fix trivial typos in documents
Hiroshi Inoue [Fri, 15 Jun 2018 05:10:09 +0000 (05:10 +0000)]
[NFC] fix trivial typos in documents

llvm-svn: 334799

6 years ago[X86] Fix some checks to use X86 instead of X32.
Craig Topper [Fri, 15 Jun 2018 04:42:55 +0000 (04:42 +0000)]
[X86] Fix some checks to use X86 instead of X32.

These tests were recently updated so it looks like gone wrong.

llvm-svn: 334786

6 years ago[X86] Add 'Z' to the internal names of various EVEX instructions for overall consistency.
Craig Topper [Fri, 15 Jun 2018 04:42:54 +0000 (04:42 +0000)]
[X86] Add 'Z' to the internal names of various EVEX instructions for overall consistency.

llvm-svn: 334785

6 years agoAdd support for PLATFORM_*SIMULATOR
Frederic Riss [Fri, 15 Jun 2018 02:50:45 +0000 (02:50 +0000)]
Add support for PLATFORM_*SIMULATOR

The toolchain in Xcode 10 uses a new LC_BUILD_VERSION entry to identify
simulator binaries. Add support for reading those to debugserver.

The exisitng test testing that code is currently failling when run
with Xcode 10, no need for a new test.

llvm-svn: 334784

6 years agoChange TestExec.py from creating an i386+x86_64 fat binary
Jason Molenda [Fri, 15 Jun 2018 00:55:53 +0000 (00:55 +0000)]
Change TestExec.py from creating an i386+x86_64 fat binary
on darwin systems and re-execing itself, to creating two
separate test programs; lldb runs the first program and it
exec's the second.

Support for compiling for i386 is going away.

llvm-svn: 334783

6 years agoAdd debug info for OProfile profiling support
Andrew Kaylor [Fri, 15 Jun 2018 00:07:28 +0000 (00:07 +0000)]
Add debug info for OProfile profiling support

Patch by Gaetano Priori

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

llvm-svn: 334782

6 years ago[cmake] Change ON/OFF to YES/NO. NFC
Shoaib Meenai [Thu, 14 Jun 2018 23:40:04 +0000 (23:40 +0000)]
[cmake] Change ON/OFF to YES/NO. NFC

compnerd pointed out that the latter reads better over here.

llvm-svn: 334781

6 years ago[cmake] Add linker detection for Apple platforms
Shoaib Meenai [Thu, 14 Jun 2018 23:26:33 +0000 (23:26 +0000)]
[cmake] Add linker detection for Apple platforms

LLVM currently assumes that Apple platforms will always use ld64. In the
future, LLD Mach-O might also be supported, so add the beginnings of
linker detection support. ld64 is currently the only detected linker,
since `ld64.lld -v` doesn't yield any useful version output, but we can
add that detection later, and in the meantime it's still useful to have
the ld64 identification.

Switch clang's order file check to use this new detection rather than
just checking for the presence of an ld64 executable.

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

llvm-svn: 334780

6 years ago[compiler-rt] [builtins] Don't build __atomic_* by default.
Eli Friedman [Thu, 14 Jun 2018 23:22:53 +0000 (23:22 +0000)]
[compiler-rt] [builtins] Don't build __atomic_* by default.

The locks need to be implemented in a shared library to work correctly,
so they shouldn't be part of libclang_rt.builtins.a, except in
specialized scenarios where the user can prove it will only be linked
once.

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

llvm-svn: 334779

6 years agoModules: Fix implicit output file for .cppm to .pcm instead of stdout
David Blaikie [Thu, 14 Jun 2018 23:09:06 +0000 (23:09 +0000)]
Modules: Fix implicit output file for .cppm to .pcm instead of stdout

This code was introduced back in r178148, a change to introduce
-module-file-info - which still exists & seems like it's still tested (&
this change didn't cause any of those tests to fail).

It doesn't look like this change was necessary there - since it's about
pcm output, whereas -module-file-info looks like it's for pcm /input/.
So I'm not really sure what the original motivation was.

I'm open to ideas though, if it turns out the original change was
necessary/useful.

llvm-svn: 334778

6 years agoMake uitofp and sitofp defined on overflow.
Eli Friedman [Thu, 14 Jun 2018 22:58:48 +0000 (22:58 +0000)]
Make uitofp and sitofp defined on overflow.

IEEE 754 defines the expected result on overflow. As far as I know,
hardware implementations (of f16), and compiler-rt (__floatuntisf)
correctly return +-Inf on overflow. And I can't think of any useful
transform that would take advantage of overflow being undefined here.

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

llvm-svn: 334777

6 years ago[libFuzzer] [NFC] XFAIL one of the tests on iOS.
George Karpenkov [Thu, 14 Jun 2018 22:18:18 +0000 (22:18 +0000)]
[libFuzzer] [NFC] XFAIL one of the tests on iOS.

llvm-svn: 334775

6 years ago[libFuzzer] [NFC] Remaining minor fixes to support testing on devices.
George Karpenkov [Thu, 14 Jun 2018 22:13:36 +0000 (22:13 +0000)]
[libFuzzer] [NFC] Remaining minor fixes to support testing on devices.

XFAIL's and adding %run commands.

llvm-svn: 334774

6 years ago[X86] Rename __builtin_ia32_pslldqi128 to __builtin_ia32_pslldqi128_byteshift and...
Craig Topper [Thu, 14 Jun 2018 22:02:35 +0000 (22:02 +0000)]
[X86] Rename __builtin_ia32_pslldqi128 to __builtin_ia32_pslldqi128_byteshift and similar for other sizes. Remove the multiply by 8 from the header files.

The previous names took the shift amount in bits to match gcc and required a multiply by 8 in the header. This creates a misleading error message when we check the range of the immediate to the builtin since the allowed range also got multiplied by 8.

This commit changes the builtins to use a byte shift amount to match the underlying instruction and the Intel intrinsic.

Fixes the remaining issue from PR37795.

llvm-svn: 334773

6 years agoAdd an entitlement to debugserver
Frederic Riss [Thu, 14 Jun 2018 21:17:59 +0000 (21:17 +0000)]
Add an entitlement to debugserver

On macOS 10.14, debugserver needs to have an entitlement do be
allowed to debug processes. Adding this to both the Xcode and
cmake build system. This shouldn't have any impact on previous
OSs.

llvm-svn: 334772

6 years ago[ORC] Strip weak flags from a symbol once it is selected for materialization.
Lang Hames [Thu, 14 Jun 2018 21:16:29 +0000 (21:16 +0000)]
[ORC] Strip weak flags from a symbol once it is selected for materialization.

Once a symbol has been selected for materialization it can no longer be
overridden. Stripping the weak flag guarantees this (override attempts will
then be treated as duplicate definitions and result in a DuplicateDefinition
error).

llvm-svn: 334771

6 years ago[llvm-mca] Clean up the header comment. NFC.
Matt Davis [Thu, 14 Jun 2018 20:58:54 +0000 (20:58 +0000)]
[llvm-mca] Clean up the header comment. NFC.

This change removes a few dashes to make room for the header syntax string.

llvm-svn: 334770

6 years agoeasing the constraint for isNegatibleForFree and GetNegatedExpression
Michael Berg [Thu, 14 Jun 2018 20:54:13 +0000 (20:54 +0000)]
easing the constraint for isNegatibleForFree and GetNegatedExpression

Summary:
Here we relax the old constraint which utilized unsafe with the TargetOption flag HonorSignDependentRoundingFPMathOption, with the assertion that unsafe is no longer needed or never was required for correctness on FDIV/FMUL.

Reviewers: spatel, hfinkel, wristow, arsenm, javed.absar

Reviewed By: spatel

Subscribers: efriedma, wdng, tpr

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

llvm-svn: 334769

6 years ago[libFuzzer] [NFC] Support multi-arch and multi-OS building and testing
George Karpenkov [Thu, 14 Jun 2018 20:46:07 +0000 (20:46 +0000)]
[libFuzzer] [NFC] Support multi-arch and multi-OS building and testing

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

llvm-svn: 334768

6 years agoRevert r334764, as it breaks some bots
Florian Hahn [Thu, 14 Jun 2018 20:32:58 +0000 (20:32 +0000)]
Revert r334764, as it breaks some bots

llvm-svn: 334767

6 years ago[libFuzzer] [NFC] Generalize DSO tests to work even when files are moved.
George Karpenkov [Thu, 14 Jun 2018 20:30:04 +0000 (20:30 +0000)]
[libFuzzer] [NFC] Generalize DSO tests to work even when files are moved.

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

llvm-svn: 334766

6 years ago[NFC] Generalize flags for linking in shared objects in compiler-rt tests to support...
George Karpenkov [Thu, 14 Jun 2018 20:29:47 +0000 (20:29 +0000)]
[NFC] Generalize flags for linking in shared objects in compiler-rt tests to support using multiple shared objects at once

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

llvm-svn: 334765

6 years ago[TableGen] Make TreePatternNode::getChild return a reference (NFC)
Florian Hahn [Thu, 14 Jun 2018 20:23:48 +0000 (20:23 +0000)]
[TableGen] Make TreePatternNode::getChild return a reference (NFC)

The return value of TreePatternNode::getChild is never null. This patch also
updates various places that use return values of getChild to also use
references. Those changes were suggested post-commit for D47463.

llvm-svn: 334764

6 years ago[c++17] If a class inherits virtual functions from a base class, it is
Richard Smith [Thu, 14 Jun 2018 20:03:22 +0000 (20:03 +0000)]
[c++17] If a class inherits virtual functions from a base class, it is
not an aggregtae.

llvm-svn: 334763

6 years agoFix wasm responsefile lld test on Windows
Reid Kleckner [Thu, 14 Jun 2018 19:59:22 +0000 (19:59 +0000)]
Fix wasm responsefile lld test on Windows

llvm-svn: 334762

6 years ago[COFF] Fix /wholearchive: to do libpath search again
Reid Kleckner [Thu, 14 Jun 2018 19:56:03 +0000 (19:56 +0000)]
[COFF] Fix /wholearchive: to do libpath search again

Fixes https://crbug.com/852882

llvm-svn: 334761

6 years ago[MSSA] Print more optimization information
George Burgess IV [Thu, 14 Jun 2018 19:55:53 +0000 (19:55 +0000)]
[MSSA] Print more optimization information

In particular, when asked to print a MemoryAccess, we'll now print where
defs are optimized to, and we'll print optimized access types.

This patch also introduces an operator<< to make printing AliasResults
easier.

Patch by Juneyoung Lee!

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

llvm-svn: 334760

6 years ago[x86] be more selective about converting 'and' to shuffle (PR37749)
Sanjay Patel [Thu, 14 Jun 2018 19:55:02 +0000 (19:55 +0000)]
[x86] be more selective about converting 'and' to shuffle (PR37749)

isVectorClearMaskLegal() is the TLI hook used by the generic
DAGCombiner::XformToShuffleWithZero().

We've grown to accomodate/expect this transform to shuffle
(disabling it more generally results in many regressions).
So I'm narrowly excluding the 256-bit types that clearly
are not worthwhile for AVX1.

I think in most cases we are able to recover by converting
the shuffle back into 'and' ops, but the cases in:
https://bugs.llvm.org/show_bug.cgi?id=37749
...show that there are cracks.

llvm-svn: 334759