Commit Graph

314898 Commits

Author SHA1 Message Date
Adrian Prantl 0d809aa218 [dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.
When a Swift module built with debug info imports a library without
debug info from a textual interface, the textual interface is
necessary to reconstruct types defined in the library's interface. By
recording the Swift interface files in DWARF dsymutil can collect them
and LLDB can find them.

This patch teaches dsymutil to look for DW_TAG_imported_modules and
records all references to parseable Swift ingterfrace files and copies
them to

  a.out.dSYM/Contents/Resources/<Arch>/<ModuleName>.swiftinterface

<rdar://problem/49751748>

llvm-svn: 358921
2019-04-22 21:33:22 +00:00
Philip Reames d748689c7f [InstCombine] Eliminate stores to constant memory
If we have a store to a piece of memory which is known constant, then we know the store must be storing back the same value. As a result, the store (or memset, or memmove) must either be down a dead path, or a noop. In either case, it is valid to simply remove the store.

The motivating case for this involves a memmove to a buffer which is constant down a path which is dynamically dead.

Note that I'm choosing to implement the less aggressive of two possible semantics here. We could simply say that the store *is undefined*, and prune the path. Consensus in the review was that the more aggressive form might be a good follow on change at a later date.

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

llvm-svn: 358919
2019-04-22 20:28:19 +00:00
Davide Italiano 2a27af8237 [EditLineTest] Not always TERM is available, e.g. on some bots.
llvm-svn: 358918
2019-04-22 20:27:10 +00:00
Joel E. Denny 906b264251 [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen
Previously, it was only documented by `-cc1 -help`, so people weren't
aware of it, as discussed in D60732.

Reviewed By: Charusso, NoQ

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

llvm-svn: 358917
2019-04-22 20:25:06 +00:00
Jonas Devlieghere 32176baee7 [Reproducers] Fix lifetime issue
Deallocating the data recorder in during the ::Keep() operation causes
problems down the line when exiting the debugger. The command
interpreter still holds a pointer to the now deallocated object and has
no way to know it no longer exists. This is exactly what the m_record
flag was meant for, although it wasn't hooked up properly either.

llvm-svn: 358916
2019-04-22 20:05:02 +00:00
Petr Hosek e9a2d1c392 [libcxx] Update gen_link_script.py to support different input and output
This enables the use of this script from other build systems like
GN which don't support post-build actions as well as for static
archives.

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

llvm-svn: 358915
2019-04-22 19:51:33 +00:00
Bob Haarman 2eea99a4b9 [Support] unflake TempFileCollisions test
Summary:
This test was added to verify that createUniqueEntity() does
not enter an infinite loop when all possible names are taken. However,
it also checked that all possible names are generated, which is flaky
(because the names are generated randomly). This change increases the
number of attempts we make to make flakes exceedingly
unlikely (3.88e-62).

Reviewers: fedor.sergeev, rsmith

Reviewed By: fedor.sergeev

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 358914
2019-04-22 19:46:25 +00:00
Philip Reames d8d9b7b20e [InstSimplify] Move masked.gather w/no active lanes handling to InstSimplify from InstCombine
In the process, use the existing masked.load combine which is slightly stronger, and handles a mix of zero and undef elements in the mask.  

llvm-svn: 358913
2019-04-22 19:30:01 +00:00
Nico Weber 5828421c7c gn build: Merge r358869
llvm-svn: 358912
2019-04-22 19:25:40 +00:00
Dimitry Andric 87e7f895bb Use correct way to test for MIPS arch after rOMP355687
Summary:
I ran into some issues after rOMP355687, where __atomic_fetch_add was
being used incorrectly on x86, and this turns out to be caused by the
following added conditionals:

```
#if defined(KMP_ARCH_MIPS)
```

The problem is, these macros are always defined, and are either 0 or 1
depending on the architecture.  E.g. the correct way to test for MIPS
is:

```
#if KMP_ARCH_MIPS
```

Reviewers: petarj, jlpeyton, Hahnfeld, AndreyChurbanov

Reviewed By: petarj, AndreyChurbanov

Subscribers: AndreyChurbanov, sdardis, arichardson, atanasyan, jfb, jdoerfert, openmp-commits, llvm-commits

Tags: #openmp

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

llvm-svn: 358911
2019-04-22 19:20:46 +00:00
Matt Arsenault 2b74466530 Use const DebugLoc&
llvm-svn: 358910
2019-04-22 19:14:27 +00:00
Matt Arsenault f84ce75cd1 AMDGPU: Skip debug instructions in assert
These are inserted after branch relaxation, and for some reason it's
decided to put them in the long branch expansion block. It's probably
not great to rely on the source block address, so this should probably
be switched to being PC relative instead of relying on the block
address

llvm-svn: 358909
2019-04-22 19:14:26 +00:00
Casey Carter e3f7074c7e [libc++][test] Update some wstring_convert tests for MSVC quirks
Due to MSVC's decision to encode `wchar_t` as UTF-16, it rejects wide
character/string literals that expect a character value greater than
`\xffff`. UTF-16 `wchar_t` is clearly non-conforming, given that the
standard requires wchar_t to be capable of representing all characters
in the supported wide character execution sets, but rejecting e.g.
`\x40003` is a reasonably sane compromise given that encoding choice:
there's an expectation that `\xFOO` produces a single character in the
resulting literal. Consequently `L'\x40003'`/`L"\x40003"` are ill-formed
literals on MSVC. `L'\U00040003'` is a high surrogate (and produces a
warning about ignoring the "second character" in a multi-character
literal), and `L"\U00040003"` is a perfectly-valid `const wchar_t[3]`.

This change updates these tests to use universal-character-names instead
of raw values for the intended character values, which technically makes
them portable even to implementations that don't use a unicode
transformation format encoding for their wide character execution
character set. The two-character literal `L"\u1005e"` is awkward - the
`e` looks like part of the UCN's hex encoding - but necessary to compile
in '03 mode since '03 didn't allow UCNs to be used for members of the
basic execution character set even in character/string literals.

I've also eliminated the extraneous `\x00` "bonus null-terminator" in
some of the string literals which doesn't affect the tested behavior.

I'm sorry about using `*L"\U00040003"` in `conversions.string/to_bytes.pass.cpp`,
but it's correct for platforms with 32-bit wchar_t, *and* doesn't
trigger narrowing warnings as did the prior `CharT(0x40003)`.

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

llvm-svn: 358908
2019-04-22 19:08:13 +00:00
Philip Reames f01583d097 [Tests] Revise a test as requested by reviewer in D59703
llvm-svn: 358907
2019-04-22 18:51:58 +00:00
Philip Reames 8f47089034 [Tests] Add a negative test for masked.gather part of D59703
llvm-svn: 358906
2019-04-22 18:28:44 +00:00
Ben Hamilton a282bde69e [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, `isClassMethod`, and `isInstanceMethod`
Summary:
isClassMessage is an equivalent to isInstanceMessage for ObjCMessageExpr, but matches message expressions to classes.

isClassMethod and isInstanceMethod check whether a method declaration (or definition) is for a class method or instance method (respectively).

Contributed by @mywman!

Reviewers: benhamilton, klimek, mwyman

Reviewed By: benhamilton, mwyman

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 358904
2019-04-22 17:54:11 +00:00
Justin Bogner e90d5c8db0 [IPSCCP] Add missing `AssumptionCacheTracker` dependency
Back in August, r340525 introduced a dependency on the assumption
cache tracker in the ipsccp pass, but that commit missed a call to
INITIALIZE_PASS_DEPENDENCY, which leaves the assumption cache
improperly registered if SCCP is the only thing that pulls it in.

llvm-svn: 358903
2019-04-22 17:38:29 +00:00
Alexey Bataev 5de5d74c8d [OPENMP][NVPTX] Fix the test, NFC.
Fix the test to run it really in SPMD mode without runtime. Previously
it was run in SPMD + full runtime mode and does not allow to cehck the
functionality correctly.

llvm-svn: 358902
2019-04-22 17:25:31 +00:00
Philip Reames 37104d7189 [LPM/BPI] Preserve BPI through trivial loop pass pipeline (e.g. LCSSA, LoopSimplify)
Currently, we do not expose BPI to loop passes at all. In the old pass manager, we appear to have been ignoring the fact that LCSSA and/or LoopSimplify didn't preserve BPI, and making it available to the following loop passes anyways.  In the new one, it's invalidated before running any loop pass if either LCSSA or LoopSimplify actually make changes. If they don't make changes, then BPI is valid and available.  So, we go ahead and teach LCSSA and LoopSimplify how to preserve BPI for consistency between old and new pass managers.

This patch avoids an invalidation between the two requires in the following trivial pass pipeline:
opt -passes="requires<branch-prob>,loop(no-op-loop),requires<branch-prob>"
(when the input file is one which requires either LCSSA or LoopSimplify to canonicalize the loops)

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

llvm-svn: 358901
2019-04-22 17:13:43 +00:00
Wei Mi 01f8d556aa [PGO/SamplePGO][NFC] Move the function updateProfWeight from Instruction
to CallInst.

The issue was raised here: https://reviews.llvm.org/D60903#1472783

The function Instruction::updateProfWeight is only used for CallInst in
profile update. From the current interface, it is very easy to think that
the function can also be used for branch instruction. However, Branch
instruction does't need the scaling the function provides for
branch_weights and VP (value profile), in addition, scaling may introduce
inaccuracy for branch probablity.

The patch moves the function updateProfWeight from Instruction class to
CallInst to remove the confusion. The patch also changes the scaling of
branch_weights from a loop to a block because we know that ProfileData
for branch_weights of CallInst will only have two operands at most.

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

llvm-svn: 358900
2019-04-22 17:04:51 +00:00
Sam Clegg 7cdec273dd [WebAssembly] Error on relocations against undefined data symbols.
We can't (currently) meaningfully resolve certain types of relocations
against undefined data symbols.  Previously when `--allow-undefined` was
used we were treating such relocation much like weak data symbols and
simply inserting zeros.  This change turns such use cases in to an
error.

This means that `--allow-undefined` is no longer effective for data
symbols.

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

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

llvm-svn: 358899
2019-04-22 16:12:54 +00:00
Matt Davis 55043e2336 [sema][objc] Minor refactor to OverrideSearch. NFCI.
Summary:
* Removed a member that was only used during construction.
* Use range-based for iteration when accessing the result of the search.
* Require an `ObjCMethodDecl` reference upon construction of an
* Constify.

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: llvm-commits

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

llvm-svn: 358898
2019-04-22 16:04:44 +00:00
Fangrui Song a5355a5ed1 Use llvm::stable_sort. NFC
llvm-svn: 358897
2019-04-22 15:53:43 +00:00
Louis Dionne 4256cf1b04 [NFC] Fix typo in debug log
llvm-svn: 358896
2019-04-22 15:40:50 +00:00
Aaron Ballman f033617974 Remove spurious semicolons; NFC.
llvm-svn: 358895
2019-04-22 15:31:09 +00:00
Matt Arsenault 2b6f76f05f AMDGPU/GlobalISel: Fix non-power-of-2 G_EXTRACT sources
llvm-svn: 358894
2019-04-22 15:22:46 +00:00
Fangrui Song 75fbd1c604 STLExtras: add stable_sort wrappers
llvm-svn: 358893
2019-04-22 15:19:13 +00:00
Matt Arsenault 8f624abc1d GlobalISel: Legalize scalar G_EXTRACT sources
llvm-svn: 358892
2019-04-22 15:10:42 +00:00
Nico Weber f5c7f3ad33 llvm-undname: Fix an assert-on-invalid, found by oss-fuzz
llvm-svn: 358891
2019-04-22 15:05:18 +00:00
Matt Arsenault 70346d127b AMDGPU: Fix not checking for copy when looking at copy src
Effectively reverts r356956. The check for isFullCopy was excessive,
but there still needs to be a check that this is a copy.

llvm-svn: 358890
2019-04-22 14:54:39 +00:00
George Rimar 81ffc08a8a [LLD][ELF] - Remove a binary from the inputs. NFCI.
section-index.elf was removed and the corresponding test
was replaced with a yaml2obj based test.

llvm-svn: 358889
2019-04-22 14:53:32 +00:00
Dmitry Preobrazhensky e2707f5aac [AMDGPU][MC] Corrected parsing of SP3 'neg' modifier
See bug 41156: https://bugs.llvm.org/show_bug.cgi?id=41156

Reviewers: artem.tamazov, arsenm

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

llvm-svn: 358888
2019-04-22 14:35:47 +00:00
Simon Pilgrim 6276ce0142 [TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast handling
This patch adds support for BigBitWidth -> SmallBitWidth bitcasts, splitting the DemandedBits/Elts accordingly.

The AMDGPU backend needed an extra  (srl (and x, c1 << c2), c2) -> (and (srl(x, c2), c1) combine to encourage BFE creation, I investigated putting this in DAGCombine but it caused a lot of noise on other targets - some improvements, some regressions.

The X86 changes are all definite wins.

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

llvm-svn: 358887
2019-04-22 14:04:35 +00:00
Sanjay Patel 9bc6c77220 [DAGCombiner] make variable name less ambiguous; NFC
llvm-svn: 358886
2019-04-22 13:42:50 +00:00
George Rimar 3275742898 [LLD][ELF] - Do not forget to use ch_addralign field after decompressing the sections.
LLD did not use ELF::Chdr::ch_addralign for decompressed sections.
This resulted in a broken output.

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

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

llvm-svn: 358885
2019-04-22 13:40:42 +00:00
Sanjay Patel d6989daae9 [DAGCombiner] prepare shuffle-of-splat to handle more patterns; NFC
llvm-svn: 358884
2019-04-22 13:36:07 +00:00
Robert Widmann ff8febcb6d [LLVM-C] Add accessors to the default floating-point metadata node
Summary: Add a getter and setter pair for floating-point accuracy metadata.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 358883
2019-04-22 13:13:22 +00:00
Bruno Ricci af3e50ad40 [Sema] ADL: Associated namespaces for class types and enumeration types (CWG 1691)
CWG 1691 changed the definition of the namespaces associated with a class
type or enumeration type.

For a class type, the associated namespaces are the innermost enclosing
namespaces of the associated classes. For an enumeration type, the associated
namespace is the innermost enclosing namespace of its declaration.

This also fixes CWG 1690 and CWG 1692.

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

Reviewed By: rjmccall, rsmith

llvm-svn: 358882
2019-04-22 12:19:00 +00:00
Bruno Ricci 1f30dba14d [Sema][NFC] Add more tests for the behavior of argument-dependent name lookup
The goal here is to exercise each rule in [basic.lookup.argdep] at least once.
These new tests expose what I believe are 2 issues:

1. CWG 1691 needs to be implemented (p2:  [...] Its associated namespaces are
   the innermost enclosing namespaces of its associated classes [...]) The
   corresponding tests are adl_class_type::X2 and adl_class_type::X5.

2. The end of paragraph 2 ([...] Additionally, if the aforementioned set of
   overloaded functions is named with a template-id, its associated classes
   and namespaces also include those of its type template-arguments and its
   template template-arguments.) is not implemented. Closely related, the
   restriction on non-dependent parameter types in this same paragraph needs
   to be removed. The corresponding tests are in adl_overload_set (both issues
   are from CWG 997).

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

Reviewed By: riccibruno, Quuxplusone

llvm-svn: 358881
2019-04-22 11:40:31 +00:00
Serguei Katkov 40a3b96196 [NewPM] Add Option handling for SimpleLoopUnswitch
This patch enables passing options to SimpleLoopUnswitch via the passes pipeline.

Reviewers: chandlerc, fedor.sergeev, leonardchan, philip.pfaffe
Reviewed By: fedor.sergeev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60676

llvm-svn: 358880
2019-04-22 10:35:07 +00:00
Simon Pilgrim ffd67233d4 [AMDGPU] Regenerate uitofp i8 to float conversion tests.
Prep work for D60462

llvm-svn: 358879
2019-04-22 10:19:09 +00:00
Serguei Katkov 5614f4a3a5 [NewPM] Add dummy Test for LoopVectorize option parsing.
llvm-svn: 358878
2019-04-22 09:53:26 +00:00
Kristof Umann 4aa387212b [analyzer][www] Moving MoveChecker out of alpha is no longer an open project.
llvm-svn: 358877
2019-04-22 09:20:23 +00:00
Nikita Popov 5aacc7a573 Revert "[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC"
This reverts commit 7bf4d7c07f2fac862ef34c82ad0fef6513452445.

After thinking about this more, this isn't right, the range is not exact
in the same sense as makeExactICmpRegion(). This needs a separate
function.

llvm-svn: 358876
2019-04-22 09:01:38 +00:00
Nikita Popov 5299e25f50 [ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC
Following D60632 makeGuaranteedNoWrapRegion() always returns an
exact nowrap region. Rename the function accordingly. This is in
line with the naming of makeExactICmpRegion().

llvm-svn: 358875
2019-04-22 08:36:05 +00:00
George Rimar f902250fc1 [LLD][ELF] - Handle quoted strings in the linker scripts correctly.
This is the https://bugs.llvm.org/show_bug.cgi?id=41356,

Seems it is kind of unusual case but it is possible to
have sections that require quotes for their namings.
Like "aaa bbb".

This patch adds support for those.

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

llvm-svn: 358874
2019-04-22 07:57:07 +00:00
Aleksandr Urakov ee12a75e38 [NativePDB] Add anonymous namespaces support
Summary:
This patch adds anonymous namespaces support to the native PDB plugin.

I had to reference from the main function variables of the types that are inside
of the anonymous namespace to include them in debug info. Without the references
they are not included. I think it's because they are static, then are visible
only in the current translation unit, so they are not needed without any
references to them.

There is also the problem case with variables of types that are nested in
template structs. For now I've left FIXME in the test because this case is not
related to the change.

Reviewers: zturner, asmith, labath, stella.stamenova, amccarth

Reviewed By: amccarth

Subscribers: zloyrobot, aprantl, teemperor, lldb-commits, leonid.mashinskiy

Tags: #lldb

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

llvm-svn: 358873
2019-04-22 07:14:40 +00:00
Craig Topper 5c43ab337f [X86] Reject 512-bit types in getRegForInlineAsmConstraint when AVX512 is not enabled. Same for 256 bit and AVX.
llvm-svn: 358872
2019-04-22 06:12:02 +00:00
Sam Clegg 7868fb6fdd [WebAssembly] Fix R_WASM_FUNCTION_OFFSET_I32 relocation warnings
We were incorrectly used the symbol table version of the function rather
than the object-local version when checking the existing relocation
value.

This was causing erroneous warnings for comat symbols defined in
multiple object.s

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

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

llvm-svn: 358871
2019-04-22 05:26:44 +00:00
Fangrui Song bc4b159bb1 [ELF][X86] Allow R_386_TLS_LDO_32 and R_X86_64_DTPOFF{32,64} to preemptable local-dynamic symbols
Summary:
Fixes PR35242. A simplified reproduce:

    thread_local int i; int f() { return i; }

% {g++,clang++} -fPIC -shared -ftls-model=local-dynamic -fuse-ld=lld a.cc
ld.lld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: i in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output

In isStaticLinkTimeConstant(), Syn.IsPreemptible is true, so it is not
seen as a constant. The error is then issued in processRelocAux().

A symbol of the local-dynamic TLS model cannot be preempted but it can
preempt symbols of the global-dynamic TLS model in other DSOs.
So it makes some sense that the variable is not static.

This patch fixes the linking error by changing getRelExpr() on
R_386_TLS_LDO_32 and R_X86_64_DTPOFF{32,64} from R_ABS to R_DTPREL.
R_PPC64_DTPREL_* and R_MIPS_TLS_DTPREL_* need similar fixes, but they are not handled in this patch.

As a bonus, we use `if (Expr == R_ABS && !Config->Shared)` to find
ld-to-le opportunities. R_ABS is overloaded here for such STT_TLS symbols.
A dedicated R_DTPREL is clearer.

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

llvm-svn: 358870
2019-04-22 03:10:40 +00:00