4 weeks agoMerge branch 'addr2' into errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerror... dwz
Jan Kratochvil [Thu, 19 Dec 2019 09:25:47 +0000 (10:25 +0100)]
Merge branch 'addr2' into errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2-debug-pair-addr2

4 weeks agoMerge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2-debug...
Jan Kratochvil [Thu, 19 Dec 2019 09:17:16 +0000 (10:17 +0100)]
Merge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2-debug' into errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2-debug-pair

4 weeks agoMerge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2' into...
Jan Kratochvil [Thu, 19 Dec 2019 09:16:37 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2' into errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2-debug

4 weeks agoMerge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink' into errors2-fixup...
Jan Kratochvil [Thu, 19 Dec 2019 09:16:33 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink' into errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink-noerrors2

4 weeks agoMerge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test' into errors2-fixup-scoped...
Jan Kratochvil [Thu, 19 Dec 2019 09:16:29 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup-scoped-dwz-dwo-globalvar-test' into errors2-fixup-scoped-dwz-dwo-globalvar-test-symlink

4 weeks agoMerge branch 'errors2-fixup-scoped-dwz-dwo-globalvar' into errors2-fixup-scoped-dwz...
Jan Kratochvil [Thu, 19 Dec 2019 09:16:25 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup-scoped-dwz-dwo-globalvar' into errors2-fixup-scoped-dwz-dwo-globalvar-test

4 weeks agoMerge branch 'errors2-fixup-scoped-dwz-dwo' into errors2-fixup-scoped-dwz-dwo-globalvar
Jan Kratochvil [Thu, 19 Dec 2019 09:16:21 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup-scoped-dwz-dwo' into errors2-fixup-scoped-dwz-dwo-globalvar

4 weeks agoMerge branch 'errors2-fixup-scoped-dwz' into errors2-fixup-scoped-dwz-dwo
Jan Kratochvil [Thu, 19 Dec 2019 09:16:17 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup-scoped-dwz' into errors2-fixup-scoped-dwz-dwo

4 weeks agoMerge branch 'errors2-fixup-scoped' into errors2-fixup-scoped-dwz
Jan Kratochvil [Thu, 19 Dec 2019 09:16:14 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup-scoped' into errors2-fixup-scoped-dwz

4 weeks agoMerge branch 'errors2-fixup' into errors2-fixup-scoped
Jan Kratochvil [Thu, 19 Dec 2019 09:16:10 +0000 (10:16 +0100)]
Merge branch 'errors2-fixup' into errors2-fixup-scoped

4 weeks agoMerge branch 'errors2' into errors2-fixup
Jan Kratochvil [Thu, 19 Dec 2019 09:16:01 +0000 (10:16 +0100)]
Merge branch 'errors2' into errors2-fixup

4 weeks agoMerge remote-tracking branch 'origin/master' into errors2
Jan Kratochvil [Thu, 19 Dec 2019 09:08:45 +0000 (10:08 +0100)]
Merge remote-tracking branch 'origin/master' into errors2

4 weeks agoMerge remote-tracking branch 'origin/master' into addr2
Jan Kratochvil [Thu, 19 Dec 2019 08:44:04 +0000 (09:44 +0100)]
Merge remote-tracking branch 'origin/master' into addr2

4 weeks ago(no commit message)
Jan Kratochvil [Thu, 19 Dec 2019 08:36:17 +0000 (09:36 +0100)]

4 weeks ago[llvm-readobj][test] - Refactor mips-st-other.test
Georgii Rymar [Wed, 18 Dec 2019 09:44:54 +0000 (12:44 +0300)]
[llvm-readobj][test] - Refactor mips-st-other.test

This removes 2 precompiled binaries, adds testing
for STO_* flags missing, refines and renames the test.

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

4 weeks ago[llvm-readobj][llvm-objdump] - Cleanup testing of dynamic tags dumping.
Georgii Rymar [Tue, 17 Dec 2019 12:53:36 +0000 (15:53 +0300)]
[llvm-readobj][llvm-objdump] - Cleanup testing of dynamic tags dumping.

We have the `elf-dynamic-tags-machine-specific.yaml` input shared
between the llvm-readobj and llvm-objdump test.
It looks strange, because tools usually does not share inputs.

Also there are following problems related:
1) `elf-dynamic-tags-machine-specific.yaml` input contains excessive YAML parts.
2) objdump's test case never test AARCH64 tags.
3) There are unknown tags in the `elf-dynamic-tags-machine-specific.yaml` and
    `dynamic-tags-machine-specific.test`, though we already testing unknown tags
    in `\llvm-readobj\ELF\dynamic-tags.test` and `llvm-objdump\elf-dynamic-section.test` tests.

This patch removes the shared input and refines the test cases to resolve
issues mentioned.

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

4 weeks ago[AMDGPU] Implemented fma cost analysis
Stanislav Mekhanoshin [Wed, 18 Dec 2019 21:29:21 +0000 (13:29 -0800)]
[AMDGPU] Implemented fma cost analysis

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

4 weeks agoEnable STRICT_FP_TO_SINT/UINT on X86 backend
Liu, Chen3 [Thu, 19 Dec 2019 06:43:45 +0000 (14:43 +0800)]
Enable STRICT_FP_TO_SINT/UINT on X86 backend
This patch is mainly for custom lowering the vector operation.

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

4 weeks agoDebugInfo: Fix test fallout from aaa5a5e7ff1aee632aae75311e7c044f710dd0a0
David Blaikie [Thu, 19 Dec 2019 03:00:40 +0000 (19:00 -0800)]
DebugInfo: Fix test fallout from aaa5a5e7ff1aee632aae75311e7c044f710dd0a0

4 weeks ago[compiler-rt] Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD
Kamil Rytarowski [Thu, 19 Dec 2019 02:21:46 +0000 (03:21 +0100)]

.preinit_array is supported since 9.0.

4 weeks ago[PowerPC] make lwa as a valid ds candidate in ppcloopinstrformprep pass
czhengsz [Thu, 19 Dec 2019 02:03:54 +0000 (21:03 -0500)]
[PowerPC] make lwa as a valid ds candidate in ppcloopinstrformprep pass

Fix a FIXME in ppcloopinstrformprep pass.

Reviewed by: nemanjai

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

4 weeks ago[libomptarget][nvptx] Fix build, second symbol reordering
JonChesterfield [Thu, 19 Dec 2019 02:00:26 +0000 (02:00 +0000)]
[libomptarget][nvptx] Fix build, second symbol reordering

4 weeks ago[analysis] Re-discard type sugar when casting values retrieved from the Store.
Artem Dergachev [Thu, 19 Dec 2019 01:59:16 +0000 (17:59 -0800)]
[analysis] Re-discard type sugar when casting values retrieved from the Store.

Canonicalization was accidentally omitted in 6d3f43ec.

4 weeks ago[libomptarget][nvptx] Fix build, symbol ordering in target_impl.h
Jon Chesterfield [Thu, 19 Dec 2019 01:50:06 +0000 (01:50 +0000)]
[libomptarget][nvptx] Fix build, symbol ordering in target_impl.h

4 weeks agoDebugInfo: Include DW_AT_base_addr even in gmlt with no inline functions
David Blaikie [Thu, 19 Dec 2019 01:10:24 +0000 (17:10 -0800)]
DebugInfo: Include DW_AT_base_addr even in gmlt with no inline functions

Since the address pool doesn't get populated in this case (due to the
lack of inlining, no child DIEs are added to the CU - so no addresses
are needed for the DIEs themselves) until the range list is emitted - at
the time the attributes are added to the CU, the address pool is empty.
So check whether the address pool will be used for the range lists & add
an addr_base if that's the case.

4 weeks ago[clang] Remove -Wexperimental-float-control.
Jordan Rupprecht [Thu, 19 Dec 2019 00:44:53 +0000 (16:44 -0800)]
[clang] Remove -Wexperimental-float-control.

Summary: Per D62731, the behavior of clang with `-frounding-math` is no worse than when the rounding flag was completely ignored, so remove this unnecessary warning.

Reviewers: mibintc, chandlerc, echristo, rjmccall, kpn, erichkeane, rsmith, andrew.w.kaylor

Reviewed By: mibintc

Subscribers: merge_guards_bot, cfe-commits

Tags: #clang

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

4 weeks ago[lldb/Scripting] Simplify code by removing the #if.
Jonas Devlieghere [Thu, 19 Dec 2019 00:42:07 +0000 (16:42 -0800)]
[lldb/Scripting] Simplify code by removing the #if.

The "none" script interpreter does not depend on Python so it doesn't
make sense to have it withing the if-block. The only goal seems to be to
have a slightly different error for when there's no script interpreter,
but as per the comment this doesn't make sense for more than one
scripting language. I think the existing error is perfectly clear, so I
just removed this altogether.

4 weeks ago[Remarks][Driver] Place temporary remark files next to temporary object files
Francis Visoiu Mistrih [Wed, 18 Dec 2019 23:55:30 +0000 (15:55 -0800)]
[Remarks][Driver] Place temporary remark files next to temporary object files

On Darwin, when used for generating a linked binary from a source file
(through an intermediate object file), the driver will invoke `cc1` to
generate a temporary object file. The temporary remark file will now be
emitted next to the object file, which will then be picked up by
`dsymutil` and emitted in the .dSYM bundle.

This is available for all formats except YAML since by default, YAML
doesn't need a section and the remark file will be lost.

4 weeks ago[Docs] Fix indentation in remarks section
Francis Visoiu Mistrih [Wed, 18 Dec 2019 23:27:21 +0000 (15:27 -0800)]
[Docs] Fix indentation in remarks section

4 weeks agoDebugInfo: Don't use implicit zero addr_base
David Blaikie [Thu, 19 Dec 2019 00:19:17 +0000 (16:19 -0800)]
DebugInfo: Don't use implicit zero addr_base

(found when LLVM fails to emit addr_base for gmlt+DWARFv5)

4 weeks agoReapply "NFC: DebugInfo: Refactor RangeSpanList to be a struct, like DebugLocStream...
David Blaikie [Mon, 16 Dec 2019 23:19:25 +0000 (15:19 -0800)]
Reapply "NFC: DebugInfo: Refactor RangeSpanList to be a struct, like DebugLocStream::List"

Move these data structures closer together so their emission code can
eventually share more of its implementation.

Was an egregious bug (completely untested, evidently) where I hadn't
inverted a DWARFv5 test as needed, so it was doing the exact opposite of
what was required & thus tried to emit a DWARFv5 range list header in

Reapply 8e04896288d22ed8bef7ac367923374f96b753d6 which was
reverted in a8154e5e0c83d2f0f65f3b4fb1a0bc68785bd975.

4 weeks ago[compiler-rt] [fuzzer] Enable LSan in libFuzzer tests on NetBSD
Kamil Rytarowski [Thu, 19 Dec 2019 00:15:03 +0000 (01:15 +0100)]
[compiler-rt] [fuzzer] Enable LSan in libFuzzer tests on NetBSD

4 weeks agomake err msg in MachSymtabSectionInfo::GetSection clear about the file
Jason Molenda [Thu, 19 Dec 2019 00:11:06 +0000 (16:11 -0800)]
make err msg in MachSymtabSectionInfo::GetSection clear about the file

This error message didn't specify which file was malformed, so
there's some hunting-around required if it comes up.  We have the
filename; include it in the error message.

4 weeks ago[compiler-rt] [fuzzer] Include stdarg.h for va_list
Kamil Rytarowski [Thu, 19 Dec 2019 00:08:26 +0000 (01:08 +0100)]
[compiler-rt] [fuzzer] Include stdarg.h for va_list

Fixes build on NetBSD after 139e216e6610091b7ee3c30bc11114f5d73cbd3e.

4 weeks ago[libomptarget][amdgcn] Correct return type of extern __clock64 to unsigned
JonChesterfield [Thu, 19 Dec 2019 00:11:21 +0000 (00:11 +0000)]
[libomptarget][amdgcn] Correct return type of extern __clock64 to unsigned

4 weeks ago[lldb/test] Move script interpreter tests
Jonas Devlieghere [Wed, 18 Dec 2019 23:41:07 +0000 (15:41 -0800)]
[lldb/test] Move script interpreter tests

Create a new test for lldb launched without a script interpreter and
move it under a new `ScriptInterpreter` directory. Also move
crashlog.test there for consistency.

4 weeks ago[WebAssembly] Add avgr_u intrinsics and require nuw in patterns
Thomas Lively [Wed, 18 Dec 2019 05:53:46 +0000 (21:53 -0800)]
[WebAssembly] Add avgr_u intrinsics and require nuw in patterns

The vector pattern `(a + b + 1) / 2` was previously selected to an
avgr_u instruction regardless of nuw flags, but this is incorrect in
the case where either addition may have an unsigned wrap. This CL
changes the existing pattern to require both adds to have nuw flags
and adds builtin functions and intrinsics for the avgr_u instructions
because the corrected pattern is not representable in C.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 weeks ago[Docs] Fix a typo
Yuanfang Chen [Wed, 18 Dec 2019 23:19:01 +0000 (15:19 -0800)]
[Docs] Fix a typo

4 weeks agoRevert "[Orc][LLJIT] Use JITLink even if a custom JITTargetMachineBuilder is supplied."
Lang Hames [Wed, 18 Dec 2019 23:13:35 +0000 (15:13 -0800)]
Revert "[Orc][LLJIT] Use JITLink even if a custom JITTargetMachineBuilder is supplied."

This reverts commit 298e183e813c884dd22816383405bae3ef9ef278.

This commit caused some build failures -- reverting while I investigate.

4 weeks agoRevert concepts changes from D41910
Vedant Kumar [Wed, 18 Dec 2019 22:52:51 +0000 (14:52 -0800)]
Revert concepts changes from D41910

These changes caused LibcxxVariantDataFormatterTestCase in lldb to fail
with an assert:

Assertion failed: (Idx < size() && "Out-of-bounds Bit access."),
function operator[], file
line 452.


7  clang-10                 0x00000001094b79d9 isAtLeastAsSpecializedAs(clang::Sema&, clang::SourceLocation, clang::FunctionTemplateDecl*, clang::FunctionTemplateDecl*, clang::TemplatePartialOrderingContext, unsigned int) + 1865
8  clang-10                 0x00000001094b7111 clang::Sema::getMoreSpecializedTemplate(clang::FunctionTemplateDecl*, clang::FunctionTemplateDecl*, clang::SourceLocation, clang::TemplatePartialOrderingContext, unsigned int, unsigned int) + 97
9  clang-10                 0x000000010939bf88 clang::isBetterOverloadCandidate(clang::Sema&, clang::OverloadCandidate const&, clang::OverloadCandidate const&, clang::SourceLocation, clang::OverloadCandidateSet::CandidateSetKind) + 1128

Revert "[Concepts] Fix incorrect move out of temporary in D41910"

This reverts commit 11d5fa6e87e3584f72056ecc2b17f88c58323dde.

Revert "[Concepts] Fix crash in D41910"

This reverts commit 12038be20ee6a903cdbd3fddce65535ef683e31d.

Revert "[Concepts] Constrained partial specializations and function overloads."

This reverts commit fc0731b98a67c793862288f8ae334322666214dc.

4 weeks ago[X86] Add a simple hack to IsProfitableToFold to prevent vselect+strict fp operations...
Craig Topper [Wed, 18 Dec 2019 22:24:20 +0000 (14:24 -0800)]
[X86] Add a simple hack to IsProfitableToFold to prevent vselect+strict fp operations from being folded into masked instructions.

We really need to update the isel patterns to prevent this, but
that requires some tablegen de-tangling. So this hack will work
for correctness in the short term.

4 weeks ago[X86] Add test case to show incorrect formation of masked add from vselect+strict_fadd.
Craig Topper [Wed, 18 Dec 2019 22:19:55 +0000 (14:19 -0800)]
[X86] Add test case to show incorrect formation of masked add from vselect+strict_fadd.

The masked operation will suppress exceptions on masked out lanes.
But that's not what vselect+strict_fadd means.

4 weeks agoAdd method to ignore invisible AST nodes
Stephen Kelly [Sat, 4 May 2019 15:51:58 +0000 (16:51 +0100)]
Add method to ignore invisible AST nodes

Reviewers: aaron.ballman

Subscribers: mgorny, cfe-commits

Tags: #clang

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

4 weeks agoTrim trailing whitespace
Stephen Kelly [Wed, 18 Dec 2019 22:12:10 +0000 (22:12 +0000)]
Trim trailing whitespace

4 weeks agoOutput names in the AST in tests
Stephen Kelly [Wed, 18 Dec 2019 21:50:50 +0000 (21:50 +0000)]
Output names in the AST in tests

4 weeks ago[Remarks][Driver] Run dsymutil when remarks are enabled
Francis Visoiu Mistrih [Wed, 18 Dec 2019 19:13:46 +0000 (11:13 -0800)]
[Remarks][Driver] Run dsymutil when remarks are enabled

When clang is invoked with a source file without -c or -S, it creates a
cc1 job, a linker job and if debug info is requested, a dsymutil job. In
case of remarks, we should also create a dsymutil job to avoid losing
the remarks that will be generated in a tempdir that gets removed.

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

4 weeks ago[Remarks][Driver][NFC] Make shouldEmitRemarks more available in the Driver
Francis Visoiu Mistrih [Wed, 18 Dec 2019 21:16:09 +0000 (13:16 -0800)]
[Remarks][Driver][NFC] Make shouldEmitRemarks more available in the Driver

Move the function to Driver.h so that it can be re-used in other places.

4 weeks ago[analyzer] Teach MismatchedDealloc about initWithBytesNoCopy with deallocator.
Artem Dergachev [Wed, 18 Dec 2019 21:19:44 +0000 (13:19 -0800)]
[analyzer] Teach MismatchedDealloc about initWithBytesNoCopy with deallocator.

MallocChecker warns when memory is passed into -[NSData initWithBytesNoCopy]
but isn't allocated by malloc(), because it will be deallocated by free().
However, initWithBytesNoCopy has an overload that takes an arbitrary block
for deallocating the object. If such overload is used, it is no longer
necessary to make sure that the memory is allocated by malloc().

4 weeks agoAdd prototype for a function we call.
Jason Molenda [Wed, 18 Dec 2019 22:18:22 +0000 (14:18 -0800)]
Add prototype for a function we call.

4 weeks ago[Orc][LLJIT] Use JITLink even if a custom JITTargetMachineBuilder is supplied.
Lang Hames [Mon, 16 Dec 2019 10:45:51 +0000 (02:45 -0800)]
[Orc][LLJIT] Use JITLink even if a custom JITTargetMachineBuilder is supplied.

LLJITBuilder will now use JITLink on supported platforms even if a custom
JITTargetMachineBuilder is supplied, provided that neither the code model,
nor the relocation model, nor the ObjectLinkingLayerCreator is set.

4 weeks agoRefactor CompareReferenceRelationship and its callers in preparation for
Richard Smith [Wed, 18 Dec 2019 22:01:40 +0000 (14:01 -0800)]
Refactor CompareReferenceRelationship and its callers in preparation for
implementing the resolution of CWG2352.

No functionality change, except that we now convert the referent of a
reference binding to the underlying type of the reference in more cases;
we used to happen to preserve the type sugar from the referent if the
only type change was in the cv-qualifiers.

This exposed a bug in how we generate code for trivial assignment
operators: if the type sugar (particularly the may_alias attribute)
got lost during reference binding, we'd use the "wrong" TBAA information
for the load during the assignment.

4 weeks agoUse hasOffsetApplied to initialize member HasOffsetApplied
Akira Hatanaka [Wed, 18 Dec 2019 21:54:30 +0000 (13:54 -0800)]
Use hasOffsetApplied to initialize member HasOffsetApplied

This is NFC since none of the constructor calls in trunk pass

4 weeks agoMove TypeSourceInfo to Type.h
Reid Kleckner [Sat, 7 Dec 2019 00:10:28 +0000 (16:10 -0800)]
Move TypeSourceInfo to Type.h

TypeSourceInfo is a thin wrapper around TypeLocs. Notionally, the best
place for it to live would be TypeLoc.h, but Decl.h requires it to be
complete, so it needs to be lower in the dependency graph. Type.h seems
like the next best place.

By itself, this change has no impact on build time, because it doesn't
remove a single dependency edge from a .cpp file to a .h file, but it is
an incremental step towards making the AST headers less interdependent.

Reviewers: rsmith

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

4 weeks agoSupport powerpc when builing without init_array.
Sterling Augustine [Wed, 18 Dec 2019 19:15:32 +0000 (11:15 -0800)]
Support powerpc when builing without init_array.

Summary: Also add an error case when targetting an unimplement architecture.

Subscribers: nemanjai, jsji, shchenz, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 weeks ago(no commit message)
Jan Kratochvil [Wed, 18 Dec 2019 21:35:11 +0000 (22:35 +0100)]

4 weeks ago(no commit message)
Jan Kratochvil [Wed, 18 Dec 2019 21:35:01 +0000 (22:35 +0100)]

4 weeks ago[clang-tools-extra] Fix linking dylib for LLVMFrontendOpenMP
Michał Górny [Wed, 18 Dec 2019 21:10:20 +0000 (22:10 +0100)]
[clang-tools-extra] Fix linking dylib for LLVMFrontendOpenMP

Use LLVM_LINK_COMPONENTS to link the FrontendOpenMP library
instead of passing it explicitly to LINK_LIBS.  This fixes duplicating
the library when clang-tidy is linked to LLVM dylib.

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

4 weeks agoChange triple in test case to not include triples the test shouldn't
Amy Huang [Wed, 18 Dec 2019 21:15:13 +0000 (13:15 -0800)]
Change triple in test case to not include triples the test shouldn't
This is fixes changes from a85f5efd9597d0036f5c347b362cb873bdf51f16.

4 weeks ago[gn build] Update console print to match the commit message (NFC)
Mehdi Amini [Wed, 18 Dec 2019 21:11:24 +0000 (16:11 -0500)]
[gn build] Update console print to match the commit message (NFC)

4 weeks agoRevert "[InstCombine][AMDGPU] Trim more components of *buffer_load"
Piotr Sobczak [Wed, 18 Dec 2019 21:01:04 +0000 (22:01 +0100)]
Revert "[InstCombine][AMDGPU] Trim more components of *buffer_load"

Revert D70315, as it breaks gfx8 for some reason.

This reverts commit 65f94b33808d7d69539961a6f5a2168f0a1eef41.

4 weeks agoTweak commit message for auto update of gn build script
Mehdi Amini [Wed, 18 Dec 2019 20:55:27 +0000 (15:55 -0500)]
Tweak commit message for auto update of gn build script

Use `[tag]` as a prefix and "port" instead of "merge" to
avoid confusing with "git merge".

4 weeks ago[lldb/MachO] "Fix" intentional out-of-bounds error (NFC)
Jonas Devlieghere [Wed, 18 Dec 2019 20:49:46 +0000 (12:49 -0800)]
[lldb/MachO] "Fix" intentional out-of-bounds error (NFC)

Remove the hack that populates the cpsr register in the gpr struct by
writing past the end of the array. This was tripping up ASan.

Patch by: Reva Cuthbertson

4 weeks ago[FPEnv] Strict versions of llvm.minimum/llvm.maximum
Ulrich Weigand [Wed, 18 Dec 2019 20:33:10 +0000 (21:33 +0100)]
[FPEnv] Strict versions of llvm.minimum/llvm.maximum

Add new intrinsics
as strict versions of llvm.minimum and llvm.maximum.

Includes SystemZ back-end support.

Reviewed By: craig.topper

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

4 weeks ago[libunwind] Fix evaluating DWARF operation DW_OP_pick
Steven Wu [Wed, 18 Dec 2019 20:22:21 +0000 (12:22 -0800)]
[libunwind] Fix evaluating DWARF operation DW_OP_pick

reg is unsigned type and used here for getting array element from the end by
negating it. negation of unsigned can result in large number and array access
with that index will result in segmentation fault.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=43872

Patched by: kamlesh kumar

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

4 weeks agoCorrect version check 9.9.26 -> 9.99.26
Kamil Rytarowski [Wed, 18 Dec 2019 20:03:17 +0000 (21:03 +0100)]
Correct version check 9.9.26 -> 9.99.26

4 weeks ago[analyzer] NonnullGlobalConstants: Add support for kCFNull.
Artem Dergachev [Wed, 18 Dec 2019 20:04:18 +0000 (12:04 -0800)]
[analyzer] NonnullGlobalConstants: Add support for kCFNull.

It's a singleton in CoreFoundation that always contains a non-null CFNullRef.

4 weeks ago[libomptarget][nfc] Introduce atomic wrapper function
Jon Chesterfield [Wed, 18 Dec 2019 20:06:16 +0000 (20:06 +0000)]
[libomptarget][nfc] Introduce atomic wrapper function

[libomptarget][nfc] Introduce atomic wrapper function

Wraps atomic functions in a template prefixed __kmpc_atomic that
dispatches to cuda or hip atomic functions. Intended to be easily extended
to dispatch to OpenCL or C++ atomics for a third target.

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: jdoerfert

Subscribers: Anastasia, jvesely, mgrang, dexonsmith, llvm-commits, mgorny, jfb, openmp-commits

Tags: #openmp, #llvm

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

4 weeks ago[LoopFusion] Use the LoopInfo::isRotatedForm method (NFC).
Kit Barton [Mon, 16 Dec 2019 21:37:30 +0000 (16:37 -0500)]
[LoopFusion] Use the LoopInfo::isRotatedForm method (NFC).

Loop fusion previously had a method to check whether a loop was in rotated form. This method has
been moved into the LoopInfo class. This patch removes the old isRotated method from loop fusion,
in favour of the new one in LoopInfo.

4 weeks ago[InstCombine] Insert instructions before adding them to worklist
Jakub Kuderski [Wed, 18 Dec 2019 19:55:41 +0000 (14:55 -0500)]
[InstCombine] Insert instructions before adding them to worklist

This patch adds instructions to the InstCombine worklist after they are properly inserted. This way we don't get `<badref>`s printed when logging added instructions.
It also adds a check in `Worklist::Add` that ensures that all added instructions have parents.

Simple test case that illustrates the difference when run with `--debug-only=instcombine`:

define i32 @test35(i32 %a, i32 %b) {
  %1 = or i32 %a, 1135
  %2 = or i32 %1, %b
  ret i32 %2

Before this patch:
IC: ADDING: 3 instrs to worklist
IC: Visiting:   %1 = or i32 %a, 1135
IC: Visiting:   %2 = or i32 %1, %b
IC: ADD:   %2 = or i32 %a, %b
IC: Old =   %3 = or i32 %1, %b
    New =   <badref> = or i32 %2, 1135
IC: ADD:   <badref> = or i32 %2, 1135

With this patch:
IC: ADDING: 3 instrs to worklist
IC: Visiting:   %1 = or i32 %a, 1135
IC: Visiting:   %2 = or i32 %1, %b
IC: ADD:   %2 = or i32 %a, %b
IC: Old =   %3 = or i32 %1, %b
    New =   <badref> = or i32 %2, 1135
IC: ADD:   %3 = or i32 %2, 1135

Reviewers: fhahn, davide, spatel, foad, grosser, nikic

Reviewed By: nikic

Subscribers: nikic, lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

4 weeks ago[Concepts] Fix incorrect move out of temporary in D41910
Saar Raz [Wed, 18 Dec 2019 19:43:53 +0000 (21:43 +0200)]
[Concepts] Fix incorrect move out of temporary in D41910

Moves out of temporaries caused warnings that failed builds.

4 weeks ago[libomptarget][nfc] Extract function from data_sharing, move to common
JonChesterfield [Wed, 18 Dec 2019 19:39:34 +0000 (19:39 +0000)]
[libomptarget][nfc] Extract function from data_sharing, move to common

[libomptarget][nfc] Extract function from data_sharing, move to common

Finding the first active thread in the warp is different on nvptx and amdgcn,
mostly due to warp size and the desire for efficiency.

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: jdoerfert

Subscribers: jvesely, mgorny, openmp-commits

Tags: #openmp

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

4 weeks ago[NFC] Update FIXME for one VFS test
Adrian McCarthy [Wed, 4 Dec 2019 21:11:02 +0000 (13:11 -0800)]
[NFC] Update FIXME for one VFS test

The VFS/subframework-symlink.m test is still XFAIL on Windows, but for
a different reason than those fixed in PR43272, so I've updated the
PR number.

4 weeks agoFix more VFS tests on Windows
Adrian McCarthy [Mon, 25 Nov 2019 23:57:21 +0000 (15:57 -0800)]
Fix more VFS tests on Windows

Since VFS paths can be in either Posix or Windows style, we have to use
a more flexible definition of "absolute" path.

The key here is that FileSystem::makeAbsolute is now virtual, and the
RedirectingFileSystem override checks for either concept of absolute
before trying to make the path absolute by combining it with the current

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

4 weeks ago[Concepts] Fix crash in D41910
Saar Raz [Wed, 18 Dec 2019 19:31:33 +0000 (21:31 +0200)]
[Concepts] Fix crash in D41910

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

4 weeks ago(no commit message)
Jan Kratochvil [Wed, 18 Dec 2019 19:20:40 +0000 (20:20 +0100)]

4 weeks agoRevert "[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant"
Danilo Carvalho Grael [Wed, 18 Dec 2019 19:01:38 +0000 (14:01 -0500)]
Revert "[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant"

This reverts commit 830e08b98bcb427136443093c282b25328137cf0 and eb1857ce0da481caf82271e6d0c9fc745dfab26f.

This commit leads to an unexpected failure on test/CodeGen/AArch64/sve-gather-scatter-dag-combine.ll.

The review will need more changes before its re-commited.

4 weeks ago[Clang FE, SystemZ] Don't add "true" value for the "mnop-mcount" attribute.
Jonas Paulsson [Wed, 18 Dec 2019 18:12:41 +0000 (10:12 -0800)]
[Clang FE, SystemZ]  Don't add "true" value for the "mnop-mcount" attribute.

Let the "mnop-mcount" function attribute simply be present or non-present.
Update SystemZ backend as well to use hasFnAttribute() instead.

Review: Ulrich Weigand

4 weeks ago[Concepts] Constrained partial specializations and function overloads.
Saar Raz [Wed, 18 Dec 2019 18:59:01 +0000 (20:59 +0200)]
[Concepts] Constrained partial specializations and function overloads.

Added support for constraint satisfaction checking and partial ordering of constraints in constrained partial specialization and function template overloads.

Phabricator: D41910

4 weeks ago[InstCombine] Allow to limit the max number of iterations
Jakub Kuderski [Wed, 18 Dec 2019 18:48:54 +0000 (13:48 -0500)]
[InstCombine] Allow to limit the max number of iterations

This patch teaches InstCombine to accept a new parameter: maximum number of iterations over functions.

InstCombine tries to simplify instructions by iterating over the whole function until the function stops changing. As a consequence, the last iteration before reaching a fixpoint visits all instructions in the worklist and never performs any rewrites.

Bounding the number of iterations can have 2 benefits:
* In case the users of the pass can make a good guess about the number of required iterations, we can save the time normally spent on the last iteration that doesn't change anything.
* When the wants to use InstCombine as a cleanup pass, it may be enough to run just a few iterations and stop even before reaching a fixpoint. This can be also useful for implementing a lightweight pass pipeline (think `-O1`).

This patch does not change the behavior of opt or Clang -- limiting the number of iterations is entirely opt-in.

Reviewers: fhahn, davide, spatel, foad, nlopes, grosser, lebedev.ri, nikic, xbolva00

Reviewed By: spatel

Subscribers: craig.topper, hiraditya, llvm-commits

Tags: #llvm

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

4 weeks agollvm-cxxmap: fix support for remapping non-mangled names.
Richard Smith [Wed, 18 Dec 2019 18:44:29 +0000 (10:44 -0800)]
llvm-cxxmap: fix support for remapping non-mangled names.

Remappings involving extern "C" names were already supported in the
context of <local-name>s, but this support didn't work for remapping the
complete mangling itself. (Eg, we would remap X<foo> but not foo itself,
if foo is an extern "C" function.)

4 weeks ago[SelectionDAGBuilder] Use getConstant instead of getTargetConstant to build the offse...
Craig Topper [Wed, 18 Dec 2019 18:41:34 +0000 (10:41 -0800)]
[SelectionDAGBuilder] Use getConstant instead of getTargetConstant to build the offset for struct types in getUniformBase.

getTargetConstant prevents any optimizations from operating on the
value and basically says its already been iseled. But since we
want the index to be in a register, this isn't true.

Prior to this we were generating a vbroadcast with an immediate
argument which is illegal and was flagged by the expensive checks

4 weeks ago[PowerPC][NFC] Refactor splat of constant to vector.
Stefan Pintilie [Wed, 18 Dec 2019 18:19:04 +0000 (12:19 -0600)]
[PowerPC][NFC] Refactor splat of constant to vector.

Refactor the splatting of a constant to a vector so that common code is used
both for Power9 and Power8.

Patch by: Anil Mahmud

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

4 weeks agoAdd support for the MS qualifiers __ptr32, __ptr64, __sptr, __uptr.
Amy Huang [Thu, 24 Oct 2019 23:34:25 +0000 (16:34 -0700)]
Add support for the MS qualifiers __ptr32, __ptr64, __sptr, __uptr.

This adds parsing of the qualifiers __ptr32, __ptr64, __sptr, and __uptr and
lowers them to the corresponding address space pointer for 32-bit and 64-bit pointers.
(32/64-bit pointers added in https://reviews.llvm.org/D69639)

A large part of this patch is making these pointers ignore the address space
when doing things like overloading and casting.


Reviewers: rnk, rsmith

Subscribers: jholewinski, jvesely, nhaehnle, cfe-commits

Tags: #clang

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

4 weeks ago[AArch64][SVE] Fix gather scatter dag combine test.
Danilo Carvalho Grael [Wed, 18 Dec 2019 18:44:25 +0000 (13:44 -0500)]
[AArch64][SVE] Fix gather scatter dag combine test.

4 weeks ago[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant
Danilo Carvalho Grael [Tue, 17 Dec 2019 15:42:52 +0000 (10:42 -0500)]
[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant

Summary: Replace the integer immediate intrisics with splat vector variants so they can be applied as optimizations for the C/C++ intrinsics.

Reviewers: sdesmalen, huntergr, rengolin, efriedma, c-rhodes, mgudim, kmclaughlin

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits, amehsan

Tags: #llvm

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

4 weeks ago[ MC ] Match labels to existing fragments even when switching sections.
Michael Trent [Wed, 11 Dec 2019 18:42:37 +0000 (10:42 -0800)]
[ MC ] Match labels to existing fragments even when switching sections.

(This commit restores the original branch (4272372c571) and applies an
additional change dropped from the original in a bad merge. This change
should address the previous bot failures. Both changes reviewed by pete.)

This commit builds upon Derek Schuff's 2014 commit for attaching labels to
existing fragments ( Diff Revision: http://reviews.llvm.org/D5915 )

When temporary labels appear ahead of a fragment, MCObjectStreamer will
track the temporary label symbol in a "Pending Labels" list. Labels are
associated with fragments when a real fragment arrives; otherwise, an empty
data fragment will be created if the streamer's section changes or if the
stream finishes.

This commit moves the "Pending Labels" list into each MCStream, so that
this label-fragment matching process is resilient to section changes. If
the streamer emits a label in a new section, switches to another section to
do other work, then switches back to the first section and emits a
fragment, that initial label will be associated with this new fragment.
Labels will only receive empty data fragments in the case where no other
fragment exists for that section.

The downstream effects of this can be seen in Mach-O relocations. The
previous approach could produce local section relocations and external
symbol relocations for the same data in an object file, and this mix of
relocation types resulted in problems in the ld64 Mach-O linker. This
commit ensures relocations triggered by temporary labels are consistent.

Reviewers: pete, ab, dschuff

Reviewed By: pete, dschuff

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 weeks agoMerge remote-tracking branch 'origin/master' into addr2
Jan Kratochvil [Wed, 18 Dec 2019 17:30:14 +0000 (18:30 +0100)]
Merge remote-tracking branch 'origin/master' into addr2

4 weeks ago(no commit message)
Jan Kratochvil [Wed, 18 Dec 2019 17:29:59 +0000 (18:29 +0100)]

4 weeks ago(no commit message)
Jan Kratochvil [Wed, 18 Dec 2019 17:26:30 +0000 (18:26 +0100)]

4 weeks ago[AArch64] add tests for bitcasted DUPLANE; NFC
Sanjay Patel [Wed, 18 Dec 2019 16:55:26 +0000 (11:55 -0500)]
[AArch64] add tests for bitcasted DUPLANE; NFC

See D63815 for context/motivation.

4 weeks agoRevert "Add an -fno-temp-file flag for compilation"
Mitch Phillips [Wed, 18 Dec 2019 17:05:09 +0000 (09:05 -0800)]
Revert "Add an -fno-temp-file flag for compilation"

This reverts commit d129aa1d5369781deff6c6b854cb612e160d3fb2.

This broke the MSan buildbots. More information available in the
original PR: https://reviews.llvm.org/D70615

4 weeks ago[NFC] Fix sanitizer lint problem that's breaking Android bot.
Mitch Phillips [Wed, 18 Dec 2019 16:47:31 +0000 (08:47 -0800)]
[NFC] Fix sanitizer lint problem that's breaking Android bot.

Fixes the lint issue introduced by

4 weeks agoFix modules build by adding missing includes to LTO/Config.h
Raphael Isemann [Wed, 18 Dec 2019 16:42:58 +0000 (17:42 +0100)]
Fix modules build by adding missing includes to LTO/Config.h

4 weeks agoReapply: [DebugInfo] Correctly handle salvaged casts and split fragments at ISel
stozer [Wed, 18 Dec 2019 14:28:24 +0000 (14:28 +0000)]
Reapply: [DebugInfo] Correctly handle salvaged casts and split fragments at ISel

This reverts commit 1f3dd83cc1f2b8f72b9d59e2b4221b12fb7f9a95, reapplying
commit bb1b0bc4e57428ce364d3d6c075ff03cb8973462.

The original commit failed on some builds seemingly due to the use of a
bracketed constructor with an std::array, i.e. `std::array<> arr({...})`.

4 weeks ago[llvm-exegesis][NFC] internal changes
Guillaume Chatelet [Wed, 18 Dec 2019 11:08:38 +0000 (12:08 +0100)]
[llvm-exegesis][NFC] internal changes

BitVectors are now cached to lower memory utilization.
Instructions have reference semantics.

Reviewers: courbet

Subscribers: sdardis, tschuett, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

4 weeks ago[compiler-rt] [test] Disable ASLR on UBSAN+[AMT]SAN tests on NetBSD
Michał Górny [Wed, 18 Dec 2019 16:20:40 +0000 (17:20 +0100)]
[compiler-rt] [test] Disable ASLR on UBSAN+[AMT]SAN tests on NetBSD

4 weeks ago[compiler-rt] [test] Disable ASLR on LSAN+ASAN tests on NetBSD
Michał Górny [Wed, 18 Dec 2019 16:07:34 +0000 (17:07 +0100)]
[compiler-rt] [test] Disable ASLR on LSAN+ASAN tests on NetBSD

4 weeks ago[NFC][InlineCost] Run clang-format on InlineCost.cpp
Mircea Trofin [Wed, 18 Dec 2019 15:56:47 +0000 (07:56 -0800)]
[NFC][InlineCost] Run clang-format on InlineCost.cpp

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: Jim, eraman, hiraditya, haicheng, llvm-commits

Tags: #llvm

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

4 weeks ago[AArch64] update test checks; NFC
Sanjay Patel [Wed, 18 Dec 2019 16:00:38 +0000 (11:00 -0500)]
[AArch64] update test checks; NFC

The common prefix reduces a bunch of replication; not sure why it
didn't happen before.

4 weeks agogn build: Merge 9883d7edc65
LLVM GN Syncbot [Wed, 18 Dec 2019 16:00:24 +0000 (16:00 +0000)]
gn build: Merge 9883d7edc65