platform/upstream/llvm.git
6 years agoRevert "[DebugInfo][FastISel] Fix dropping dbg.value()"
Sander de Smalen [Thu, 22 Feb 2018 19:53:59 +0000 (19:53 +0000)]
Revert "[DebugInfo][FastISel] Fix dropping dbg.value()"

This patch reverts r325440 and r325438 because it triggers an
assertion in SelectionDAGBuilder.cpp. Also having debug enabled
may unintentionally affect code-gen. The patch is reverted until
we find a better solution.

llvm-svn: 325825

6 years ago[PDB] Implement more find methods for PDB symbols
Aaron Smith [Thu, 22 Feb 2018 19:47:43 +0000 (19:47 +0000)]
[PDB] Implement more find methods for PDB symbols

Summary:
Add additional find methods on PDB raw symbols.

findChildrenByAddr()
findChildrenByVA()
findInlineFramesByAddr()
findInlineFramesByVA()
findInlineLines()
findInlineLinesByAddr()
findInlineLinesByRVA()
findInlineLinesByVA()

Reviewers: zturner, llvm-commits

Reviewed By: zturner

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

llvm-svn: 325824

6 years ago[ThinLTO] Represent relative BF using a scaled representation .
Easwaran Raman [Thu, 22 Feb 2018 19:44:08 +0000 (19:44 +0000)]
[ThinLTO] Represent relative BF using a scaled representation .

Summary:
The current integer representation of relative block frequency prevents
representing relative block frequencies below 1. This change uses a 8 of
the 29 bits to represent the decimal part by using a fixed scale of -8.

Reviewers: tejohnson, davidxl

Subscribers: mehdi_amini, inglorion, llvm-commits

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

llvm-svn: 325823

6 years ago[OpenMP] Limit reduction support for pragma 'distribute' when combined with pragma...
Carlo Bertolli [Thu, 22 Feb 2018 19:38:14 +0000 (19:38 +0000)]
[OpenMP] Limit reduction support for pragma 'distribute' when combined with pragma 'simd'

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

This is a bug fix that removes the emission of reduction support for pragma 'distribute' when found alone or in combinations without simd.
Pragma 'distribute' does not have a reduction clause, but when combined with pragma 'simd' we need to emit the support for simd's reduction clause as part of code generation for distribute. This guard is similar to the one used for reduction support earlier in the same code gen function.

llvm-svn: 325822

6 years agoUpdate lld documentation to mention PDB support.
Zachary Turner [Thu, 22 Feb 2018 19:12:57 +0000 (19:12 +0000)]
Update lld documentation to mention PDB support.

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

llvm-svn: 325821

6 years agoFix DataFlowSanitizer instrumentation pass to take parameter position changes into...
Peter Collingbourne [Thu, 22 Feb 2018 19:09:07 +0000 (19:09 +0000)]
Fix DataFlowSanitizer instrumentation pass to take parameter position changes into account for custom functions.

When DataFlowSanitizer transforms a call to a custom function, the
new call has extra parameters. The attributes on parameters must be
updated to take the new position of each parameter into account.

Patch by Sam Kerner!

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

llvm-svn: 325820

6 years ago[ThinLTO] Always create linked objects file for --thinlto-index-only=
Vitaly Buka [Thu, 22 Feb 2018 19:06:15 +0000 (19:06 +0000)]
[ThinLTO] Always create linked objects file for --thinlto-index-only=

Summary:
ThinLTO indexing may decide to skip all objects. If we don't write something to
the list build system may consider this as failure or linker can reuse a file
from the previews build.

Reviewers: pcc, tejohnson

Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits

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

llvm-svn: 325819

6 years ago[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on...
Vitaly Buka [Thu, 22 Feb 2018 19:06:05 +0000 (19:06 +0000)]
[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on the stack

Reviewers: tejohnson, pcc

Subscribers: inglorion, llvm-commits

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

llvm-svn: 325818

6 years ago[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.
Matt Morehouse [Thu, 22 Feb 2018 19:00:17 +0000 (19:00 +0000)]
[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 325817

6 years ago[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separ...
Daniel Neilson [Thu, 22 Feb 2018 18:55:59 +0000 (18:55 +0000)]
[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separately

Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
AlignmentFromAssumptions pass to cease using the old getAlignment()/setAlignment API of
MemoryIntrinsic in favour of getting/setting source & dest specific alignments through
the new API. This allows us to simplify some of the code in this pass and also be more
aggressive about setting the source and destination alignments separately.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

Reviewers: hfinkel, bollu, reames

Reviewed By: reames

Subscribers: reames, llvm-commits

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

llvm-svn: 325816

6 years ago[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h
Simon Pilgrim [Thu, 22 Feb 2018 18:45:13 +0000 (18:45 +0000)]
[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h

This allows us to improve vector constant matching in more DAG code (backends, TargetLowering etc.).

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

llvm-svn: 325815

6 years ago[CUDA] Added missing functions.
Artem Belevich [Thu, 22 Feb 2018 18:40:52 +0000 (18:40 +0000)]
[CUDA] Added missing functions.

Initial commit missed sincos(float), llabs() and few atomics that we
used to pull in from device_functions.hpp, which we no longer include.

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

llvm-svn: 325814

6 years ago[clangd] Extend textDocument/didChange to specify whether diagnostics should be gener...
Eric Liu [Thu, 22 Feb 2018 18:40:39 +0000 (18:40 +0000)]
[clangd] Extend textDocument/didChange to specify whether diagnostics should be generated.

Summary:
This would allow us to disable diagnostics when didChange is called but
diagnostics are not wanted (e.g. code completion).

Reviewers: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 325813

6 years ago[OPENMP] Require valid SourceLocation in function call, NFC.
Alexey Bataev [Thu, 22 Feb 2018 18:33:31 +0000 (18:33 +0000)]
[OPENMP] Require valid SourceLocation in function call, NFC.

Removed default empty SourceLocation argument from `emitCall` function
and require valid location.

llvm-svn: 325812

6 years ago[MC] Don't crash on modulo by zero (PR35650)
Simon Pilgrim [Thu, 22 Feb 2018 18:06:48 +0000 (18:06 +0000)]
[MC] Don't crash on modulo by zero (PR35650)

Extension to D12776, handle modulo by zero in the same way we handle divide by zero.

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

llvm-svn: 325810

6 years ago[ELF] - Rewrote outdated comment. NFC.
George Rimar [Thu, 22 Feb 2018 17:52:43 +0000 (17:52 +0000)]
[ELF] - Rewrote outdated comment. NFC.

llvm-svn: 325809

6 years ago[IRBuilder] add creators for FP with FMF; NFCI
Sanjay Patel [Thu, 22 Feb 2018 17:33:20 +0000 (17:33 +0000)]
[IRBuilder] add creators for FP with FMF; NFCI

Also, add a helper for the constant folder to reduce duplication.

It seems out-of-place for and/or to be doing simplifications here?
Otherwise, I could have used the helper on those opcodes too.

llvm-svn: 325808

6 years ago[docs] Regenerate command line reference
Jonas Hahnfeld [Thu, 22 Feb 2018 17:10:28 +0000 (17:10 +0000)]
[docs] Regenerate command line reference

llvm-svn: 325807

6 years ago[docs] Improve help for OpenMP options, NFC.
Jonas Hahnfeld [Thu, 22 Feb 2018 17:06:35 +0000 (17:06 +0000)]
[docs] Improve help for OpenMP options, NFC.

 * Add HelpText for -fopenmp so that it appears in clang --help.
 * Hide -fno-openmp-simd, only list the positive option.
 * Hide -fopenmp-relocatable-target and -fopenmp-use-tls from
   clang --help and from ClangCommandLineReference.
 * Improve MetaVarName for -Xopenmp-target=<...>.

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

llvm-svn: 325806

6 years ago[docs] Fix duplicate arguments for JoinedAndSeparate
Jonas Hahnfeld [Thu, 22 Feb 2018 17:06:27 +0000 (17:06 +0000)]
[docs] Fix duplicate arguments for JoinedAndSeparate

We can't see how many arguments are in the meta var name, so just
assume that it is the right number.

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

llvm-svn: 325805

6 years ago[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441
Simon Pilgrim [Thu, 22 Feb 2018 16:29:08 +0000 (16:29 +0000)]
[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441

llvm-svn: 325804

6 years ago[DEBUGINFO] Do not output labels for empty macinfo sections.
Alexey Bataev [Thu, 22 Feb 2018 16:20:30 +0000 (16:20 +0000)]
[DEBUGINFO] Do not output labels for empty macinfo sections.

Summary:
If there is no debug info for macros, do not emit labels for empty
macinfo sections.

Reviewers: probinson, echristo

Subscribers: aprantl, llvm-commits, JDevlieghere

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

llvm-svn: 325803

6 years agoFix "not all control paths return a value" MSVC warning. NFCI.
Simon Pilgrim [Thu, 22 Feb 2018 16:12:27 +0000 (16:12 +0000)]
Fix "not all control paths return a value" MSVC warning. NFCI.

llvm-svn: 325802

6 years ago[clangd] fix test use-after-free from r325774
Sam McCall [Thu, 22 Feb 2018 15:33:33 +0000 (15:33 +0000)]
[clangd] fix test use-after-free from r325774

llvm-svn: 325801

6 years agoTableGen: Add strict assertions to sanity check earlier type checking
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:12 +0000 (15:27 +0000)]
TableGen: Add strict assertions to sanity check earlier type checking

Summary:
Both of these errors should have been caught by type-checking during
parsing.

Change-Id: I891087936fd1a91d21bcda57c256e3edbe12b94d

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325800

6 years agoTableGen: Allow implicit casting between string and code
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:03 +0000 (15:27 +0000)]
TableGen: Allow implicit casting between string and code

Summary:
Perhaps the distinction between the two should be removed entirely
in the long term, and the [{ ... }] syntax should just be a convenient
way of writing multi-line strings.

In the meantime, a lot of existing .td files are quite relaxed about
string vs. code, and this change allows switching on more consistent
type checks without breaking those.

Change-Id: If85e3e04469e41b58e2703b62ac0032d2711713c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325799

6 years agoTableGen: Fix type of resolved and converted lists
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:45 +0000 (15:26 +0000)]
TableGen: Fix type of resolved and converted lists

Summary:
There are no new test cases, but a subsequent patch will introduce
assertions that would be triggered by existing test cases without this
fix.

Change-Id: I6a82d4b311b012aff3932978ae86f6a2dcfbf725

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325798

6 years agoTableGen: Fix type deduction for !foreach
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:35 +0000 (15:26 +0000)]
TableGen: Fix type deduction for !foreach

Summary:
In the case of !foreach(id, input-list, transform) where the type of
input-list is list<A> and the type of transform is B, we now correctly
deduce list<B> as the type of the !foreach.

Change-Id: Ia19dd65eecc5991dd648280ba6a15f6a20fd61de

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325797

6 years agoTableGen: Generalize type deduction for !listconcat
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:28 +0000 (15:26 +0000)]
TableGen: Generalize type deduction for !listconcat

Summary:
This way, it should work even with complex operands.

Change-Id: Iaccf5bbb50bd5882a0ba5d59689e4381315fb361

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325796

6 years agoTableGen: Add some more helpful error messages
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:21 +0000 (15:26 +0000)]
TableGen: Add some more helpful error messages

Summary: Some fairly simple changes to start with.

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

Change-Id: I0c92731b36d309c6edfcae42595ae1a70cc051c9
llvm-svn: 325795

6 years agoAMDGPU: Stop using .NAME in .td files
Nicolai Haehnle [Thu, 22 Feb 2018 15:25:11 +0000 (15:25 +0000)]
AMDGPU: Stop using .NAME in .td files

Summary:
.NAME is a bit of an odd duck, in that we should really treat it like
a template argument, but we currently don't, and so when and where
NAME is initialized and how is pretty inconsistent. Best to just avoid
using it as a field of already instantiated records, and use cast to
string instead.

Change-Id: I5a0c202401cede3d5c3827ab9c7858ea48b29108

Reviewers: arsenm, rampitec

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

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

llvm-svn: 325794

6 years ago[RISCV] Implement c.lui immediate operand constraint
Shiva Chen [Thu, 22 Feb 2018 15:02:28 +0000 (15:02 +0000)]
[RISCV] Implement c.lui immediate operand constraint

Implement c.lui immediate constraint to [1, 31] and [0xfffe0, 0xfffff].
The RISC-V ISA describes the constraint as [1, 63], with that value
being loaded in to bits 17-12 of the destination register and sign extended
from bit 17. Therefore, this 6-bit immediate can represent values in the
ranges [1, 31] and [0xfffe0, 0xfffff].

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

llvm-svn: 325792

6 years ago[FunctionAttrs][ArgumentPromotion][GlobalOpt] Disable some optimisations passes for...
Luke Cheeseman [Thu, 22 Feb 2018 14:42:08 +0000 (14:42 +0000)]
[FunctionAttrs][ArgumentPromotion][GlobalOpt] Disable some optimisations passes for naked functions

- Fix for bug 36078.
- Prevent the functionattrs, function-attrs, globalopt and argpromotion passes
  from changing naked functions.
- These passes can perform some alterations to the functions that should not be
  applied. An example is removing parameters that are seemingly not used because
  they are only referenced in the inline assembly. Another example is marking
  the function as fastcc.

llvm-svn: 325788

6 years ago[InstCombine] add fmul multi-use test; NFC
Sanjay Patel [Thu, 22 Feb 2018 14:27:16 +0000 (14:27 +0000)]
[InstCombine] add fmul multi-use test; NFC

Also, rename tests to make their intent clearer.

llvm-svn: 325785

6 years ago[clangd] DidChangeConfiguration Notification
Simon Marchi [Thu, 22 Feb 2018 14:00:39 +0000 (14:00 +0000)]
[clangd] DidChangeConfiguration Notification

Summary:

Implementation of DidChangeConfiguration notification handling in
clangd.  This currently only supports changing one setting: the path of
the compilation database to be used for the current project.   In other
words, it is no longer necessary to restart clangd with a different
command line argument in order to change the compilation database.

Reviewers: malaperle, krasimir, bkramer, ilya-biryukov

Subscribers: jkorous-apple, ioeric, simark, klimek, ilya-biryukov, arphaman, rwols, cfe-commits

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

Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
Signed-off-by: William Enright <william.enright@polymtl.ca>
llvm-svn: 325784

6 years ago[mips] Generate memory dependencies for byVal arguments
Stefan Maksimovic [Thu, 22 Feb 2018 13:40:42 +0000 (13:40 +0000)]
[mips] Generate memory dependencies for byVal arguments

There were no memory dependencies made between stores generated
when lowering formal arguments and loads generated when
call lowering byVal arguments which made the Post-RA scheduler
place a load before a matching store.

Make the fixed object stored to mutable so that the load
instructions can have their memory dependencies added

Set the frame object as isAliased which clears the underlying
objects vector in ScheduleDAGInstrs::buildSchedGraph().
This results in addition of all stores as dependenies for loads.

This problem appeared when passing a byVal parameter
coupled with a fastcc function call.

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

llvm-svn: 325782

6 years ago[clangd] Correct setting ignoreWarnings in CodeCompletion.
Haojian Wu [Thu, 22 Feb 2018 13:35:01 +0000 (13:35 +0000)]
[clangd] Correct setting ignoreWarnings in CodeCompletion.

Summary:
We should set the flag before creating ComplierInstance -- when
CopmilerInstance gets initialized, it also initializes the DiagnosticsEngine
using the DiagnosticOptions.

This was hidden deeply -- as clang suppresses all diagnostics when we
hit the code-completion (but internally it does do unnecessary analysis stuff).

As a bonus point, this fix will optmize the completion speed -- clang won't do
any analysis (e.g. -Wunreachable-code, -Wthread-safety-analysisi) at all internally.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 325779

6 years agoSyndicate duplicate code between CallInst and InvokeInst
Serge Guelton [Thu, 22 Feb 2018 13:30:32 +0000 (13:30 +0000)]
Syndicate duplicate code between CallInst and InvokeInst

NFC intended, syndicate common code to a parametric base class. Part of the original problem is that InvokeInst is a TerminatorInst, unlike CallInst. the problem is solved by introducing a parametrized class paramtertized by its base.

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

llvm-svn: 325778

6 years agoFix Wdocumentation warning - remove param tag for old argument
Simon Pilgrim [Thu, 22 Feb 2018 13:28:42 +0000 (13:28 +0000)]
Fix Wdocumentation warning - remove param tag for old argument

llvm-svn: 325777

6 years ago[RISCV][NFC] Make logic in RISCVMCCodeEmitter::getImmOpValue more defensive
Alex Bradbury [Thu, 22 Feb 2018 13:24:25 +0000 (13:24 +0000)]
[RISCV][NFC] Make logic in RISCVMCCodeEmitter::getImmOpValue more defensive

As pointed out by @sabuasal in a comment on D23568, the logic in
RISCVMCCodeEmitter::getImmOpValue could be more defensive. Although with the
current instruction definitions it is always the case that `VK_RISCV_LO` is
always used with either an I- or S-format instruction, this may not always be
the case in the future. Add a check to ensure we will get an assertion in
debug builds if that changes.

llvm-svn: 325775

6 years ago[clangd] Allow embedders some control over when diagnostics are generated.
Sam McCall [Thu, 22 Feb 2018 13:11:12 +0000 (13:11 +0000)]
[clangd] Allow embedders some control over when diagnostics are generated.

Summary:
Through the C++ API, we support for a given snapshot version:
 - Yes: make sure we generate diagnostics for exactly this version
 - Auto: generate eventually-consistent diagnostics for at least this version
 - No: don't generate diagnostics for this version
Eventually auto should be debounced for better UX.

Through LSP, we force diagnostics for initial load (bypassing future debouncing)
and all updates follow the "auto" policy.

This is complicated to implement under the CancellationFlag design, so
rewrote that part to just inspect the queue instead.

It turns out we never pass None to the diagnostics callback, so remove Optional
from the signature. The questionable behavior of not invoking the callback at
all if CppFile::rebuild fails is not changed.

Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 325774

6 years ago[SLPVectorizer][X86] Add load extend tests (PR36091)
Simon Pilgrim [Thu, 22 Feb 2018 12:19:34 +0000 (12:19 +0000)]
[SLPVectorizer][X86] Add load extend tests (PR36091)

llvm-svn: 325772

6 years ago[OpenCL] Add '-cl-uniform-work-group-size' compile option
Alexey Sotkin [Thu, 22 Feb 2018 11:54:14 +0000 (11:54 +0000)]
[OpenCL] Add '-cl-uniform-work-group-size' compile option

Summary:
OpenCL 2.0 specification defines '-cl-uniform-work-group-size' option,
which requires that the global work-size be a multiple of the work-group
size specified to clEnqueueNDRangeKernel and allows optimizations that
are made possible by this restriction.

The patch introduces the support of this option.

To keep information about whether an OpenCL kernel has uniform work
group size or not, clang generates 'uniform-work-group-size' function
attribute for every kernel:
- "uniform-work-group-size"="true" for OpenCL 1.2 and lower,
- "uniform-work-group-size"="true" for OpenCL 2.0 and higher if
 '-cl-uniform-work-group-size' option was specified,
- "uniform-work-group-size"="false" for OpenCL 2.0 and higher if no
 '-cl-uniform-work-group-size' options was specified.

If the function is not an OpenCL kernel, 'uniform-work-group-size'
attribute isn't generated.

Patch by: krisb

Reviewers: yaxunl, Anastasia, b-sumner

Reviewed By: yaxunl, Anastasia

Subscribers: nhaehnle, yaxunl, Anastasia, cfe-commits

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

llvm-svn: 325771

6 years ago[mips] Regenerate tests for D38128 (NFC)
Simon Dardis [Thu, 22 Feb 2018 11:53:01 +0000 (11:53 +0000)]
[mips] Regenerate tests for D38128 (NFC)

llvm-svn: 325770

6 years ago[dsymutil] Remove \brief from comments. NFC
Jonas Devlieghere [Thu, 22 Feb 2018 11:43:43 +0000 (11:43 +0000)]
[dsymutil] Remove \brief from comments. NFC

With autobrief enabled, these server no purpose anymore. Most of them
were already removed but this makes everything consistent.

llvm-svn: 325769

6 years ago[dsymutil] Fix typos and formatting. NFC.
Jonas Devlieghere [Thu, 22 Feb 2018 11:32:51 +0000 (11:32 +0000)]
[dsymutil] Fix typos and formatting. NFC.

Some over-due gardening: this fixes a bunch of typos and makes the
formatting consistent with LLVM's style guide.

llvm-svn: 325768

6 years agoRecommit: [ARM] f16 constant pool fix
Sjoerd Meijer [Thu, 22 Feb 2018 10:43:57 +0000 (10:43 +0000)]
Recommit: [ARM] f16 constant pool fix

This recommits r325754; the modified and failing test case
actually didn't need any modifications.

llvm-svn: 325765

6 years ago[clangd] Not collect include headers for dynamic index for now.
Eric Liu [Thu, 22 Feb 2018 10:14:05 +0000 (10:14 +0000)]
[clangd] Not collect include headers for dynamic index for now.

Summary:
The new behaviors introduced by this patch:
o When include collection is enabled, we always set IncludeHeader field in Symbol
even if it's the same as FileURI in decl.
o Disable include collection in FileIndex which is currently only used to build
dynamic index. We should revisit when we actually want to use FileIndex to global
index.
o Code-completion only uses IncludeHeader to insert headers but not FileURI in
CanonicalDeclaration. This ensures that inserted headers are always canonicalized.
Note that include insertion can still be triggered for symbols that are already
included if they are merged from dynamic index and static index, but we would
only use includes that are already canonicalized (e.g. from static index).

Reason for change:
Collecting header includes in dynamic index enables inserting includes for headers
that are not indexed but opened in the editor. Comparing to inserting includes for
symbols in global/static index, this is nice-to-have but would probably require
non-trivial amount of work to get right. For example:
o Currently it's not easy to fully support CanonicalIncludes in dynamic index, given the way
we run dynamic index.
o It's also harder to reason about the correctness of include canonicalization for dynamic index
(i.e. symbols in the current file/TU) than static index where symbols are collected
offline and sanity check is possible before shipping to production.
o We have less control/flexibility over symbol info in the dynamic index
(e.g. URIs, path normalization), which could be used to help make decision when inserting includes.

As header collection (especially canonicalization) is relatively new, and enabling
it for dynamic index would immediately affect current users with only dynamic
index support, I propose we disable it for dynamic index for now to avoid
compromising other hot features like code completion and only support it for
static index where include insertion would likely to bring more value.

Reviewers: ilya-biryukov, sammccall, hokein

Subscribers: klimek, jkorous-apple, cfe-commits

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

llvm-svn: 325764

6 years ago[ELF] - Introduce getInputSections() helper.
George Rimar [Thu, 22 Feb 2018 09:55:28 +0000 (09:55 +0000)]
[ELF] - Introduce getInputSections() helper.

We sometimes need to iterate over input sections for a given
output section. It is not very convinent because we have to iterate
over section descriptions.
Patch introduces getInputSections helper, it simplifies things.

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

llvm-svn: 325763

6 years ago[dsymutil] Replace PATH_MAX in SmallString with fixed value.
Jonas Devlieghere [Thu, 22 Feb 2018 09:42:10 +0000 (09:42 +0000)]
[dsymutil] Replace PATH_MAX in SmallString with fixed value.

Apparently the Windows bots don't know this define, so just going with a
sensible default.

Failing builds:
  http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/19179
  http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/19263

llvm-svn: 325762

6 years ago[ARM] Fix issue with large xor constants.
David Green [Thu, 22 Feb 2018 09:38:57 +0000 (09:38 +0000)]
[ARM] Fix issue with large xor constants.

Fixup to rL325573 for large xor constants.

Thanks to Eli Friedman for the catch.

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

llvm-svn: 325761

6 years ago[libcxx] Do not include the C math.h header before __config
Mikhail Maltsev [Thu, 22 Feb 2018 09:34:08 +0000 (09:34 +0000)]
[libcxx] Do not include the C math.h header before __config

Summary:
Certain C libraries require configuration macros defined in __config
to provide the correct functionality for libc++. This patch ensures
that the C header math.h is always included after the __config
header. It also adds a Windows-specific #if guard for the case when
the C math.h file is included the second time, as suggested by
Marshall in https://reviews.llvm.org/rL323490.

Fixes PR36382.

Reviewers: mclow.lists, EricWF

Reviewed By: mclow.lists

Subscribers: cfe-commits, pcc, christof, rogfer01

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

llvm-svn: 325760

6 years ago[dsymutil] Be smarter in caching calls to realpath
Jonas Devlieghere [Thu, 22 Feb 2018 09:20:40 +0000 (09:20 +0000)]
[dsymutil] Be smarter in caching calls to realpath

Calling realpath is expensive but necessary to perform the uniqueing in
dsymutil. Although we already cached the results for every individual
file in the line table, we had reports of it taking 40 seconds of a 3.5
minute link.

This patch adds a second level of caching. When we do have to call
realpath, we cache its result for its parents path. We didn't replace
the existing caching, because it's fast (indexed) and saves us from
reading the line table for entries we've already seen.

For WebkitCore this results in a decrease of 11% in linking time: from
85.79 to 76.11 seconds (average over 3 runs).

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

llvm-svn: 325757

6 years agoRevert r325754 and r325755 (f16 literal pool) because buildbots were unhappy.
Sjoerd Meijer [Thu, 22 Feb 2018 08:41:55 +0000 (08:41 +0000)]
Revert r325754 and r325755 (f16 literal pool) because buildbots were unhappy.

llvm-svn: 325756

6 years agoAdded a test that I forgot to svn add in my previous commit r325754.
Sjoerd Meijer [Thu, 22 Feb 2018 08:20:50 +0000 (08:20 +0000)]
Added a test that I forgot to svn add in my previous commit r325754.

llvm-svn: 325755

6 years ago[ARM] f16 constant pool fix
Sjoerd Meijer [Thu, 22 Feb 2018 08:16:05 +0000 (08:16 +0000)]
[ARM] f16 constant pool fix

This is a follow up of r325012, that allowed half types in constant pools.
Proper alignment was enforced when a big basic block was split up, but not when
a CPE was placed before/after a block; the successor block had the wrong
alignment.

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

llvm-svn: 325754

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Thu, 22 Feb 2018 07:49:13 +0000 (07:49 +0000)]
[NFC] fix trivial typos in comments

"a a"->"a"

llvm-svn: 325753

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Thu, 22 Feb 2018 07:48:29 +0000 (07:48 +0000)]
[NFC] fix trivial typos in comments

"a a" -> "a"

llvm-svn: 325752

6 years agoTry to fix the syntax in test
Kamil Rytarowski [Thu, 22 Feb 2018 07:17:01 +0000 (07:17 +0000)]
Try to fix the syntax in test

Reported on a buildbot:

Error in XFAIL list:
couldn't parse text: '| arm || aarch64 || mips'
in expression: 'freebsd | arm || aarch64 || mips'

Add || in the place of |

Fallout from D43382

llvm-svn: 325751

6 years ago[DAGCombiner] Add two calls to isVector before making calls to getVectorElementType...
Craig Topper [Thu, 22 Feb 2018 07:05:27 +0000 (07:05 +0000)]
[DAGCombiner] Add two calls to isVector before making calls to getVectorElementType/getVectorNumElements to avoid an assert.

We looked through a BITCAST, but the bitcast might be a from a scalar type rather than a vector.

I don't have a test case. I stumbled onto it while prototyping another change that isn't ready yet.

llvm-svn: 325750

6 years agoRevert part of D43378 in this file
Kamil Rytarowski [Thu, 22 Feb 2018 07:00:29 +0000 (07:00 +0000)]
Revert part of D43378 in this file

It causes failure on clang-x86_64-debian-fast.

llvm-svn: 325749

6 years agoRevert part of r. 325746 D43378
Kamil Rytarowski [Thu, 22 Feb 2018 06:48:34 +0000 (06:48 +0000)]
Revert part of r. 325746 D43378

test/Driver/XRay/xray-shared-noxray.cpp fails on !Linux hosts.

llvm-svn: 325748

6 years ago[SampleProf] NFC. Expose reusable functionality in SampleProfile.
Mircea Trofin [Thu, 22 Feb 2018 06:42:57 +0000 (06:42 +0000)]
[SampleProf] NFC. Expose reusable functionality in SampleProfile.

Summary:
Exposing getOffset and findFunctionSamples as members of
SampleProfile. They are intimately tied to design choices of the
sample profile format - using offsets instead of line numbers, and
traversing inlined functions stack, respectively.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

llvm-svn: 325747

6 years agoFreeBSD driver / Xray flags moving pthread to compile flags.
Kamil Rytarowski [Thu, 22 Feb 2018 06:31:40 +0000 (06:31 +0000)]
FreeBSD driver / Xray flags moving pthread to compile flags.

Summary:
- Using -lpthread instead, with -pthread the linkage does not work.
-Warning about the -fxray-instrument usage outside of the working cases.

Patch by: David CARLIER

Reviewers: krytarowski, vitalybuka, dberris, emaste

Reviewed By: krytarowski, emaste

Subscribers: srhines, emaste, cfe-commits

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

llvm-svn: 325746

6 years ago[SCEV][NFC] Factor out common logic into a separate method
Max Kazantsev [Thu, 22 Feb 2018 06:27:32 +0000 (06:27 +0000)]
[SCEV][NFC] Factor out common logic into a separate method

SCEV has multiple occurences of code when we need to prove some predicate on
every iteration of a loop and do it with invocations of couple `isLoopEntryGuardedByCond`,
`isLoopBackedgeGuardedByCond`. This patch factors out these two calls into a separate
method. It is a preparation step to extend this logic: it is not the only way how we can prove
such conditions.

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

llvm-svn: 325745

6 years agoRemove empty files
Kamil Rytarowski [Thu, 22 Feb 2018 06:11:28 +0000 (06:11 +0000)]
Remove empty files

Left over after D43382

llvm-svn: 325744

6 years agoXray instrumentation / enabling more tests
Kamil Rytarowski [Thu, 22 Feb 2018 06:08:26 +0000 (06:08 +0000)]
Xray instrumentation / enabling more tests

Summary:
The Unix subdirectory mostly allows only on Linux x86_64 but now we can target x86_64 arch in general.

Patch by David CARLIER

Reviewers: krytarowski, dberris, emaste

Reviewed By: krytarowski, dberris, emaste

Subscribers: emaste, llvm-commits, #sanitizers

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

llvm-svn: 325743

6 years ago[ODRHash] Fix hashing for friend functions.
Richard Trieu [Thu, 22 Feb 2018 05:50:29 +0000 (05:50 +0000)]
[ODRHash] Fix hashing for friend functions.

When hashing a templated function, use the hash of the function it was
instantiated from.

llvm-svn: 325742

6 years ago[ODRHash] Handle some template weirdness.
Richard Trieu [Thu, 22 Feb 2018 05:32:25 +0000 (05:32 +0000)]
[ODRHash] Handle some template weirdness.

Build the index off of DeclarationName instead of Decl pointers.  When finding
an UnresolvedLookupExprClass, hash it as if it were a DeclRefExpr.  This will
allow methods to be hashed.

llvm-svn: 325741

6 years agoAdd another test case to the deduction guide for basic_string.
Marshall Clow [Thu, 22 Feb 2018 05:14:20 +0000 (05:14 +0000)]
Add another test case to the deduction guide for basic_string.

llvm-svn: 325740

6 years ago[PowerPC] Do not produce invalid CTR loop with an FRem
Nemanja Ivanovic [Thu, 22 Feb 2018 03:02:41 +0000 (03:02 +0000)]
[PowerPC] Do not produce invalid CTR loop with an FRem

An FRem instruction inside a loop should prevent the loop from being converted
into a CTR loop since this is not an operation that is legal on any PPC
subtarget. This will always be a call to a library function which means the
loop will be invalid if this instruction is in the body.

Fixes PR36292.

llvm-svn: 325739

6 years ago[Utils] Avoid a hash table lookup in salvageDI, NFC
Vedant Kumar [Thu, 22 Feb 2018 01:29:41 +0000 (01:29 +0000)]
[Utils] Avoid a hash table lookup in salvageDI, NFC

According to the current coverage report salvageDebugInfo() is called
5.12 million times during testing and almost always returns early.

The early return depends on LocalAsMetadata::getIfExists returning null,
which involves a DenseMap lookup in an LLVMContextImpl. We can probably
speed this up by simply checking the IsUsedByMD bit in Value.

llvm-svn: 325738

6 years ago[X86][MMX] Generlize MMX_MOVD64rr combines to accept v4i16/v8i8 build vectors as...
Simon Pilgrim [Wed, 21 Feb 2018 23:07:30 +0000 (23:07 +0000)]
[X86][MMX] Generlize MMX_MOVD64rr combines to accept v4i16/v8i8 build vectors as well as v2i32

Also handle both cases where the lower 32-bits of the MMX is undef or zero extended.

llvm-svn: 325736

6 years agobpf: disable DwarfUsesRelocationsAcrossSections
Yonghong Song [Wed, 21 Feb 2018 22:59:14 +0000 (22:59 +0000)]
bpf: disable DwarfUsesRelocationsAcrossSections

The pahole does not work with BPF backend properly:

  -bash-4.2$ cat test.c
  struct test_t {
    int a;
    int b;
  };
  int test(struct test_t *s) {
    return s->a;
  }
  -bash-4.2$ clang -g -O2 -target bpf -c test.c
  -bash-4.2$ pahole test.o
  struct clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) {
          clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /*     0     4 */
          clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /*     4     4 */

          /* size: 8, cachelines: 1, members: 2 */
          /* last cacheline: 8 bytes */
  };
  -bash-4.2$

The reason is that BPF backend is not yet implemented in elfutils backend
  https://github.com/threatstack/elfutils/tree/master/backends
and pahole depends on elfutils for dwarf parsing and resolving relocation.

More specifically, the unsupported relocation in .debug_info for type/member name
against symbol table caused the incorrect result above. The following is
the raw .rel.debug_info for the above example,
  Hex dump of section '.rel.debug_info':
    0x00000000 06000000 00000000 0a000000 0b000000 ................
    0x00000010 0c000000 00000000 0a000000 01000000 ................
    0x00000020 12000000 00000000 0a000000 02000000 ................
    0x00000030 16000000 00000000 0a000000 0e000000 ................
    0x00000040 1a000000 00000000 0a000000 03000000 ................
               ----------------- -------- --------
                reloc location     type   symtab index

  Hex dump of section '.debug_info':
    0x00000000 7b000000 04000000 00000801 00000000 {...............
    0x00000010 0c000000 00000000 00000000 00000000 ................
    0x00000020 00000000 00001000 00000200 00000000 ................

Based on "type", the proper value will be extracted from symbol table
and filled in .debug_info so later on .debug_info can be properly
resolved against debug strings.

There are two ways to fix this problem. One is to fix elfutils by adding
BPF support which is desirable. This could take a long time and won't work
with already deployed pahole. For a short term workaround, we can disable
dwarf cross-section relation which specifically avoids debug_info and
symbol table cross relocation. This should help any dwarf-related tool
which has not implement BPF specific relocations yet.

Now .rel.debug_info does not have any relocation for symbol table and
.debug_info itself contains necessary relocation information by itself.
  Hex dump of section '.debug_info':
    0x00000000 7b000000 04000000 00000801 00000000 {...............
    0x00000010 0c003700 00000000 00003e00 00000000 ..7.......>.....
    0x00000020 00000000 00001000 00000200 00000000 ................
  location 0xc has 0, 0x12 has 0x37, 0x1a has 0x3e in place which
  will be used in relocation resolution. Here, the values of 0, 0x37 and 0x3e
  are offset in .debug_str section.
Please note the difference between two above .debug_info dumps.

With the fix, pahole works properly with BPF backend:
  -bash-4.2$ clang -O2 -g -target bpf -c test.c
  -bash-4.2$ pahole test.o
  struct test_t {
          int                        a;                    /*     0     4 */
          int                        b;                    /*     4     4 */

          /* size: 8, cachelines: 1, members: 2 */
          /* last cacheline: 8 bytes */
  };

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

6 years ago[InstCombine] add some random FMF to tests so we know it's not dropped; NFC
Sanjay Patel [Wed, 21 Feb 2018 22:48:28 +0000 (22:48 +0000)]
[InstCombine] add some random FMF to tests so we know it's not dropped; NFC

llvm-svn: 325734

6 years ago[Driver] Generate .eh_frame_hdr for static executables too.
Dan Albert [Wed, 21 Feb 2018 22:36:51 +0000 (22:36 +0000)]
[Driver] Generate .eh_frame_hdr for static executables too.

Summary: libgcc won't unwind without an .eh_frame_hdr section.

Reviewers: srhines, chandlerc

Reviewed By: chandlerc

Subscribers: chandlerc, cfe-commits

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

llvm-svn: 325733

6 years agoResubmit r325107 (case folding DJB hash)
Pavel Labath [Wed, 21 Feb 2018 22:36:31 +0000 (22:36 +0000)]
Resubmit r325107 (case folding DJB hash)

The issue was that the has function was generating different results depending
on the signedness of char on the host platform. This commit fixes the issue by
explicitly using an unsigned char type to prevent sign extension and
adds some extra tests.

The original commit message was:

This patch implements a variant of the DJB hash function which folds the
input according to the algorithm in the Dwarf 5 specification (Section
6.1.1.4.5), which in turn references the Unicode Standard (Section 5.18,
"Case Mappings").

To achieve this, I have added a llvm::sys::unicode::foldCharSimple
function, which performs this mapping. The implementation of this
function was generated from the CaseMatching.txt file from the Unicode
spec using a python script (which is also included in this patch). The
script tries to optimize the function by coalescing adjecant mappings
with the same shift and stride (terms I made up). Theoretically, it
could be made a bit smarter and merge adjecant blocks that were
interrupted by only one or two characters with exceptional mapping, but
this would save only a couple of branches, while it would greatly
complicate the implementation, so I deemed it was not worth it.

Since we assume that the vast majority of the input characters will be
US-ASCII, the folding hash function has a fast-path for handling these,
and only whips out the full decode+fold+encode logic if we encounter a
character outside of this range. It might be possible to implement the
folding directly on utf8 sequences, but this would also bring a lot of
complexity for the few cases where we will actually need to process
non-ascii characters.

Reviewers: JDevlieghere, aprantl, probinson, dblaikie

Subscribers: mgorny, hintonda, echristo, clayborg, vleschuk, llvm-commits

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

llvm-svn: 325732

6 years ago[Hexagon] Add TargetRegisterInfo::getPointerRegClass() override
Tobias Edler von Koch [Wed, 21 Feb 2018 22:27:07 +0000 (22:27 +0000)]
[Hexagon] Add TargetRegisterInfo::getPointerRegClass() override

llvm-svn: 325731

6 years ago[InstCombine] add and use Create*FMF functions; NFC
Sanjay Patel [Wed, 21 Feb 2018 22:18:55 +0000 (22:18 +0000)]
[InstCombine] add and use Create*FMF functions; NFC

llvm-svn: 325730

6 years ago[X86][MMX] Add MMX_MOVD64rr build vector tests showing undef elements in the lower...
Simon Pilgrim [Wed, 21 Feb 2018 22:10:48 +0000 (22:10 +0000)]
[X86][MMX] Add MMX_MOVD64rr build vector tests showing undef elements in the lower half

llvm-svn: 325729

6 years ago[LLDB][PPC64] Fixed next blocked forever at same line
Pavel Labath [Wed, 21 Feb 2018 21:56:18 +0000 (21:56 +0000)]
[LLDB][PPC64] Fixed next blocked forever at same line

Summary:
The PC corresponding to the breakpoint was being calculated wrongly,
which was causing LLDB to never go past the first breakpoint, when
there was a second one adjacent to it.

Reviewers: clayborg, labath

Reviewed By: clayborg, labath

Subscribers: anajuliapc, alexandreyy, lbianc

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

llvm-svn: 325728

6 years ago[ORC] Switch to shared_ptr ownership for SymbolSources in VSOs.
Lang Hames [Wed, 21 Feb 2018 21:55:57 +0000 (21:55 +0000)]
[ORC] Switch to shared_ptr ownership for SymbolSources in VSOs.

This makes it easy to free a SymbolSource (and any related
resources) when the last reference in a VSO is dropped.

llvm-svn: 325727

6 years ago[ORC] Switch from a StringMap to an internal VSO in RTDyldObjectLinkingLayer.
Lang Hames [Wed, 21 Feb 2018 21:55:54 +0000 (21:55 +0000)]
[ORC] Switch from a StringMap to an internal VSO in RTDyldObjectLinkingLayer.

This is a first step towards switching to VSOs as the primary symbol tables in
ORC.

llvm-svn: 325726

6 years ago[ORC] Switch RTDyldObjectLinkingLayer to take a unique_ptr<MemoryBuffer> rather
Lang Hames [Wed, 21 Feb 2018 21:55:49 +0000 (21:55 +0000)]
[ORC] Switch RTDyldObjectLinkingLayer to take a unique_ptr<MemoryBuffer> rather
than a shared ObjectFile/MemoryBuffer pair.

There's no need to pre-parse the buffer into an ObjectFile before passing it
down to the linking layer, and moving the parsing into the linking layer allows
us remove the parsing code at each call site.

llvm-svn: 325725

6 years agoCodeGen: handle blocks correctly when inalloca'ed
Saleem Abdulrasool [Wed, 21 Feb 2018 21:47:51 +0000 (21:47 +0000)]
CodeGen: handle blocks correctly when inalloca'ed

When using blocks with C++ on Windows x86, it is possible to have the
block literal be pushed into the inalloca'ed parameters.  Teach IRGen to
handle the case properly by extracting the block literal from the
inalloca parameter.  This fixes the use of blocks with C++ on Windows
x86.

llvm-svn: 325724

6 years agolibcxx: Unbreak external thread library configuration.
Peter Collingbourne [Wed, 21 Feb 2018 21:36:18 +0000 (21:36 +0000)]
libcxx: Unbreak external thread library configuration.

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

llvm-svn: 325723

6 years ago[clang-format] Fix regression when getStyle() called with empty filename
Ben Hamilton [Wed, 21 Feb 2018 21:27:27 +0000 (21:27 +0000)]
[clang-format] Fix regression when getStyle() called with empty filename

Summary:
D43522 caused an assertion failure when getStyle() was called with
an empty filename:

P8065

This adds a test to reproduce the failure and fixes the issue by
ensuring we never pass an empty filename to
Environment::CreateVirtualEnvironment().

Test Plan: New test added. Ran test with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
  Before diff, test failed with P8065. Now, test passes.

Reviewers: vsapsai, jolesiak, krasimir

Reviewed By: vsapsai

Subscribers: klimek, cfe-commits

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

llvm-svn: 325722

6 years ago[sanitizer] Allow to set SANITIZER_CAN_USE_PREINIT_ARRAY externally
Vitaly Buka [Wed, 21 Feb 2018 21:13:07 +0000 (21:13 +0000)]
[sanitizer] Allow to set SANITIZER_CAN_USE_PREINIT_ARRAY externally

llvm-svn: 325720

6 years ago[testsuite] Run lit tests as part of `check-lldb`.
Davide Italiano [Wed, 21 Feb 2018 21:10:44 +0000 (21:10 +0000)]
[testsuite] Run lit tests as part of `check-lldb`.

Also, fix a missing dependency, as lit requires llvm-config
to run. This is becoming more and more important as we
write more FileCheck style tests.

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

llvm-svn: 325719

6 years ago[AArch64] fix IR names to not be 'tmp' because that gives the CHECK script problems
Sanjay Patel [Wed, 21 Feb 2018 20:48:14 +0000 (20:48 +0000)]
[AArch64] fix IR names to not be 'tmp' because that gives the CHECK script problems

llvm-svn: 325718

6 years ago[AArch64] add SLP test for matmul (PR36280); NFC
Sanjay Patel [Wed, 21 Feb 2018 20:34:16 +0000 (20:34 +0000)]
[AArch64] add SLP test for matmul (PR36280); NFC

This is a slight reduction of one of the benchmarks
that suffered with D43079. Cost model changes should
not cause this test to remain scalarized.

llvm-svn: 325717

6 years agoReplace incorrect usage of isInvalidDecl with intended setInvalidDecl
Erich Keane [Wed, 21 Feb 2018 20:29:05 +0000 (20:29 +0000)]
Replace incorrect usage of isInvalidDecl with intended setInvalidDecl

This typo would cause an attempt to multiversion 'main' to issue an
error, but not mark the function as invalid.  This patch fixes it.

llvm-svn: 325716

6 years agoRevert "[IRMover] Implement name based structure type mapping"
Rafael Espindola [Wed, 21 Feb 2018 20:12:18 +0000 (20:12 +0000)]
Revert "[IRMover] Implement name based structure type mapping"

This reverts commit r325686.

There was a misunderstanding and this has not been approved yet.

llvm-svn: 325715

6 years agoRevert r325679: [ELF] Add -nopie alias for -no-pie (PR36423)
Rui Ueyama [Wed, 21 Feb 2018 20:08:14 +0000 (20:08 +0000)]
Revert r325679: [ELF] Add -nopie alias for -no-pie (PR36423)

This reverts commit r325679 that was committed without discussion.
Actually, in the discussion thread, most people opposed to have this
option in lld. Reverting that change doesn't mean that this is a
final decision, but that needs to be discussed first.

llvm-svn: 325714

6 years ago[mips][lld] Address post commit review nit.
Simon Dardis [Wed, 21 Feb 2018 20:01:43 +0000 (20:01 +0000)]
[mips][lld] Address post commit review nit.

Address @ruiu's post commit review comment about a value which is intended
to be a unsigned 32 bit integer as using uint32_t rather than unsigned.

llvm-svn: 325713

6 years agoFix a memory leak and a cross module reference.
Rafael Espindola [Wed, 21 Feb 2018 19:55:11 +0000 (19:55 +0000)]
Fix a memory leak and a cross module reference.

llvm-svn: 325712

6 years ago[hwasan] Fix inline instrumentation.
Evgeniy Stepanov [Wed, 21 Feb 2018 19:52:23 +0000 (19:52 +0000)]
[hwasan] Fix inline instrumentation.

This patch changes hwasan inline instrumentation:

Fixes address untagging for shadow address calculation (use 0xFF instead of 0x00 for the top byte).
Emits brk instruction instead of hlt for the kernel and user space.
Use 0x900 instead of 0x100 for brk immediate (0x100 - 0x800 are unavailable in the kernel).
Fixes and adds appropriate tests.

Patch by Andrey Konovalov.

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

llvm-svn: 325711

6 years agoasan: add kernel inline instrumentation test (retry)
Vedant Kumar [Wed, 21 Feb 2018 19:40:55 +0000 (19:40 +0000)]
asan: add kernel inline instrumentation test (retry)

Add a test that checks that kernel inline instrumentation works.

Patch by Andrey Konovalov!

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

llvm-svn: 325710

6 years ago[testsuite/decorators] Get rid of some `expectFlakey` variants.
Davide Italiano [Wed, 21 Feb 2018 19:18:49 +0000 (19:18 +0000)]
[testsuite/decorators] Get rid of some `expectFlakey` variants.

These seem to be pretty much dead.

llvm-svn: 325708

6 years ago[X86][MMX] Run MMX bitcast test on 32 and 64-bit targets
Simon Pilgrim [Wed, 21 Feb 2018 18:52:16 +0000 (18:52 +0000)]
[X86][MMX] Run MMX bitcast test on 32 and 64-bit targets

llvm-svn: 325707