platform/upstream/llvm.git
5 years agoIntroduce `AddressSpaceView` template parameter to `CombinedAllocator`.
Dan Liew [Fri, 21 Dec 2018 21:22:27 +0000 (21:22 +0000)]
Introduce `AddressSpaceView` template parameter to `CombinedAllocator`.

Summary:
This is a follow up to https://reviews.llvm.org/D55764 .

For the ASan and LSan allocatorsthe type declarations have been modified
so that it's possible to create a combined allocator type that
consistently uses a different type of `AddressSpaceView`. We intend to
use this in future patches. For the other sanitizers they just use
`LocalAddressSpaceView` by default because we have no plans to use these
allocators in an out-of-process manner.

rdar://problem/45284065

Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov, yln

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 349957

5 years ago[X86] Don't allow optimizeCompareInstr to replace a CMP with BEXTR if the sign flag...
Craig Topper [Fri, 21 Dec 2018 21:16:26 +0000 (21:16 +0000)]
[X86] Don't allow optimizeCompareInstr to replace a CMP with BEXTR if the sign flag is used.

The BEXTR instruction documents the SF bit as undefined.

The TBM BEXTR instruction has the same issue, but I'm not sure how to test it. With the control being an immediate we can determine the sign bit is 0 or the BEXTR would have been removed.

Fixes PR40060

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

llvm-svn: 349956

5 years agoSwitch from static_cast<> to cast<>, update identifier for coding conventions; NFC.
Aaron Ballman [Fri, 21 Dec 2018 21:11:36 +0000 (21:11 +0000)]
Switch from static_cast<> to cast<>, update identifier for coding conventions; NFC.

llvm-svn: 349955

5 years agoIntroduce `AddressSpaceView` template parameter to `SizeClassAllocator64`.
Dan Liew [Fri, 21 Dec 2018 21:09:31 +0000 (21:09 +0000)]
Introduce `AddressSpaceView` template parameter to `SizeClassAllocator64`.

Summary:
This is a follow up patch to r349138.

This patch makes a `AddressSpaceView` a type declaration in the
allocator parameters used by `SizeClassAllocator64`. For ASan, LSan, and
the unit tests the AP64 declarations have been made templated so that
`AddressSpaceView` can be changed at compile time. For the other
sanitizers we just hard-code `LocalAddressSpaceView` because we have no
plans to use these allocators in an out-of-process manner.

rdar://problem/45284065

Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 349954

5 years ago[clang-tidy] Be more liberal about literal zeroes in abseil checks
Hyrum Wright [Fri, 21 Dec 2018 21:07:11 +0000 (21:07 +0000)]
[clang-tidy] Be more liberal about literal zeroes in abseil checks

Summary:
Previously, we'd only match on literal floating or integral zeroes, but I've now also learned that some users spell that value as int{0} or float{0}, which also need to be matched.

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

llvm-svn: 349953

5 years agoConvert some ObjC retain/release msgSends to runtime calls.
Pete Cooper [Fri, 21 Dec 2018 21:00:32 +0000 (21:00 +0000)]
Convert some ObjC retain/release msgSends to runtime calls.

It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions.

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

Reviewed By: rjmccall

llvm-svn: 349952

5 years agoAMDGPU: Don't peel of the offset if the resulting base could possibly be negative...
Changpeng Fang [Fri, 21 Dec 2018 20:57:34 +0000 (20:57 +0000)]
AMDGPU: Don't peel of the offset if the resulting base could possibly be negative in Indirect addressing.

Summary:
  Don't peel of the offset if the resulting base could possibly be negative in Indirect addressing.
This is because the M0 field is of unsigned.

This patch achieves the similar goal as https://reviews.llvm.org/D55241, but keeps the optimization
if the base is known unsigned.

Reviewers:
  arsemn

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

llvm-svn: 349951

5 years ago[TextAPI][elfabi] Fix YAML support for weak symbols
Armando Montanez [Fri, 21 Dec 2018 20:45:58 +0000 (20:45 +0000)]
[TextAPI][elfabi] Fix YAML support for weak symbols

Weak symbols are supposed to be supported in the ELF TextAPI
implementation, but the YAML handler didn't read or write the `Weak`
member of ELFSymbol. This change adds the YAML mapping and updates tests
to ensure correct behavior.

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

llvm-svn: 349950

5 years ago[Sema][NFC] Fix a Wimplicit-fallthrough warning in CheckSpecializationInstantiationRedecl
Bruno Ricci [Fri, 21 Dec 2018 20:38:06 +0000 (20:38 +0000)]
[Sema][NFC] Fix a Wimplicit-fallthrough warning in CheckSpecializationInstantiationRedecl

All cases are covered so add an llvm_unreachable. NFC.

llvm-svn: 349949

5 years ago[AST][NFC] Remove stale comment in CXXRecordDecl::is(Virtually)DerivedFrom.
Bruno Ricci [Fri, 21 Dec 2018 20:23:07 +0000 (20:23 +0000)]
[AST][NFC] Remove stale comment in CXXRecordDecl::is(Virtually)DerivedFrom.

The "this" capture was removed in r291939.

llvm-svn: 349948

5 years ago[libcxx] Remove unused macro _LIBCPP_HAS_UNIQUE_TYPEINFO
Louis Dionne [Fri, 21 Dec 2018 20:14:43 +0000 (20:14 +0000)]
[libcxx] Remove unused macro _LIBCPP_HAS_UNIQUE_TYPEINFO

Summary:
We already have the negation of that as _LIBCPP_HAS_NONUNIQUE_TYPEINFO.
Having both defined is confusing, since only one of them is used.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 349947

5 years ago[lldbsuite] Skip flakey Windows tests
Stella Stamenova [Fri, 21 Dec 2018 20:10:45 +0000 (20:10 +0000)]
[lldbsuite] Skip flakey Windows tests

Skip a number of tests on Windows that are flakey and will pass/fail unexpectedly every dozen or so runs.

llvm-svn: 349946

5 years ago[BasicAA] Fix AA bug on dynamic allocas and stackrestore
Reid Kleckner [Fri, 21 Dec 2018 19:59:03 +0000 (19:59 +0000)]
[BasicAA] Fix AA bug on dynamic allocas and stackrestore

Summary:
BasicAA has special logic for unescaped allocas, which normally applies
equally well to dynamic and static allocas. However, llvm.stackrestore
has the power to end the lifetime of dynamic allocas, without referring
to them directly.

stackrestore is already marked with the most conservative memory
modification attributes, but because the alloca is not escaped, the
normal logic produces incorrect results. I think BasicAA needs a special
case here to teach it about the relationship between dynamic allocas and
stackrestore.

Fixes PR40118

Reviewers: gbiv, efriedma, george.burgess.iv

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 349945

5 years ago[RuntimeUnrolling] NFC: Add TODO and comments in connectProlog
Anna Thomas [Fri, 21 Dec 2018 19:45:05 +0000 (19:45 +0000)]
[RuntimeUnrolling] NFC: Add TODO and comments in connectProlog

Currently, runtime unrolling does not support loops where multiple
exiting blocks exit to the latchExit. Added TODO and other code
clarifications for ConnectProlog code.

llvm-svn: 349944

5 years ago[analyzer] Tests quickfix.
George Karpenkov [Fri, 21 Dec 2018 19:40:44 +0000 (19:40 +0000)]
[analyzer] Tests quickfix.

llvm-svn: 349943

5 years agoRemove stat cache chaining as it's no longer needed after PTH support has been
Alex Lorenz [Fri, 21 Dec 2018 19:33:09 +0000 (19:33 +0000)]
Remove stat cache chaining as it's no longer needed after PTH support has been
removed

Stat cache chaining was implemented for a StatListener in the PTH writer so that
it could write out the stat information to PTH. r348266 removed support for PTH,
and it doesn't seem like there are other uses of stat cache chaining. We can
remove the chaining support.

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

llvm-svn: 349942

5 years agoAdd a doc for missing key function and an error message referencing the doc.
Rui Ueyama [Fri, 21 Dec 2018 19:28:49 +0000 (19:28 +0000)]
Add a doc for missing key function and an error message referencing the doc.

Summary:
This is a common error, and because many people don't know what the key
function is, it is sometimes very confusing.

The doc was originally written by Brooks Moses and slightly edited by me.

Reviewers: MaskRay, espindola

Subscribers: emaste, llvm-commits, arichardson

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

llvm-svn: 349941

5 years agoSwitch from cast<> to dyn_cast<>.
Aaron Ballman [Fri, 21 Dec 2018 19:16:38 +0000 (19:16 +0000)]
Switch from cast<> to dyn_cast<>.

This avoids a potential failed assertion that is happening on someone's out-of-tree build.

llvm-svn: 349940

5 years agoRevert "Revert rL349876 from cfe/trunk: [analyzer] Perform escaping in RetainCountChe...
George Karpenkov [Fri, 21 Dec 2018 19:13:40 +0000 (19:13 +0000)]
Revert "Revert rL349876 from cfe/trunk: [analyzer] Perform escaping in RetainCountChecker on type mismatch even for inlined functions"

This reverts commit b44b33f6e020a2c369da2b0c1d53cd52975f2526.

Revert the revert with the fix.

llvm-svn: 349939

5 years ago[analyzer] Correct the summary violation diagnostics for the retain count checker
George Karpenkov [Fri, 21 Dec 2018 19:13:28 +0000 (19:13 +0000)]
[analyzer] Correct the summary violation diagnostics for the retain count checker

It should be in the past tense.

llvm-svn: 349938

5 years ago[x86] add movddup specialization for build vector lowering (PR37502)
Sanjay Patel [Fri, 21 Dec 2018 18:48:32 +0000 (18:48 +0000)]
[x86] add movddup specialization for build vector lowering (PR37502)

This is admittedly a narrow fix for the problem:
https://bugs.llvm.org/show_bug.cgi?id=37502
...but as the XOP restriction shows, it's a maze to get this right.
In the motivating example, note that we have movddup before SSE4.1 and
again with AVX2. That's because insertps isn't available pre-SSE41 and
vbroadcast is (more generally) available with AVX2 (and the splat is
reduced to movddup via isel pattern).

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

llvm-svn: 349937

5 years ago[ARM] Set Defs = [CPSR] for COPY_STRUCT_BYVAL, as it clobbers CPSR.
Florian Hahn [Fri, 21 Dec 2018 18:07:10 +0000 (18:07 +0000)]
[ARM] Set Defs = [CPSR] for COPY_STRUCT_BYVAL, as it clobbers CPSR.

Fixes PR35023.

Reviewers: MatzeB, t.p.northover, sunfish, qcolombet, efriedma

Reviewed By: efriedma

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

llvm-svn: 349935

5 years ago[AST][NFC] Fix Wsign-compare warning introduced in CXXOperatorCallExpr
Bruno Ricci [Fri, 21 Dec 2018 17:54:51 +0000 (17:54 +0000)]
[AST][NFC] Fix Wsign-compare warning introduced in CXXOperatorCallExpr

llvm-svn: 349934

5 years ago[Sema][NFC] Fix Wimplicit-fallthrough warning in getCursorKindForDecl
Bruno Ricci [Fri, 21 Dec 2018 17:52:13 +0000 (17:52 +0000)]
[Sema][NFC] Fix Wimplicit-fallthrough warning in getCursorKindForDecl

All cases are covered so add an llvm_unreachable. NFC.

llvm-svn: 349933

5 years ago[NFC] Fix typo in comment
Louis Dionne [Fri, 21 Dec 2018 17:32:23 +0000 (17:32 +0000)]
[NFC] Fix typo in comment

llvm-svn: 349932

5 years ago[SelectionDAG] Remove KnownBits output paramater version.
Simon Pilgrim [Fri, 21 Dec 2018 17:29:38 +0000 (17:29 +0000)]
[SelectionDAG] Remove KnownBits output paramater version.

Completes the work started by @bogner in rL340594.

llvm-svn: 349931

5 years ago[clang-tidy] Add export-fixes flag to clang-tidy-diff
Julie Hockett [Fri, 21 Dec 2018 17:25:27 +0000 (17:25 +0000)]
[clang-tidy] Add export-fixes flag to clang-tidy-diff

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

llvm-svn: 349930

5 years ago[x86] remove excess check lines; NFC
Sanjay Patel [Fri, 21 Dec 2018 17:19:43 +0000 (17:19 +0000)]
[x86] remove excess check lines; NFC

Forgot that the integer variants have an extra 's'.

llvm-svn: 349929

5 years ago[x86] move misplaced tests; NFC
Sanjay Patel [Fri, 21 Dec 2018 17:06:43 +0000 (17:06 +0000)]
[x86] move misplaced tests; NFC

Mixed up integer and FP in rL349923.

llvm-svn: 349928

5 years ago[GlobalISel][AArch64] Add support for widening G_FCEIL
Jessica Paquette [Fri, 21 Dec 2018 17:05:26 +0000 (17:05 +0000)]
[GlobalISel][AArch64] Add support for widening G_FCEIL

This adds support for widening G_FCEIL in LegalizerHelper and
AArch64LegalizerInfo. More specifically, it teaches the AArch64 legalizer to
widen G_FCEIL from a 16-bit float to a 32-bit float when the subtarget doesn't
support full FP 16.

This also updates AArch64/f16-instructions.ll to show that we perform the
correct transformation.

llvm-svn: 349927

5 years agoDon't duplicate the logic that detects if a section can/should be loaded (NFC)
Greg Clayton [Fri, 21 Dec 2018 17:04:18 +0000 (17:04 +0000)]
Don't duplicate the logic that detects if a section can/should be loaded (NFC)

Prior to this there were 3 places that were duplicating the logic to detect if a section can/should be loaded and some were doing things a bit differently. Now it is all centralized in one place and it is done correctly.

llvm-svn: 349926

5 years ago[AST][NFC] Pack CXXOperatorCallExpr
Bruno Ricci [Fri, 21 Dec 2018 16:51:57 +0000 (16:51 +0000)]
[AST][NFC] Pack CXXOperatorCallExpr

Use the space available in the bit-fields of Stmt.
This saves 8 bytes per CXXOperatorCallExpr. NFC.

llvm-svn: 349924

5 years ago[x86] add tests for possible horizontal op transform; NFC
Sanjay Patel [Fri, 21 Dec 2018 16:49:41 +0000 (16:49 +0000)]
[x86] add tests for possible horizontal op transform; NFC

llvm-svn: 349923

5 years agoReleaseNotes: Document removal of add_llvm_loadable_module CMake macro
Tom Stellard [Fri, 21 Dec 2018 16:20:37 +0000 (16:20 +0000)]
ReleaseNotes: Document removal of add_llvm_loadable_module CMake macro

This was removed in r349839.

llvm-svn: 349921

5 years ago[x86] move test for movddup; NFC
Sanjay Patel [Fri, 21 Dec 2018 16:08:27 +0000 (16:08 +0000)]
[x86] move test for movddup; NFC

This adds an AVX512 run as suggested in D55936.
The test didn't really belong with other build vector tests
because that's not the pattern here. I don't see much value
in adding 64-bit RUNs because they wouldn't exercise the
isel patterns that we're aiming to expose.

llvm-svn: 349920

5 years ago[pstl] Initial integration with LLVM's CMake
Louis Dionne [Fri, 21 Dec 2018 15:59:04 +0000 (15:59 +0000)]
[pstl] Initial integration with LLVM's CMake

Summary:
This commit adds a check-pstl CMake target that will run the tests
we currently have for pstl. Those tests are not using LLVM lit yet,
but switching them over should be a transparent change. With this
change, we can start relying on the `check-pstl` target for workflows
and CI.

Note that this commit purposefully does not support the pre-monorepo
layout (with subprojects in projects/), since LLVM is moving towards
the monorepo layout anyway.

Reviewers: jfb

Subscribers: mgorny, jkorous, dexonsmith, libcxx-commits, mclow.lists, rodgert

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

llvm-svn: 349919

5 years ago[AArch64] Refactor Exynos predicate (NFC)
Evandro Menezes [Fri, 21 Dec 2018 15:51:34 +0000 (15:51 +0000)]
[AArch64] Refactor Exynos predicate (NFC)

Change order of conditions in predicate.

llvm-svn: 349918

5 years ago[Sanitizer] Move the unit test in the right place.
David Carlier [Fri, 21 Dec 2018 15:43:32 +0000 (15:43 +0000)]
[Sanitizer] Move the unit test in the right place.

llvm-svn: 349917

5 years ago[Sanitizer] Enable strtonum in FreeBSD
David Carlier [Fri, 21 Dec 2018 15:42:24 +0000 (15:42 +0000)]
[Sanitizer] Enable strtonum in FreeBSD

Reviewers: krytarowski, vitalybuka

Reviewed By: krytarowski

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

llvm-svn: 349916

5 years ago[XCore] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 15:35:32 +0000 (15:35 +0000)]
[XCore] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349915

5 years ago[Sparc] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 15:32:36 +0000 (15:32 +0000)]
[Sparc] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349914

5 years ago[AMDGPU] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 15:29:47 +0000 (15:29 +0000)]
[AMDGPU] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349912

5 years ago[WebAssembly] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 15:25:37 +0000 (15:25 +0000)]
[WebAssembly] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349911

5 years ago[AST] Store the callee and argument expressions of CallExpr in a trailing array.
Bruno Ricci [Fri, 21 Dec 2018 15:20:32 +0000 (15:20 +0000)]
[AST] Store the callee and argument expressions of CallExpr in a trailing array.

Since CallExpr::setNumArgs has been removed, it is now possible to store the
callee expression and the argument expressions of CallExpr in a trailing array.
This saves one pointer per CallExpr, CXXOperatorCallExpr, CXXMemberCallExpr,
CUDAKernelCallExpr and UserDefinedLiteral.

Given that CallExpr is used as a base of the above classes we cannot use
llvm::TrailingObjects. Instead we store the offset in bytes from the this pointer
to the start of the trailing objects and manually do the casts + arithmetic.

Some notes:

1.) I did not try to fit the number of arguments in the bit-fields of Stmt.
    This leaves some space for future additions and avoid the discussion about
    whether x bits are sufficient to hold the number of arguments.

2.) It would be perfectly possible to recompute the offset to the trailing
    objects before accessing the trailing objects. However the trailing objects
    are frequently accessed and benchmarks show that it is slightly faster to
    just load the offset from the bit-fields. Additionally, because of 1),
    we have plenty of space in the bit-fields of Stmt.

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

Reviewed By: rjmccall

llvm-svn: 349910

5 years ago[ARM] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 15:15:38 +0000 (15:15 +0000)]
[ARM] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349909

5 years ago[AArch64] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 15:05:10 +0000 (15:05 +0000)]
[AArch64] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349908

5 years ago[SelectionDAG] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 14:56:18 +0000 (14:56 +0000)]
[SelectionDAG] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349907

5 years ago[SystemZ] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 14:50:54 +0000 (14:50 +0000)]
[SystemZ] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349906

5 years ago[Lanai] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 14:48:35 +0000 (14:48 +0000)]
[Lanai] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349905

5 years ago[Sema][NFC] Remove some unnecessary calls to getASTContext.
Bruno Ricci [Fri, 21 Dec 2018 14:35:24 +0000 (14:35 +0000)]
[Sema][NFC] Remove some unnecessary calls to getASTContext.

The AST context is already easily available. NFC.

llvm-svn: 349904

5 years ago[PPC] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 14:32:39 +0000 (14:32 +0000)]
[PPC] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the KnownBits output paramater version.

llvm-svn: 349903

5 years ago[X86] Always use the version of computeKnownBits that returns a value. NFCI.
Simon Pilgrim [Fri, 21 Dec 2018 14:25:14 +0000 (14:25 +0000)]
[X86] Always use the version of computeKnownBits that returns a value. NFCI.

Continues the work started by @bogner in rL340594 to remove uses of the old KnownBits output paramater version.

llvm-svn: 349902

5 years ago[AST][NFC] Pass the AST context to one of the ctor of DeclRefExpr.
Bruno Ricci [Fri, 21 Dec 2018 14:10:18 +0000 (14:10 +0000)]
[AST][NFC] Pass the AST context to one of the ctor of DeclRefExpr.

All of the other constructors already take a reference to the AST context.
This avoids calling Decl::getASTContext in most cases. Additionally move
the definition of the constructor from Expr.h to Expr.cpp since it is calling
DeclRefExpr::computeDependence. NFC.

llvm-svn: 349901

5 years ago[AArch64] Adding missing REQUIRES in aarch64 dwarf test
Luke Cheeseman [Fri, 21 Dec 2018 13:39:13 +0000 (13:39 +0000)]
[AArch64] Adding missing REQUIRES in aarch64 dwarf test

llvm-svn: 349900

5 years ago[xray] [tests] Detect and handle missing LLVMTestingSupport gracefully
Michal Gorny [Fri, 21 Dec 2018 13:37:30 +0000 (13:37 +0000)]
[xray] [tests] Detect and handle missing LLVMTestingSupport gracefully

Add a code to properly test for presence of LLVMTestingSupport library
when performing a stand-alone build, and skip tests requiring it when
it is not present.  Since the library is not installed, llvm-config
reported empty --libs for it and the tests failed to link with undefined
references.  Skipping the two fdr_* test files is better than failing to
build, and should be good enough until we find a better solution.

NB: both installing LLVMTestingSupport and building it automatically
from within compiler-rt sources are non-trivial.  The former due to
dependency on gtest, the latter due to tight integration with LLVM
source tree.

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

llvm-svn: 349899

5 years ago[ADT] IntervalMap: add overlaps(a, b) method
Pavel Labath [Fri, 21 Dec 2018 13:04:34 +0000 (13:04 +0000)]
[ADT] IntervalMap: add overlaps(a, b) method

Summary:
This function checks whether the mappings in the interval map overlap
with the given range [a;b]. The motivation is to enable checking for
overlap before inserting a new interval into the map.

Reviewers: vsk, dblaikie

Subscribers: dexonsmith, kristina, llvm-commits

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

llvm-svn: 349898

5 years ago[CMake] Print out the list of sanitizers that the sanitizer_common tests will run...
Dan Liew [Fri, 21 Dec 2018 11:57:31 +0000 (11:57 +0000)]
[CMake] Print out the list of sanitizers that the sanitizer_common tests will run against.

Summary:
This is a change requested by Vitaly Buka as prerequisite to landing
https://reviews.llvm.org/D55740.

Reviewers: vitalybuka, kubamracek

Subscribers: mgorny, #sanitizers, llvm-commits

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

llvm-svn: 349897

5 years ago[NewPM] -print-module-scope -print-after now prints module even after invalidated...
Fedor Sergeev [Fri, 21 Dec 2018 11:49:05 +0000 (11:49 +0000)]
[NewPM] -print-module-scope -print-after now prints module even after invalidated Loop/SCC

-print-after IR printing generally can not print the IR unit (Loop or SCC)
which has just been invalidated by the pass. However, when working in -print-module-scope
mode even if Loop was invalidated there is still a valid module that we can print.

Since we can not access invalidated IR unit from AfterPassInvalidated instrumentation
point we can remember the module to be printed *before* pass. This change introduces
BeforePass instrumentation that stores all the information required for module printing
into the stack and then after pass (in AfterPassInvalidated) just print whatever
has been placed on stack.

Reviewed By: philip.pfaffe
Differential Revision: https://reviews.llvm.org/D55278

llvm-svn: 349896

5 years ago[Dwarf/AArch64] Return address signing B key dwarf support
Luke Cheeseman [Fri, 21 Dec 2018 10:45:08 +0000 (10:45 +0000)]
[Dwarf/AArch64] Return address signing B key dwarf support

- When signing return addresses with -msign-return-address=<scope>{+<key>},
  either the A key instructions or the B key instructions can be used. To
  correctly authenticate the return address, the unwinder/debugger must know
  which key was used to sign the return address.
- When and exception is thrown or a break point reached, it may be necessary to
  unwind the stack. To accomplish this, the unwinder/debugger must be able to
  first authenticate an the return address if it has been signed.
- To enable this, the augmentation string of CIEs has been extended to allow
  inclusion of a 'B' character. Functions that are signed using the B key
  variant of the instructions should have and FDE whose associated CIE has a 'B'
  in the augmentation string.
- One must also be able to preserve these semantics when first stepping from a
  high level language into assembly and then, as a second step, into an object
  file. To achieve this, I have introduced a new assembly directive
  '.cfi_b_key_frame ', that tells the assembler the current frame uses return
  address signing with the B key.
- This ensures that the FDE is associated with a CIE that has 'B' in the
  augmentation string.

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

llvm-svn: 349895

5 years agoRevert rL349876 from cfe/trunk: [analyzer] Perform escaping in RetainCountChecker...
Simon Pilgrim [Fri, 21 Dec 2018 10:11:23 +0000 (10:11 +0000)]
Revert rL349876 from cfe/trunk: [analyzer] Perform escaping in RetainCountChecker on type mismatch even for inlined functions

The fix done in D55465 did not previously apply when the function was inlined.

rdar://46889541

Differential Revision: https://reviews.llvm.org/D55976
........
Fixes broken buildbot: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14764

llvm-svn: 349894

5 years ago[clangd] Cleanup syntax errors in the test, NFC.
Haojian Wu [Fri, 21 Dec 2018 09:32:49 +0000 (09:32 +0000)]
[clangd] Cleanup syntax errors in the test, NFC.

llvm-svn: 349893

5 years ago[X86][SSE] Auto upgrade PADDS/PSUBS intrinsics to SADD_SAT/SSUB_SAT generic intrinsic...
Simon Pilgrim [Fri, 21 Dec 2018 09:04:14 +0000 (09:04 +0000)]
[X86][SSE] Auto upgrade PADDS/PSUBS intrinsics to SADD_SAT/SSUB_SAT generic intrinsics (llvm)

This auto upgrades the signed SSE saturated math intrinsics to SADD_SAT/SSUB_SAT generic intrinsics.

Clang counterpart: https://reviews.llvm.org/D55890

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

llvm-svn: 349892

5 years agoFix warning about unused variable [NFC]
Bjorn Pettersson [Fri, 21 Dec 2018 08:51:04 +0000 (08:51 +0000)]
Fix warning about unused variable [NFC]

llvm-svn: 349891

5 years ago[Sema] Produce diagnostics when C++17 aligned allocation/deallocation
Akira Hatanaka [Fri, 21 Dec 2018 07:05:36 +0000 (07:05 +0000)]
[Sema] Produce diagnostics when C++17 aligned allocation/deallocation
functions that are unavailable on Darwin are explicitly called or called
from deleting destructors.

rdar://problem/40736230

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

llvm-svn: 349890

5 years ago[WebAssembly] Fix invalid machine instrs in -O0, verify in tests
Thomas Lively [Fri, 21 Dec 2018 06:58:15 +0000 (06:58 +0000)]
[WebAssembly] Fix invalid machine instrs in -O0, verify in tests

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 349889

5 years agoFix test case breakages caused by lexically_relative change
Eric Fiselier [Fri, 21 Dec 2018 04:38:22 +0000 (04:38 +0000)]
Fix test case breakages caused by lexically_relative change

llvm-svn: 349888

5 years agoDon't forward declare _FilesystemClock in C++03
Eric Fiselier [Fri, 21 Dec 2018 04:30:04 +0000 (04:30 +0000)]
Don't forward declare _FilesystemClock in C++03

llvm-svn: 349887

5 years agoFix copy paste error in file_clock tests
Eric Fiselier [Fri, 21 Dec 2018 04:27:45 +0000 (04:27 +0000)]
Fix copy paste error in file_clock tests

llvm-svn: 349886

5 years agoImplement LWG 3096: path::lexically_relative is confused by trailing slashes
Eric Fiselier [Fri, 21 Dec 2018 04:25:40 +0000 (04:25 +0000)]
Implement LWG 3096: path::lexically_relative is confused by trailing slashes

path("/dir/").lexically_relative("/dir"); now returns "." instead of ""

llvm-svn: 349885

5 years agoImplement LWG 3065: Make path operators friends.
Eric Fiselier [Fri, 21 Dec 2018 04:09:01 +0000 (04:09 +0000)]
Implement LWG 3065: Make path operators friends.

This prevents things like:

using namespace std::filesystem;
auto x = L"a/b" == std::string("a/b");

llvm-svn: 349884

5 years agoImplement LWG 3145: file_clock breaks ABI for C++17 implementations.
Eric Fiselier [Fri, 21 Dec 2018 03:54:57 +0000 (03:54 +0000)]
Implement LWG 3145: file_clock breaks ABI for C++17 implementations.

This patch adds std::chrono::file_clock, but without breaking the
existing ABI for std::filesystem.

llvm-svn: 349883

5 years agoAMDGPU/GlobalISel: RegBankSelect for amdgcn.wqm.vote
Matt Arsenault [Fri, 21 Dec 2018 03:20:54 +0000 (03:20 +0000)]
AMDGPU/GlobalISel: RegBankSelect for amdgcn.wqm.vote

llvm-svn: 349882

5 years agoImplement LWG 2936: Path comparison is defined in terms of the generic format
Eric Fiselier [Fri, 21 Dec 2018 03:16:30 +0000 (03:16 +0000)]
Implement LWG 2936: Path comparison is defined in terms of the generic format

This patch implements path::compare according to the current spec. The
only observable change is the ordering of "/foo" and "foo", which orders
the two paths based on having or not having a root directory (instead
of lexically comparing "/" to "foo").

llvm-svn: 349881

5 years agoAMDGPU/GlobalISel: RegBankSelect for some fp ops
Matt Arsenault [Fri, 21 Dec 2018 03:14:45 +0000 (03:14 +0000)]
AMDGPU/GlobalISel: RegBankSelect for some fp ops

llvm-svn: 349880

5 years agoGlobalISel: Correct example PartialMapping table
Matt Arsenault [Fri, 21 Dec 2018 03:03:12 +0000 (03:03 +0000)]
GlobalISel: Correct example PartialMapping table

When I try to use this, it seems like the second half needs
to start where the previous part left off.

llvm-svn: 349879

5 years agoAMDGPU/GlobalISel: Redo legality for build_vector
Matt Arsenault [Fri, 21 Dec 2018 03:03:11 +0000 (03:03 +0000)]
AMDGPU/GlobalISel: Redo legality for build_vector

It seems better to avoid using the callback if possible since
there are coverage assertions which are disabled if this is used.

Also fix missing tests. Only test the legal cases since it seems
legalization for build_vector is quite lacking.

llvm-svn: 349878

5 years agoMark two filesystem LWG issues as complete - nothing to do
Eric Fiselier [Fri, 21 Dec 2018 02:17:00 +0000 (02:17 +0000)]
Mark two filesystem LWG issues as complete - nothing to do

llvm-svn: 349877

5 years ago[analyzer] Perform escaping in RetainCountChecker on type mismatch even for inlined...
George Karpenkov [Fri, 21 Dec 2018 02:16:36 +0000 (02:16 +0000)]
[analyzer] Perform escaping in RetainCountChecker on type mismatch even for inlined functions

The fix done in D55465 did not previously apply when the function was inlined.

rdar://46889541

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

llvm-svn: 349876

5 years ago[analyzer] Fix a bug in RetainCountDiagnostics while printing a note on mismatched...
George Karpenkov [Fri, 21 Dec 2018 02:16:23 +0000 (02:16 +0000)]
[analyzer] Fix a bug in RetainCountDiagnostics while printing a note on mismatched summary in inlined functions

Previously, we were not printing a note at all if at least one of the parameters was not annotated.

rdar://46888422

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

llvm-svn: 349875

5 years ago"help finish" tells you it is an alias. "help fin" doesn't.
Jim Ingham [Fri, 21 Dec 2018 01:45:28 +0000 (01:45 +0000)]
"help finish" tells you it is an alias.  "help fin" doesn't.

They both run the same command, and people get used to typing the shortest
string they can, so we should support alias info on shortened strings as well.

<rdar://problem/46859207>

llvm-svn: 349874

5 years ago[memcpyopt] Add debug logs when forwarding memcpy src to dst
Reid Kleckner [Fri, 21 Dec 2018 01:41:20 +0000 (01:41 +0000)]
[memcpyopt] Add debug logs when forwarding memcpy src to dst

llvm-svn: 349873

5 years ago[mingw] Don't mangle thiscall like fastcall etc
Reid Kleckner [Fri, 21 Dec 2018 01:40:29 +0000 (01:40 +0000)]
[mingw] Don't mangle thiscall like fastcall etc

GCC does not mangle it when it is not explicit in the source.  The
mangler as currently written cannot differentiate between explicit and
implicit calling conventions, so we can't match GCC. Explicit thiscall
conventions are rare, so mangle as if the convention was implicit to be
as ABI compatible as possible.

Also fixes some tests using %itanium_abi_triple in some configurations
as a side effect.

Fixes PR40107.

llvm-svn: 349872

5 years ago[LoopUnroll] Don't verify domtree by default with +Asserts.
Eli Friedman [Fri, 21 Dec 2018 01:28:49 +0000 (01:28 +0000)]
[LoopUnroll] Don't verify domtree by default with +Asserts.

This verification is linear in the size of the function, so it can cause
a quadratic compile-time explosion in a function with many loops to
unroll.

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

llvm-svn: 349871

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Fri, 21 Dec 2018 01:27:33 +0000 (01:27 +0000)]
[X86] Autogenerate complete checks. NFC

llvm-svn: 349870

5 years agoFix stack-buffer-overflow in lldb_private::Host::FindProcesses (2/2)
Jonas Devlieghere [Fri, 21 Dec 2018 01:22:58 +0000 (01:22 +0000)]
Fix stack-buffer-overflow in lldb_private::Host::FindProcesses (2/2)

This fixes the second call at line 640 that I missed in r349858.

llvm-svn: 349869

5 years ago[X86] Refactor hasNoCarryFlagUses and hasNoSignFlagUses in X86ISelDAGToDAG.cpp to...
Craig Topper [Fri, 21 Dec 2018 01:14:25 +0000 (01:14 +0000)]
[X86] Refactor hasNoCarryFlagUses and hasNoSignFlagUses in X86ISelDAGToDAG.cpp to tranlate opcode to condition code using the helpers in X86InstrInfo.cpp.

This shortens the switches in X86ISelDAGToDAG.cpp to only need to check condition code instead of a list of opcodes.

This also fixes a bug where the memory forms of SETcc were missing from hasNoCarryFlagUses.

llvm-svn: 349868

5 years ago[X86] Add memory forms of some SETCC instructions to hasNoCarryFlagUses.
Craig Topper [Fri, 21 Dec 2018 01:14:23 +0000 (01:14 +0000)]
[X86] Add memory forms of some SETCC instructions to hasNoCarryFlagUses.

Found while working on another patch

llvm-svn: 349867

5 years ago[driver] [analyzer] Fix --analyze -Xanalyzer after r349863.
Artem Dergachev [Fri, 21 Dec 2018 01:11:21 +0000 (01:11 +0000)]
[driver] [analyzer] Fix --analyze -Xanalyzer after r349863.

If an -analyzer-config is passed through -Xanalyzer, it is not found while
looking for -Xclang.

Additionally, don't emit -analyzer-config-compatibility-mode for *every*
-analyzer-config flag we encounter; one is enough.

https://reviews.llvm.org/D55823

rdar://problem/46504165

llvm-svn: 349866

5 years agoAdd an assertion to aid in tracking down a bug
Adrian Prantl [Fri, 21 Dec 2018 01:09:15 +0000 (01:09 +0000)]
Add an assertion to aid in tracking down a bug

llvm-svn: 349865

5 years agoRemove ineffective (misspelled) sanitizer option
Adrian Prantl [Fri, 21 Dec 2018 01:09:14 +0000 (01:09 +0000)]
Remove ineffective (misspelled) sanitizer option

llvm-svn: 349864

5 years agoRevert "Revert "[driver] [analyzer] Fix a backward compatibility issue after r348038.""
George Karpenkov [Fri, 21 Dec 2018 00:26:19 +0000 (00:26 +0000)]
Revert "Revert "[driver] [analyzer] Fix a backward compatibility issue after r348038.""

This reverts commit 144927939587b790c0536f4ff08245043fc8d733.

Fixes the bug in the original commit.

llvm-svn: 349863

5 years ago[analyzer] RetainCount: Suppress retain detection heuristic on some CM methods.
Artem Dergachev [Fri, 21 Dec 2018 00:18:58 +0000 (00:18 +0000)]
[analyzer] RetainCount: Suppress retain detection heuristic on some CM methods.

If it ends with "Retain" like CFRetain and returns a CFTypeRef like CFRetain,
then it is not necessarily a CFRetain. But it is indeed true that these two
return something retained.

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

rdar://problem/39390714

llvm-svn: 349862

5 years agoFix typo
Adrian Prantl [Thu, 20 Dec 2018 23:50:32 +0000 (23:50 +0000)]
Fix typo

llvm-svn: 349861

5 years agoRemove dead code.
Rui Ueyama [Thu, 20 Dec 2018 23:47:39 +0000 (23:47 +0000)]
Remove dead code.

This code is no-op because of r349849.

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

llvm-svn: 349859

5 years agoFix stack-buffer-overflow in lldb_private::Host::FindProcesses
Jonas Devlieghere [Thu, 20 Dec 2018 23:45:26 +0000 (23:45 +0000)]
Fix stack-buffer-overflow in lldb_private::Host::FindProcesses

Found by the address sanitizer on GreenDragon:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/1628/console

llvm-svn: 349858

5 years ago[ARM] Complete the Thumb1 shift+and->shift+shift transforms.
Eli Friedman [Thu, 20 Dec 2018 23:39:54 +0000 (23:39 +0000)]
[ARM] Complete the Thumb1 shift+and->shift+shift transforms.

This saves materializing the immediate.  The additional forms are less
common (they don't usually show up for bitfield insert/extract), but
they're still relevant.

I had to add a new target hook to prevent DAGCombine from reversing the
transform. That isn't the only possible way to solve the conflict, but
it seems straightforward enough.

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

llvm-svn: 349857

5 years ago[lldb] Add a "display-recognized-arguments" target setting to show recognized argumen...
Kuba Mracek [Thu, 20 Dec 2018 23:38:19 +0000 (23:38 +0000)]
[lldb] Add a "display-recognized-arguments" target setting to show recognized arguments by default

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

llvm-svn: 349856

5 years ago[NativePDB] Create VarDecls for global variables.
Zachary Turner [Thu, 20 Dec 2018 23:32:37 +0000 (23:32 +0000)]
[NativePDB] Create VarDecls for global variables.

Previously we would create these for local variables but not for
global variables.

Also updated existing tests which created global variables to check
for them in the resulting AST.

llvm-svn: 349854

5 years ago[CodeGen] Fix a test from r349848 by replacing `objc_` with `llvm.objc.`
Volodymyr Sapsai [Thu, 20 Dec 2018 23:26:29 +0000 (23:26 +0000)]
[CodeGen] Fix a test from r349848 by replacing `objc_` with `llvm.objc.`

llvm-svn: 349853

5 years agoRevert "[asan] Disable test on powerpc64be"
Vitaly Buka [Thu, 20 Dec 2018 23:25:26 +0000 (23:25 +0000)]
Revert "[asan] Disable test on powerpc64be"

Now the test is passing on that bot. Some incremental build issues?

This reverts commit e00b5a5229ae02088d9f32a4e328eaa08abaf354.

llvm-svn: 349852