platform/upstream/llvm.git
6 years ago[clangd] tolerate windows filepaths in tests
Sam McCall [Wed, 8 Nov 2017 12:25:00 +0000 (12:25 +0000)]
[clangd] tolerate windows filepaths in tests

llvm-svn: 317686

6 years ago[RISCV] Codegen support for memory operations
Alex Bradbury [Wed, 8 Nov 2017 12:20:01 +0000 (12:20 +0000)]
[RISCV] Codegen support for memory operations

This required the implementation of RISCVTargetInstrInfo::copyPhysReg. Support
for lowering global addresses follow in the next patch.

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

llvm-svn: 317685

6 years ago[RISCV] Codegen support for materializing constants
Alex Bradbury [Wed, 8 Nov 2017 12:02:22 +0000 (12:02 +0000)]
[RISCV] Codegen support for materializing constants

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

llvm-svn: 317684

6 years agoXfail TestConcurrentTwoWatchpointsOneSignal on arm
Pavel Labath [Wed, 8 Nov 2017 11:51:49 +0000 (11:51 +0000)]
Xfail TestConcurrentTwoWatchpointsOneSignal on arm

r317561 exposed an interesting bug (pr35228) in handling of simultaneous
watchpoint hits. Disabling the test until we can get that fixed.

llvm-svn: 317683

6 years ago[Analysis] Fix merging TBAA tags with different final access types
Ivan A. Kosarev [Wed, 8 Nov 2017 11:42:21 +0000 (11:42 +0000)]
[Analysis] Fix merging TBAA tags with different final access types

There are cases when we have to merge TBAA access tags with the
same base access type, but different final access types. For
example, accesses to different members of the same structure may
be vectorized into a single load or store instruction. Since we
currently assume that the tags to merge always share the same
final access type, we incorrectly return a tag that describes an
access to one of the original final access types as the generic
tag. This patch fixes that by producing generic tags for the
common type and not the final access types of the original tags.

Resolves:
PR35225: Wrong tbaa metadata after load store vectorizer due to
recent change
https://bugs.llvm.org/show_bug.cgi?id=35225

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

llvm-svn: 317682

6 years ago[mips] Guard indirect and tailcall pseudo instructions correctly.
Simon Dardis [Wed, 8 Nov 2017 11:13:44 +0000 (11:13 +0000)]
[mips] Guard indirect and tailcall pseudo instructions correctly.

Previously these pseudo instructions were not guarded by ISA, so their
select was dependant on the ordering of the entries in the DAG matcher.

Reviewers: atanasyan

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

llvm-svn: 317681

6 years agoBasicAA: fix bug where we would return partialalias instead of noalias
Nuno Lopes [Wed, 8 Nov 2017 10:59:00 +0000 (10:59 +0000)]
BasicAA: fix bug where we would return partialalias instead of noalias
My fix is conservative and will make us return may-alias instead.

The test case is:
check(gep(x, 0), n, gep(x, n), -1)  with  n == sizeof(x)

Here, the first value accesses the whole object, but the second access
doesn't access anything. The semantics of -1 is read until the end of the
object, which in this case means read nothing.

No test case, since isn't trivial to exploit this one, but I've proved it correct.

llvm-svn: 317680

6 years agoLog: delimit thread name in log message
Pavel Labath [Wed, 8 Nov 2017 10:48:54 +0000 (10:48 +0000)]
Log: delimit thread name in log message

The thread name was not followed by a space, which meant it was glued to
the log message. I also align the name as we do that with other log
fields. I align it to 16 chars instead of llvm::max_thread_name(), as
that can be 64 on darwin, which is rather long. If anybody feels
differently about that, we can change it.

llvm-svn: 317679

6 years agoMake TestTopLevelExprs more robust in face of linker GC
Pavel Labath [Wed, 8 Nov 2017 10:48:50 +0000 (10:48 +0000)]
Make TestTopLevelExprs more robust in face of linker GC

Summary:
This test was failing in various configurations on linux in a fairly
unpredictible way. The success depended on whether the c++ abi library
was linked in statically or not and how well was the linker able to
strip parts of it. This introduces additional code to the "dummmy" test
executable, which ensures that all parts of the library needed to
evaluate the expressions are always present.

Reviewers: clayborg

Subscribers: srhines, tatyana-krasnukha, davide, lldb-commits

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

llvm-svn: 317678

6 years agoAvoid printing some redundant name qualifiers in completion
Ilya Biryukov [Wed, 8 Nov 2017 10:39:09 +0000 (10:39 +0000)]
Avoid printing some redundant name qualifiers in completion

Summary:
Adjusted PrintingPolicy inside code completion to avoid printing some
redundant name qualifiers.

Before this change, typedefs that were written unqualified in source
code were printed with qualifiers in completion. For example, in the
following code

    struct foo {
        typedef int type;
        type method();
    };

completion item for `method` had return type of `foo::type`, even
though the original code used `type` without qualifiers.
After this change, the completion item has return type `type`, as
originally written in the source code.

Note that this change does not suppress qualifiers written by the
user. For example, in the following code

    typedef int type;
    struct foo {
        typedef int type;
        ::type method(foo::type);
    };

completion item for `method` has return type of `::type` and
parameter type of `foo::type`, as originally written in the source
code.

Reviewers: arphaman, bkramer, klimek

Reviewed By: arphaman

Subscribers: mgorny, eraman, cfe-commits

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

llvm-svn: 317677

6 years agoMoved QualTypeNames.h from Tooling to AST.
Ilya Biryukov [Wed, 8 Nov 2017 10:39:03 +0000 (10:39 +0000)]
Moved QualTypeNames.h from Tooling to AST.

Summary:
For code reuse in SemaCodeComplete.
Note that the tests for QualTypeNames are still in Tooling as they use
Tooling's common testing code.

Reviewers: rsmith, saugustine, rnk, klimek, bkramer

Reviewed By: rnk

Subscribers: cfe-commits, mgorny

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

llvm-svn: 317676

6 years agoFixed link to bugzilla in the sidebar
Raphael Isemann [Wed, 8 Nov 2017 10:10:31 +0000 (10:10 +0000)]
Fixed link to bugzilla in the sidebar

llvm-svn: 317675

6 years ago[NFCI] Ensure TargetOpcode::* are compatible with guessInstructionProperties=0
Alex Bradbury [Wed, 8 Nov 2017 09:26:06 +0000 (09:26 +0000)]
[NFCI] Ensure TargetOpcode::* are compatible with guessInstructionProperties=0

rL162640 introduced CodeGenTarget::guessInstructionProperties. If a target
sets guessInstructionProperties=0 in its FooInstrInfo, tablegen will error if
it has to guess properties from patterns. Unfortunately,
guessInstructionProperties=0 can't be used with current upstream LLVM as
instructions in the TargetOpcode namespace are always included and sometimes
have inferred properties for mayLoad, mayStore, and hasSideEffects. This patch
provides the simplest possible fix to this problem, setting default values for
these fields in the TargetOpcode scope. There is no intended functional
change, as the explicitly set properties should match what was previously
inferred. A number of the instructions had hasSideEffects=1 inferred
unintentionally. This patch makes it explicit, while future patches (such as
D37097) correct the property.

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

llvm-svn: 317674

6 years ago[clangd] loosen tests for flag-dependence revealed by r317670
Sam McCall [Wed, 8 Nov 2017 09:15:01 +0000 (09:15 +0000)]
[clangd] loosen tests for flag-dependence revealed by r317670

llvm-svn: 317673

6 years ago[clang-refactor] Introduce a new rename rule for qualified symbols
Haojian Wu [Wed, 8 Nov 2017 08:56:56 +0000 (08:56 +0000)]
[clang-refactor] Introduce a new rename rule for qualified symbols

Summary: Prototype of a new rename rule for renaming qualified symbol.

Reviewers: arphaman, ioeric, sammccall

Reviewed By: arphaman, sammccall

Subscribers: jklaehn, cfe-commits, klimek

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

llvm-svn: 317672

6 years agoDAG: Add computeKnownBitsForFrameIndex
Matt Arsenault [Wed, 8 Nov 2017 08:52:31 +0000 (08:52 +0000)]
DAG: Add computeKnownBitsForFrameIndex

Some of the AMDGPU stack addressing modes require knowing the sign
bit is zero. We used to accomplish this by custom lowering
frame indexes, and then putting an AssertZext around a
TargetFrameIndex. This required specifically looking for
the AssextZext + frame index pattern which was moderately
disgusting. The same could probably be accomplished
with a target specific node, but would still
require special handling of frame indexes.

llvm-svn: 317671

6 years ago[clangd] Sort completion results.
Sam McCall [Wed, 8 Nov 2017 07:44:12 +0000 (07:44 +0000)]
[clangd] Sort completion results.

Summary:
This is (probably) not required by LSP, but at least one buggy client wants it.
It also simplifies some tests - changed a few completion tests to use -pretty.

Reviewers: hokein, malaperle

Subscribers: ilya-biryukov, cfe-commits

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

llvm-svn: 317670

6 years ago[COFF] Add support for IMAGE_REL_ARM64_SECREL
Martin Storsjo [Wed, 8 Nov 2017 07:31:50 +0000 (07:31 +0000)]
[COFF] Add support for IMAGE_REL_ARM64_SECREL

I never ran into this until lld-link started enabling debug output
by default for the mingw mode. I haven't been able to verify that
this actually behaves correctly, but this relocation is handled
identically on all other architectures so far.

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

llvm-svn: 317669

6 years agoAlways use prctl(PR_SET_PTRACER)
Sylvestre Ledru [Wed, 8 Nov 2017 07:25:19 +0000 (07:25 +0000)]
Always use prctl(PR_SET_PTRACER)

Summary:
Sufficiently old Linux kernel headers don't provide the PR_SET_PTRACER, but we can still call prctl with it if the runtime kernel is newer. Even if it's not, prctl will only return EINVAL.

Patch by Mike Hommey <mh-llvm@glandium.org>

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: sylvestre.ledru, cfe-commits, kubamracek

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

llvm-svn: 317668

6 years agoRevert "[CGP] Enable extending scope of optimizeMemoryInst"
Serguei Katkov [Wed, 8 Nov 2017 05:38:54 +0000 (05:38 +0000)]
Revert "[CGP] Enable extending scope of optimizeMemoryInst"

Revert the patch r317665 causing buildbot failures.

llvm-svn: 317667

6 years ago[CGP] Enable extending scope of optimizeMemoryInst
Serguei Katkov [Wed, 8 Nov 2017 05:02:51 +0000 (05:02 +0000)]
[CGP] Enable extending scope of optimizeMemoryInst

This patch enables the folding of address computation in
memory instruction in case adress is represented by Phi node.

The inputs of Phi node might be different in base register.

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

llvm-svn: 317665

6 years ago[X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.
Craig Topper [Wed, 8 Nov 2017 04:54:26 +0000 (04:54 +0000)]
[X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.

This ensures that only immediates that fit in 8-bits are used. This matches what we do for the unmasked versions.

llvm-svn: 317664

6 years agoRemove a given file even if openFileForRead fails.
Rui Ueyama [Wed, 8 Nov 2017 04:22:40 +0000 (04:22 +0000)]
Remove a given file even if openFileForRead fails.

I think the constract of this function is to remove a file in some way,
whether in background or in foreground. This patch makes sure that it
removes a given file.

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

llvm-svn: 317663

6 years ago[X86] Add patterns to fold EVEX store with EVEX encoded vcvtps2ph instructions. Remov...
Craig Topper [Wed, 8 Nov 2017 04:00:31 +0000 (04:00 +0000)]
[X86] Add patterns to fold EVEX store with EVEX encoded vcvtps2ph instructions. Remove bad pattern that had vf432 vcvtps2ph storing 128-bits.

llvm-svn: 317662

6 years ago[X86] Allow legacy vcvtps2ph intrinsics to select EVEX encoded instructions. Rely...
Craig Topper [Wed, 8 Nov 2017 04:00:30 +0000 (04:00 +0000)]
[X86] Allow legacy vcvtps2ph intrinsics to select EVEX encoded instructions. Rely on EVEX->VEX to convert back.

Missed store folding opportunities will be fixed in a subsequent commit.

llvm-svn: 317661

6 years agoUpdate for llvm change.
Rafael Espindola [Wed, 8 Nov 2017 01:50:34 +0000 (01:50 +0000)]
Update for llvm change.

llvm-svn: 317657

6 years agoConvert FileOutputBuffer::commit to Error.
Rafael Espindola [Wed, 8 Nov 2017 01:50:29 +0000 (01:50 +0000)]
Convert FileOutputBuffer::commit to Error.

llvm-svn: 317656

6 years agoRevert "[scudo] Make getNumberOfCPUs Fuchsia compliant"
Reid Kleckner [Wed, 8 Nov 2017 01:33:15 +0000 (01:33 +0000)]
Revert "[scudo] Make getNumberOfCPUs Fuchsia compliant"

This reverts commit r317604.

Android doesn't have cpu_set_t.

llvm-svn: 317655

6 years agoRevert "Reapply: Allow yaml2obj to order implicit sections for ELF"
Dave Lee [Wed, 8 Nov 2017 01:31:20 +0000 (01:31 +0000)]
Revert "Reapply: Allow yaml2obj to order implicit sections for ELF"

This reverts commit r317646.

llvm-svn: 317654

6 years agoUpdate unittest too.
Rafael Espindola [Wed, 8 Nov 2017 01:10:05 +0000 (01:10 +0000)]
Update unittest too.

llvm-svn: 317651

6 years agoUpdate for llvm change.
Rafael Espindola [Wed, 8 Nov 2017 01:05:52 +0000 (01:05 +0000)]
Update for llvm change.

llvm-svn: 317650

6 years agoConvert FileOutputBuffer to Expected. NFC.
Rafael Espindola [Wed, 8 Nov 2017 01:05:44 +0000 (01:05 +0000)]
Convert FileOutputBuffer to Expected. NFC.

llvm-svn: 317649

6 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Wed, 8 Nov 2017 01:03:16 +0000 (01:03 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 317648

6 years agoTarget/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering
David Blaikie [Wed, 8 Nov 2017 01:01:31 +0000 (01:01 +0000)]
Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering

This header includes CodeGen headers, and is not, itself, included by
any Target headers, so move it into CodeGen to match the layering of its
implementation.

llvm-svn: 317647

6 years agoReapply: Allow yaml2obj to order implicit sections for ELF
Dave Lee [Wed, 8 Nov 2017 00:58:50 +0000 (00:58 +0000)]
Reapply: Allow yaml2obj to order implicit sections for ELF

Summary:
This change allows yaml input to control the order of implicitly added sections
(`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a
placeholder section of the given name to the Sections field.

This change is to support changes in D39582, where it is desirable to control
the location of the `.dynsym` section.

This reapplied version fixes:
  1. use of a function call within an assert
  2. failing lld test which has an unnamed section

Additionally, one more test to cover the unnamed section failure.

Reviewers: compnerd, jakehehrlich

Reviewed By: jakehehrlich

Subscribers: llvm-commits

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

llvm-svn: 317646

6 years agoAMDGPU: Set correct sched model on v_mad_u64_u32
Matt Arsenault [Wed, 8 Nov 2017 00:48:25 +0000 (00:48 +0000)]
AMDGPU: Set correct sched model on v_mad_u64_u32

llvm-svn: 317645

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 8 Nov 2017 00:39:18 +0000 (00:39 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 317644

6 years agoFix compile issue on MSVC.
Douglas Yung [Wed, 8 Nov 2017 00:29:42 +0000 (00:29 +0000)]
Fix compile issue on MSVC.

llvm-svn: 317642

6 years agoRevert rL317618
Mitch Phillips [Wed, 8 Nov 2017 00:20:53 +0000 (00:20 +0000)]
Revert rL317618

The implemented pass fails and is breaking a large number of unit tests.
Example:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/5777/steps/build-stage3-compiler/logs/stdio

This reverts commit rL317618

llvm-svn: 317641

6 years ago[sanitizer] Asm implementation of syscall() for arm32.
Evgeniy Stepanov [Wed, 8 Nov 2017 00:15:12 +0000 (00:15 +0000)]
[sanitizer] Asm implementation of syscall() for arm32.

Summary:
These will be used in an ifunc resolver, when the binary may not be
completely relocated, and syscall() function from libc could not be
used.

Reviewers: dvyukov, vitalybuka

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

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

llvm-svn: 317640

6 years agoAttribute nonlazybind should not affect calls to functions with hidden visibility.
Sriraman Tallam [Wed, 8 Nov 2017 00:01:05 +0000 (00:01 +0000)]
Attribute nonlazybind should not affect calls to functions with hidden visibility.

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

llvm-svn: 317639

6 years ago(NFC) Rename GetMax{,User}VirtualAddress.
Evgeniy Stepanov [Tue, 7 Nov 2017 23:51:22 +0000 (23:51 +0000)]
(NFC) Rename GetMax{,User}VirtualAddress.

Future change will introduce GetMaxVirtualAddress that will not take
the kernel area into account.

llvm-svn: 317638

6 years agoFix unused variable error.
Rafael Espindola [Tue, 7 Nov 2017 23:43:01 +0000 (23:43 +0000)]
Fix unused variable error.

llvm-svn: 317637

6 years agoCleanup version symbol macros and attributes/declspecs
Jonathan Peyton [Tue, 7 Nov 2017 23:32:13 +0000 (23:32 +0000)]
Cleanup version symbol macros and attributes/declspecs

1) Get rid of xaliasify, xexpand and xversionify for KMP_EXPAND_NAME and
KMP_VERSION_SYMBOL. KMP_VERSION_SYMBOL is a combination of xaliasify and
xversionify.

2) Put all attribute and __declspec definitions in kmp_os.h

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

llvm-svn: 317636

6 years ago[coff] use relative instead of absolute __safe_se_handler_base when present
Bob Haarman [Tue, 7 Nov 2017 23:24:10 +0000 (23:24 +0000)]
[coff] use relative instead of absolute __safe_se_handler_base when present

Summary:
__safe_se_handler_base should be either absolute 0 (when no SafeSEH
table is present), or relative to the image base (when the table is
present). An earlier change inadvertedly made the symbol absolute in
both cases, leading to the SafeSEH table not being locatble at run
time. This change fixes that and updates the safeseh test to check for
the presence of the relocation.

Reviewers: rnk, ruiu

Reviewed By: ruiu

Subscribers: ruiu, llvm-commits

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

llvm-svn: 317635

6 years agoReapply r317609 with a simpler sed script, thanks to Justin Bogner!
Paul Robinson [Tue, 7 Nov 2017 23:17:43 +0000 (23:17 +0000)]
Reapply r317609 with a simpler sed script, thanks to Justin Bogner!

llvm-svn: 317634

6 years agoDelete dead code.
Rafael Espindola [Tue, 7 Nov 2017 23:12:41 +0000 (23:12 +0000)]
Delete dead code.

llvm-svn: 317633

6 years agoUse std::thread directly.
Rafael Espindola [Tue, 7 Nov 2017 23:09:54 +0000 (23:09 +0000)]
Use std::thread directly.

Now that this code is posix only we don't need to use runBackground.

llvm-svn: 317632

6 years agoSimplify unlinkAsync.
Rafael Espindola [Tue, 7 Nov 2017 23:01:37 +0000 (23:01 +0000)]
Simplify unlinkAsync.

It used to rename the file before removing it in a background thread.

A simpler way to delay the removal is simply to open the file.

Since this is a posix specific issue, simplify the windows
implementation.

llvm-svn: 317631

6 years agoRevert "Allow yaml2obj to order implicit sections for ELF"
Dave Lee [Tue, 7 Nov 2017 22:51:27 +0000 (22:51 +0000)]
Revert "Allow yaml2obj to order implicit sections for ELF"

Also, revert "Fix build bots after r317622"

This reverts commit r317622, r317626.

llvm-svn: 317630

6 years agoRevert r317609, test fails on one bot
Paul Robinson [Tue, 7 Nov 2017 22:39:12 +0000 (22:39 +0000)]
Revert r317609, test fails on one bot

llvm-svn: 317628

6 years agoChange noplt.c to work for non-x86 targets.
Sriraman Tallam [Tue, 7 Nov 2017 22:34:55 +0000 (22:34 +0000)]
Change noplt.c to work for non-x86 targets.

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

llvm-svn: 317627

6 years agoFix build bots after r317622
Dave Lee [Tue, 7 Nov 2017 22:33:07 +0000 (22:33 +0000)]
Fix build bots after r317622

Example build failure: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/14660

TIL that the warning flags for local builds are loose compared to what build
servers use.

llvm-svn: 317626

6 years agoDelete unused constructor.
Rafael Espindola [Tue, 7 Nov 2017 22:30:53 +0000 (22:30 +0000)]
Delete unused constructor.

llvm-svn: 317625

6 years agoUpdate tuple/list/deque data formatters to work with newest libc++
Pavel Labath [Tue, 7 Nov 2017 22:17:29 +0000 (22:17 +0000)]
Update tuple/list/deque data formatters to work with newest libc++

Summary:
A couple of members of these data structures have been renamed in recent
months. This makes sure they still work with the latest libc++ version.

Reviewers: jingham, EricWF

Subscribers: lldb-commits

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

llvm-svn: 317624

6 years ago[NVPTX] Implement __nvvm_atom_add_gen_d builtin.
Justin Lebar [Tue, 7 Nov 2017 22:10:54 +0000 (22:10 +0000)]
[NVPTX] Implement __nvvm_atom_add_gen_d builtin.

Summary:
This just seems to have been an oversight.  We already supported the f64
atomic add with an explicit scope (e.g. "cta"), but not the scopeless
version.

Reviewers: tra

Subscribers: jholewinski, sanjoy, cfe-commits, llvm-commits, hiraditya

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

llvm-svn: 317623

6 years agoAllow yaml2obj to order implicit sections for ELF
Dave Lee [Tue, 7 Nov 2017 22:05:24 +0000 (22:05 +0000)]
Allow yaml2obj to order implicit sections for ELF

Summary:
This change allows yaml input to control the order of implicitly added sections
(`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a
placeholder section of the given name to the Sections field.

This change is to support changes in D39582, where it is desirable to control
the location of the `.dynsym` section.

Reviewers: compnerd, jakehehrlich

Reviewed By: jakehehrlich

Subscribers: llvm-commits

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

llvm-svn: 317622

6 years ago[ObjC++] Don't warn about pessimizing move for __block variables
Alex Lorenz [Tue, 7 Nov 2017 21:40:11 +0000 (21:40 +0000)]
[ObjC++] Don't warn about pessimizing move for __block variables

rdar://33316951

llvm-svn: 317620

6 years ago[SLPVectorizer] Failure to beneficially vectorize 'copyable' elements in integer...
Dinar Temirbulatov [Tue, 7 Nov 2017 21:25:34 +0000 (21:25 +0000)]
[SLPVectorizer] Failure to beneficially vectorize 'copyable' elements in integer binary ops.

    Patch tries to improve vectorization of the following code:

    void add1(int * __restrict dst, const int * __restrict src) {
      *dst++ = *src++;
      *dst++ = *src++ + 1;
      *dst++ = *src++ + 2;
      *dst++ = *src++ + 3;
    }
    Allows to vectorize even if the very first operation is not a binary add, but just a load.

    Fixed PR34619 and other issues related to previous commit.

    Reviewers: spatel, mzolotukhin, mkuper, hfinkel, RKSimon, filcab, ABataev

    Reviewed By: ABataev, RKSimon

    Subscribers: llvm-commits, RKSimon

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

llvm-svn: 317618

6 years agoExtend SpecialCaseList to allow users to blame matches on entries in the file.
Mitch Phillips [Tue, 7 Nov 2017 21:16:46 +0000 (21:16 +0000)]
Extend SpecialCaseList to allow users to blame matches on entries in the file.

Summary:
Extends SCL functionality to allow users to find the line number in the file the SCL is built from through SpecialCaseList::inSectionBlame(...).

Also removes the need to compile the SCL before use. As the matcher now contains a list of regexes to test against instead of a single regex, the regexes can be individually built on each insertion rather than one large compilation at the end of construction.

This change also fixes a bug where blank lines would cause the parser to become out-of-sync with the line number. An error on line `k` was being reported as being on line `k - num_blank_lines_before_k`.

Note: This change has a cyclical dependency on D39486. Both these changes must be submitted at the same time to avoid a build breakage.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: kcc, pcc, llvm-commits

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

llvm-svn: 317617

6 years agoUpdate SanitizerSpecialCaseList to use renamed functions in base class.
Mitch Phillips [Tue, 7 Nov 2017 21:16:37 +0000 (21:16 +0000)]
Update SanitizerSpecialCaseList to use renamed functions in base class.

Note: This change has a cyclical dependency on D39485. Both these changes must be submitted at the same time to avoid a build breakage.

Reviewers: vlad.tsyrklevich

Subscribers: llvm-commits

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

llvm-svn: 317616

6 years ago[CodeGenPrepare] Fix typo in comment. NFC
Craig Topper [Tue, 7 Nov 2017 20:56:17 +0000 (20:56 +0000)]
[CodeGenPrepare] Fix typo in comment. NFC

llvm-svn: 317614

6 years agoUse new vector insert half-word and byte instructions when we see insertelement on...
Graham Yiu [Tue, 7 Nov 2017 20:55:43 +0000 (20:55 +0000)]
Use new vector insert half-word and byte instructions when we see insertelement on '8 x i16' and '16 x i8' types.  Also extended existing lit testcase to cover these cases.

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

llvm-svn: 317613

6 years agoConvert a dwarfdump test from checked-in binary to assembler source.
Paul Robinson [Tue, 7 Nov 2017 20:35:44 +0000 (20:35 +0000)]
Convert a dwarfdump test from checked-in binary to assembler source.

llvm-svn: 317612

6 years agoTeach test suite about C++2a dialect flag.
Eric Fiselier [Tue, 7 Nov 2017 20:26:23 +0000 (20:26 +0000)]
Teach test suite about C++2a dialect flag.

This patch teaches the test suite configuration about the -std=c++2a
flag. And, since it's the newest dialect, change the test suite to
choose it, if possible, by default.

llvm-svn: 317611

6 years agoChange test suite to support c++17 dialect flag instead of c++1z.
Eric Fiselier [Tue, 7 Nov 2017 20:20:58 +0000 (20:20 +0000)]
Change test suite to support c++17 dialect flag instead of c++1z.

This patch changes the test suite to attempt and prefer -std=c++17 over
-std=c++1z. It also fixes the REQUIRES and UNSUPPORTED lit markers
to refer to c++17 over c++1z.

llvm-svn: 317610

6 years ago[DWARFv5] Add new test for previous commit.
Paul Robinson [Tue, 7 Nov 2017 20:12:58 +0000 (20:12 +0000)]
[DWARFv5] Add new test for previous commit.

llvm-svn: 317609

6 years ago[sanitizer] Fix sanitizer_common compile errors on gcc trunk
Vitaly Buka [Tue, 7 Nov 2017 20:10:17 +0000 (20:10 +0000)]
[sanitizer] Fix sanitizer_common compile errors on gcc trunk

Summary:
When testing a merge of compiler-rt r304709 into gcc trunk on x86-64-pc-linux-gnu,
I ran into two compile errors:
sanitizer_common/sanitizer_symbolizer_libbacktrace.cc:96:73: error: no matching function for call to '__sanitizer::AddressInfo::FillModuleInfo(char*&, __sanitizer::uptr&)'

All other files in sanitizer_common (with the exception of sanitizer_malloc_mac.inc
which is special) include sanitizer_platform.h without directory name.

Patch by Mike Jongen

Reviewers: kcc, vitalybuka

Reviewed By: kcc

Subscribers: kubamracek, fedor.sergeev, llvm-commits

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

llvm-svn: 317608

6 years ago[DWARFv5] Support DW_FORM_strp in the .debug_line header.
Paul Robinson [Tue, 7 Nov 2017 19:57:12 +0000 (19:57 +0000)]
[DWARFv5] Support DW_FORM_strp in the .debug_line header.

Supporting this form in .debug_line.dwo will be done as a follow-up.

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

llvm-svn: 317607

6 years agoNew clang option -fno-plt which avoids the PLT and lazy binding while making external...
Sriraman Tallam [Tue, 7 Nov 2017 19:37:51 +0000 (19:37 +0000)]
New clang option -fno-plt which avoids the PLT and lazy binding while making external calls.

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

llvm-svn: 317605

6 years ago[scudo] Make getNumberOfCPUs Fuchsia compliant
Kostya Kortchinsky [Tue, 7 Nov 2017 19:30:08 +0000 (19:30 +0000)]
[scudo] Make getNumberOfCPUs Fuchsia compliant

Summary: This change allows Fuchsia to boot properly using the Scudo allocator.

Reviewers: cryptoad, alekseyshl, krytarowski

Reviewed By: cryptoad, krytarowski

Subscribers: krytarowski, kubamracek, llvm-commits

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

llvm-svn: 317604

6 years ago[WebAssembly] Include GENERIC_TF_SOURCES in wasm builds
Sam Clegg [Tue, 7 Nov 2017 19:03:11 +0000 (19:03 +0000)]
[WebAssembly] Include GENERIC_TF_SOURCES in wasm builds

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

llvm-svn: 317601

6 years agoRecommit r317510 "[InstCombine] Pull shifts through a select plus binop with constant"
Craig Topper [Tue, 7 Nov 2017 18:47:24 +0000 (18:47 +0000)]
Recommit r317510 "[InstCombine] Pull shifts through a select plus binop with constant"

The hexagon test should be fixed now.

Original commit message:

This pulls shifts through a select+binop with a constant where the select conditionally executes the binop. We already do this for just the binop, but not with the select.

This can allow us to get the select closer to other selects to enable removing one.

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

llvm-svn: 317600

6 years ago[refactor] rename field references in __builtin_offsetof
Alex Lorenz [Tue, 7 Nov 2017 18:30:23 +0000 (18:30 +0000)]
[refactor] rename field references in __builtin_offsetof

rdar://33875453

llvm-svn: 317599

6 years agoClang/libomptarget map interface flag renaming - NFC patch
George Rokos [Tue, 7 Nov 2017 18:27:04 +0000 (18:27 +0000)]
Clang/libomptarget map interface flag renaming - NFC patch

This patch renames some of the flag names of the clang/libomptarget map interface. The old names are slightly misleading, whereas the new ones describe in a better way what each flag is about.

Only the macros within the enumeration are renamed, there is no change in functionality therefore there are no updated regression tests.

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

llvm-svn: 317598

6 years ago[index] __builtin_offset's field reference is located at the end location
Alex Lorenz [Tue, 7 Nov 2017 18:25:36 +0000 (18:25 +0000)]
[index] __builtin_offset's field reference is located at the end location

The starting location is the location of the '.'

llvm-svn: 317596

6 years ago[InstCombine] Update stale comment. NFC
Craig Topper [Tue, 7 Nov 2017 17:37:32 +0000 (17:37 +0000)]
[InstCombine] Update stale comment. NFC

Datalayout is no longer optional so the comment didn't match what the code currently does.

llvm-svn: 317594

6 years ago[index] index field references in __builtin_offset
Alex Lorenz [Tue, 7 Nov 2017 17:29:11 +0000 (17:29 +0000)]
[index] index field references in __builtin_offset

rdar://35109556

llvm-svn: 317593

6 years ago[Hexagon] Make a test more flexible in HexagonLoopIdiomRecognition
Krzysztof Parzyszek [Tue, 7 Nov 2017 17:05:54 +0000 (17:05 +0000)]
[Hexagon] Make a test more flexible in HexagonLoopIdiomRecognition

An "or" that sets the sign-bit can be replaced with a "xor", if
the sign-bit was known to be clear before. With some changes to
instruction combining, the simple sign-bit check was failing.
Replace it with a more flexible one to catch more cases.

llvm-svn: 317592

6 years ago[AArch64][SVE] Asm: Add support for (ADD|SUB)_ZZZ
Florian Hahn [Tue, 7 Nov 2017 16:58:13 +0000 (16:58 +0000)]
[AArch64][SVE] Asm: Add support for (ADD|SUB)_ZZZ

Patch [5/5] in a series to add assembler/disassembler support for AArch64 SVE unpredicated ADD/SUB instructions.

Patch by Sander De Smalen.

Reviewed by: rengolin

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

llvm-svn: 317591

6 years ago[AArch64][SVE] Asm: Add SVE (Z) Register definitions and parsing support
Florian Hahn [Tue, 7 Nov 2017 16:45:48 +0000 (16:45 +0000)]
[AArch64][SVE] Asm: Add SVE (Z) Register definitions and parsing support

Patch [3/5] in a series to add assembler/disassembler support for AArch64 SVE unpredicated ADD/SUB instructions.

To summarise, this patch adds:

 * SVE register definitions
 * Methods to parse SVE register operands
 * Methods to print SVE register operands
 * RegKind SVEDataVector to distinguish it from other data types like scalar register or Neon vector.
 * k_SVEDataRegister and SVEDataRegOp to describe SVE registers (which will be extended by further patches with e.g. ElementWidth and the shift-extend type).

Patch by Sander De Smalen.

Reviewed by: rengolin

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

llvm-svn: 317590

6 years agoSystemZ Swift TargetInfo: swifterror support in the backend is broken
Arnold Schwaighofer [Tue, 7 Nov 2017 16:40:51 +0000 (16:40 +0000)]
SystemZ Swift TargetInfo: swifterror support in the backend is broken

Return false for swifterror support until the backend is fixed.

llvm-svn: 317589

6 years ago[SelectionDAG] Fix typo in comment. NFC
Craig Topper [Tue, 7 Nov 2017 16:32:31 +0000 (16:32 +0000)]
[SelectionDAG] Fix typo in comment. NFC

llvm-svn: 317588

6 years agotsan: allow usage of global vars with ctors in interceptors
Dmitry Vyukov [Tue, 7 Nov 2017 16:31:08 +0000 (16:31 +0000)]
tsan: allow usage of global vars with ctors in interceptors

We allow usage of global/per-thread data with non-trivial ctors/dtors
throughout tsan code base by placing all global/per-thread data into
Context/ThreadState and then explicitly constructing them with
placement new. This greatly simplifies code by restricting the
"linker initialized plague" to only these 2 objects.

Do the same for interceptors data.

This allows to use Vector instead of bunch of hand-written code in:
https://reviews.llvm.org/D39619

Reviewed in: https://reviews.llvm.org/D39721

llvm-svn: 317587

6 years agoUpdate sanitizer_allocator to use new API.
Kostya Kortchinsky [Tue, 7 Nov 2017 16:19:24 +0000 (16:19 +0000)]
Update sanitizer_allocator to use new API.

Summary:
Update sanitizer_allocator to use new API.

Second patch in a series.  First patch https://reviews.llvm.org/D39072

Updates MmapNoAccess / MmapFixed call sites in the saniziter_allocator
to use the new Init/Map APIs instead.

Reviewers: alekseyshl, cryptoad, phosek, mcgrathr, dvyukov

Reviewed By: alekseyshl, cryptoad

Subscribers: dvyukov, mcgrathr, kubamracek

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

llvm-svn: 317586

6 years ago[clangd] Fix opening declarations located in non-preamble inclusion
Marc-Andre Laperle [Tue, 7 Nov 2017 16:16:45 +0000 (16:16 +0000)]
[clangd] Fix opening declarations located in non-preamble inclusion

Summary:
When an inclusion is not processed as part of the preamble, its path is
not made into an absolute path as part of the precompiled header code
(adjustFilenameForRelocatableAST in ASTWriter.cpp). Because of this,
when we convert a Decl location to retrieve the file name with
FileEntry->getName(), it is possible for this path to be relative.
Instead, we should try to use tryGetRealPathName first which returns
an absolute path.

Fixes bug 35217.

Reviewers: sammccall, ilya-biryukov, rwols, Nebiroth

Reviewed By: sammccall

Subscribers: cfe-commits, ilya-biryukov

Tags: #clang-tools-extra

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

llvm-svn: 317585

6 years ago[clangd] Fix initialize capabilities response
Sam McCall [Tue, 7 Nov 2017 15:49:35 +0000 (15:49 +0000)]
[clangd] Fix initialize capabilities response

llvm-svn: 317584

6 years ago[CodeGen] split math and complex tests into separate files; NFCI
Sanjay Patel [Tue, 7 Nov 2017 15:13:22 +0000 (15:13 +0000)]
[CodeGen] split math and complex tests into separate files; NFCI

The files are already large, and we may need to add even more RUNs to
distinguish differences based on OS, environment, or other platform things.

llvm-svn: 317583

6 years ago[AArch64][SVE] Asm: Set SVE as unsupported feature for existing scheduler models.
Florian Hahn [Tue, 7 Nov 2017 15:03:11 +0000 (15:03 +0000)]
[AArch64][SVE] Asm: Set SVE as unsupported feature for existing scheduler models.

Patch [4/5] in a series to add assembler/disassembler support for AArch64 SVE unpredicated ADD/SUB instructions.

We add SVE as unsupported feature for CPUs that don't have SVE to prevent errors from scheduler models saying it lacks information for these instructions.

Patch by Sander De Smalen.

Reviewed by: rengolin

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

llvm-svn: 317582

6 years ago[clangd] MSVC - third time's the charm
Sam McCall [Tue, 7 Nov 2017 14:59:21 +0000 (14:59 +0000)]
[clangd] MSVC - third time's the charm

llvm-svn: 317581

6 years ago[clangd] don't crash on invalid JSON-RPC ID
Sam McCall [Tue, 7 Nov 2017 14:45:31 +0000 (14:45 +0000)]
[clangd] don't crash on invalid JSON-RPC ID

llvm-svn: 317580

6 years agoReland "Correct dwarf unwind information in function epilogue for X86"
Petar Jovanovic [Tue, 7 Nov 2017 14:40:27 +0000 (14:40 +0000)]
Reland "Correct dwarf unwind information in function epilogue for X86"

Reland r317100 with minor fix regarding ComputeCommonTailLength function in
BranchFolding.cpp. Skipping top CFI instructions block needs to executed on
several more return points in ComputeCommonTailLength().

Original r317100 message:

"Correct dwarf unwind information in function epilogue for X86"

This patch aims to provide correct dwarf unwind information in function
epilogue for X86.

It consists of two parts. The first part inserts CFI instructions that set
appropriate cfa offset and cfa register in emitEpilogue() in
X86FrameLowering. This part is X86 specific.

The second part is platform independent and ensures that:

- CFI instructions do not affect code generation
- Unwind information remains correct when a function is modified by
  different passes. This is done in a late pass by analyzing information
  about cfa offset and cfa register in BBs and inserting additional CFI
  directives where necessary.

Changed CFI instructions so that they:

- are duplicable
- are not counted as instructions when tail duplicating or tail merging
- can be compared as equal

Added CFIInstrInserter pass:

- analyzes each basic block to determine cfa offset and register valid at
  its entry and exit
- verifies that outgoing cfa offset and register of predecessor blocks match
  incoming values of their successors
- inserts additional CFI directives at basic block beginning to correct the
  rule for calculating CFA

Having CFI instructions in function epilogue can cause incorrect CFA
calculation rule for some basic blocks. This can happen if, due to basic
block reordering, or the existence of multiple epilogue blocks, some of the
blocks have wrong cfa offset and register values set by the epilogue block
above them.

CFIInstrInserter is currently run only on X86, but can be used by any target
that implements support for adding CFI instructions in epilogue.

Patch by Violeta Vukobrat.

llvm-svn: 317579

6 years agoSilence MSVC error C2398
Kristof Beyls [Tue, 7 Nov 2017 14:37:01 +0000 (14:37 +0000)]
Silence MSVC error C2398

Reported by http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/6000/steps/build-unified-tree/logs/stdio
The error messages were all similar to:
llvm\unittests\CodeGen\GlobalISel\LegalizerInfoTest.cpp(54): error C2398: Element '1': conversion from '' to 'unsigned int' requires a narrowing conversion

llvm-svn: 317578

6 years ago[clang-refactor] Use ClangTool more explicitly by making refaroing actions AST fronte...
Eric Liu [Tue, 7 Nov 2017 14:35:03 +0000 (14:35 +0000)]
[clang-refactor] Use ClangTool more explicitly by making refaroing actions AST frontend actions.

Summary: This is a refactoring change. NFC

Reviewers: arphaman, hokein

Reviewed By: arphaman, hokein

Subscribers: cfe-commits

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

llvm-svn: 317577

6 years ago[SLP] Fix PR35047: Fix default cost model for cast op in X86.
Alexey Bataev [Tue, 7 Nov 2017 14:23:44 +0000 (14:23 +0000)]
[SLP] Fix PR35047: Fix default cost model for cast op in X86.

Summary:
The cost calculation for default case on X86 target does not always
follow correct wayt because of missing 4-th argument in
`BaseT::getCastInstrCost()` call. Added this missing parameter.

Reviewers: hfinkel, mkuper, RKSimon, spatel

Subscribers: llvm-commits

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

llvm-svn: 317576

6 years ago[clangd] another try at fixing MSVC
Sam McCall [Tue, 7 Nov 2017 14:14:58 +0000 (14:14 +0000)]
[clangd] another try at fixing MSVC

llvm-svn: 317575

6 years agoFix an issue in r317563 causing a clang assert
Tamas Berghammer [Tue, 7 Nov 2017 13:43:55 +0000 (13:43 +0000)]
Fix an issue in r317563 causing a clang assert

llvm-svn: 317574

6 years agoMark intentional fall-through with LLVM_FALLTHROUGH.
Kristof Beyls [Tue, 7 Nov 2017 13:31:52 +0000 (13:31 +0000)]
Mark intentional fall-through with LLVM_FALLTHROUGH.

... to silence gcc 7's default -Wimplicit-fallthrough.

llvm-svn: 317573

6 years agoAdd a -D flag to FileCheck to define variables
Alexander Richardson [Tue, 7 Nov 2017 13:24:44 +0000 (13:24 +0000)]
Add a -D flag to FileCheck to define variables

Summary:
This makes it very easy to test files that only differ in a constant
value somewhere in the test case.

Reviewers: jlebar, hfinkel, chandlerc, probinson

Reviewed By: probinson

Subscribers: probinson, llvm-commits

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

llvm-svn: 317572

6 years ago[X86] Regenerate select tests
Simon Pilgrim [Tue, 7 Nov 2017 13:21:02 +0000 (13:21 +0000)]
[X86] Regenerate select tests

llvm-svn: 317571