Matt Arsenault [Fri, 3 May 2019 13:42:55 +0000 (13:42 +0000)]
AMDGPU: Fix test verification
This should run the verifier, and needs to enable trackRegLiveness.
llvm-svn: 359882
Sanjay Patel [Fri, 3 May 2019 13:25:06 +0000 (13:25 +0000)]
[LICM] auto-generate complete test checks; NFC
llvm-svn: 359881
Sam McCall [Fri, 3 May 2019 13:17:29 +0000 (13:17 +0000)]
[clangd] Fix header-guard check for include insertion, and don't index header guards.
Summary:
Both of these attempt to check whether a header guard exists while parsing the
file. However the file is only marked as guarded once clang finishes processing
it. We defer the checks and work until SymbolCollector::finish().
This is ugly and ad-hoc, deferring *all* work might be cleaner.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61442
llvm-svn: 359880
Sanjay Patel [Fri, 3 May 2019 13:09:18 +0000 (13:09 +0000)]
[CodeGenPrepare] limit overflow intrinsic matching to a single basic block
Using/updating a dominator tree to match math overflow patterns may be very
expensive in compile-time (because of the way CGP uses a DT), so just handle
the single-block case.
Also, we were restarting the iterator loops when doing the overflow intrinsic
transforms by marking the dominator tree for update. That was done to prevent
iterating over a removed instruction. But we can postpone the deletion using
the existing "RemovedInsts" structure, and that means we don't need to update
the DT.
See post-commit thread for rL354298 for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20190422/646276.html
Differential Revision: https://reviews.llvm.org/D61075
llvm-svn: 359879
Sean Fertile [Fri, 3 May 2019 12:57:07 +0000 (12:57 +0000)]
[Object][XCOFF] Add an XCOFF dumper for llvm-readobj.
Patch adds support for dumping of file headers with llvm-readobj. XCOFF
object files are added to test dumping a well formed file, and dumping
both negative timestamps and negative symbol counts, both of which are
allowed in the XCOFF definition.
Differential Revision: https://reviews.llvm.org/D60878
llvm-svn: 359878
Simon Pilgrim [Fri, 3 May 2019 12:55:25 +0000 (12:55 +0000)]
[TargetLowering] expandUnalignedStore - cleanup EVT variables. NFCI.
Avoid duplicated EVTs and rename Store/Load VTs to avoid -Wshadow warnings.
llvm-svn: 359877
Dmitri Gribenko [Fri, 3 May 2019 12:50:00 +0000 (12:50 +0000)]
Added an AST matcher for declarations that are in the `std` namespace
Reviewers: alexfh
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61480
llvm-svn: 359876
Anton Afanasyev [Fri, 3 May 2019 12:36:22 +0000 (12:36 +0000)]
Revert "[MIR] Add simple PRE pass to MachineCSE"
This reverts commit
9c20156de39b377190d7a91783d61877b303fe35.
It breaks stage 2 of clang-ppc64be-linux-multistage.
llvm-svn: 359875
Kadir Cetinkaya [Fri, 3 May 2019 12:11:14 +0000 (12:11 +0000)]
[clangd] Also perform merging for symbol definitions
Summary:
clangd currently prefers declarations from codegen files. This patch
implements that behavior for definition locations. If we have definiton
locations both coming from AST and index, clangd will perform a merging to show
the codegen file if that's the case.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61126
llvm-svn: 359874
Simon Pilgrim [Fri, 3 May 2019 11:32:00 +0000 (11:32 +0000)]
[SelectionDAG] Use INT_MIN as (1 << 31) is UB for signed integers. NFCI.
llvm-svn: 359873
Simon Pilgrim [Fri, 3 May 2019 11:11:03 +0000 (11:11 +0000)]
[SelectionDAG] computeKnownBits - remove some duplicate/shadow variables. NFCI.
llvm-svn: 359872
Simon Pilgrim [Fri, 3 May 2019 10:32:07 +0000 (10:32 +0000)]
[X86] LowerMULH - remove unused Lo/Hi vector indices. NFCI.
Leftover from before we had the extract128BitVector helpers.
llvm-svn: 359871
Anton Afanasyev [Fri, 3 May 2019 10:30:59 +0000 (10:30 +0000)]
[MIR] Add simple PRE pass to MachineCSE
This is the second part of the commit fixing PR38917 (hoisting
partitially redundant machine instruction). Most of PRE (partitial
redundancy elimination) and CSE work is done on LLVM IR, but some of
redundancy arises during DAG legalization. Machine CSE is not enough
to deal with it. This simple PRE implementation works a little bit
intricately: it passes before CSE, looking for partitial redundancy
and transforming it to fully redundancy, anticipating that the next
CSE step will eliminate this created redundancy. If CSE doesn't
eliminate this, than created instruction will remain dead and eliminated
later by Remove Dead Machine Instructions pass.
The third part of the commit is supposed to refactor MachineCSE,
to make it more clear and to merge MachinePRE with MachineCSE,
so one need no rely on further Remove Dead pass to clear instrs
not eliminated by CSE.
First step: https://reviews.llvm.org/D54839
Fixes llvm.org/PR38917
Reviewers: RKSimon
Subscribers: hfinkel, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D56772
llvm-svn: 359870
Simon Pilgrim [Fri, 3 May 2019 10:13:41 +0000 (10:13 +0000)]
Reduce variable scope to just the if() block its actually used in. NFCI.
llvm-svn: 359869
Raphael Isemann [Fri, 3 May 2019 10:03:28 +0000 (10:03 +0000)]
C.128 override, virtual keyword handling
Summary:
According to [C128] "Virtual functions should specify exactly one
of `virtual`, `override`, or `final`", I've added override where a
virtual function is overriden but the explicit `override` keyword
was missing. Whenever both `virtual` and `override` were specified,
I removed `virtual`. As C.128 puts it:
> [...] writing more than one of these three is both redundant and
> a potential source of errors.
I anticipate a discussion about whether or not to add `override` to
destructors but I went for it because of an example in [ISOCPP1000].
Let me repeat the comment for you here:
Consider this code:
```
struct Base {
virtual ~Base(){}
};
struct SubClass : Base {
~SubClass() {
std::cout << "It works!\n";
}
};
int main() {
std::unique_ptr<Base> ptr = std::make_unique<SubClass>();
}
```
If for some odd reason somebody removes the `virtual` keyword from the
`Base` struct, the code will no longer print `It works!`. So adding
`override` to destructors actively protects us from accidentally
breaking our code at runtime.
[C128]: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final
[ISOCPP1000]: https://github.com/isocpp/CppCoreGuidelines/issues/1000#issuecomment-
476951555
Reviewers: teemperor, JDevlieghere, davide, shafik
Reviewed By: teemperor
Subscribers: kwk, arphaman, kadircet, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D61440
llvm-svn: 359868
Pavel Labath [Fri, 3 May 2019 08:06:28 +0000 (08:06 +0000)]
Split TestVLA into two and XFAIL one part
The part which checks whether vla_expr shows up in the variable list
does not pass on non-darwin platforms. Add the appropriate decorator.
llvm-svn: 359867
Ilya Biryukov [Fri, 3 May 2019 08:03:21 +0000 (08:03 +0000)]
[clangd] Minor code style cleanups in Protocol.h. NFC
- Remove a parameter name that was misspelled (OS used for non-stream
parameter)
- Declare operator == (TextEdit, TextEdit) outside the struct, for
consistency with other user-declared ops in our code.
- Fix naming style of a parameter.
llvm-svn: 359866
Martin Storsjo [Fri, 3 May 2019 07:43:23 +0000 (07:43 +0000)]
Avoid duplicate function aliases on MinGW after SVN r359835
On MinGW, the same alias mechanism as for ELF, using
__attribute__((__alias__())), is used.
llvm-svn: 359865
Akira Hatanaka [Fri, 3 May 2019 07:19:46 +0000 (07:19 +0000)]
[Sema][ObjC] Disable -Wunused-parameter for ObjC methods
The warning isn't very useful when the function is an ObjC method.
rdar://problem/
41561853
Differential Revision: https://reviews.llvm.org/D61147
llvm-svn: 359864
Craig Topper [Fri, 3 May 2019 07:14:05 +0000 (07:14 +0000)]
[X86] Add more one checks to masked compare patterns that were missed in r358358.
This covers the patterns we use for widening 128/256 comparisons to 512-bit when
AVX512VL isn't supported.
llvm-svn: 359863
Pavel Labath [Fri, 3 May 2019 07:11:43 +0000 (07:11 +0000)]
Revert "Initialization: move InstructionEmulation to full initialization"
This change is bogus. lldb-server definitely uses instruction emulation
on some architectures.
llvm-svn: 359862
Igor Kudrin [Fri, 3 May 2019 05:11:48 +0000 (05:11 +0000)]
[docs] Add support for Markdown documentation when creating man pages
rL358749 added a documentation page in the Markdown format. Currently,
such pages are ignored in the configuration script for manual pages.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D60964
llvm-svn: 359860
Leonard Chan [Fri, 3 May 2019 03:28:06 +0000 (03:28 +0000)]
Revert "[Attribute/Diagnostics] Print macro if definition is an attribute declaration"
This reverts commit
fc40cbd9d8c63e65eed3590ba925321afe782e1d.
llvm-svn: 359859
Nico Weber [Fri, 3 May 2019 03:16:07 +0000 (03:16 +0000)]
Revert r359814 "[Sema] Emit warning for visibility attribute on internal-linkage declaration"
See cfe-commits thread for r359814.
llvm-svn: 359858
Quentin Colombet [Fri, 3 May 2019 01:23:56 +0000 (01:23 +0000)]
[IRTranslator] Use the alloc size instead of the store size when translating allocas
We use to incorrectly use the store size instead of the alloc size when
creating the stack slot for allocas.
On aarch64 this can be demonstrated by allocating weirdly sized types.
For instance, in the added test case, we use an alloca for i19. We used
to allocate a slot of size 24-bit (19 rounded up to the next byte),
whereas we really want to use a full 32-bit slot for this type.
llvm-svn: 359856
Eli Friedman [Fri, 3 May 2019 00:59:52 +0000 (00:59 +0000)]
[AArch64][MC] Reject "add x0, x1, w2, lsl #1" etc.
Looks like just a minor oversight in the parsing code.
Fixes https://bugs.llvm.org/show_bug.cgi?id=41504.
Differential Revision: https://reviews.llvm.org/D60840
llvm-svn: 359855
David Blaikie [Fri, 3 May 2019 00:44:50 +0000 (00:44 +0000)]
SemaOverload: Complete candidates before emitting the error, to ensure diagnostics emitted (or suppressed) during completion don't interfere with the overload notes
Because diagnostics and their notes are not connected at the API level,
if the error message for an overload is emitted, then the overload
candidates are completed - if a diagnostic is emitted during that work,
the notes related to overload candidates would be attached to the latter
diagnostic, not the original error. Sort of worse, if the latter
diagnostic was disabled, the notes are disabled.
Reviewers: rsmith
Differential Revision: https://reviews.llvm.org/D61357
llvm-svn: 359854
Fangrui Song [Fri, 3 May 2019 00:35:49 +0000 (00:35 +0000)]
[ELF] Place SHT_NOTE sections with the same alignment into one PT_NOTE
Summary:
While the generic ABI requires notes to be 8-byte aligned in ELF64, many
vendor-specific notes (from Linux, NetBSD, Solaris, etc) use 4-byte
alignment.
In a PT_NOTE segment, if 4-byte aligned notes are followed by an 8-byte
aligned note, the possible 4-byte padding may make consumers fail to
parse the 8-byte aligned note. See PR41000 for a recent report about
.note.gnu.property (NT_GNU_PROPERTY_TYPE_0).
(Note, for NT_GNU_PROPERTY_TYPE_0, the consumers should probably migrate
to PT_GNU_PROPERTY, but the alignment issue affects other notes as well.)
To fix the issue, don't mix notes with different alignments in one
PT_NOTE. If compilers emit 4-byte aligned notes before 8-byte aligned
notes, we'll create at most 2 segments.
sh_size%sh_addralign=0 is actually implied by the rule for linking
unrecognized sections (in generic ABI), so we don't have to check that.
Notes that match in name, type and attribute flags are concatenated into
a single output section. The compilers have to ensure
sh_size%sh_addralign=0 to make concatenated notes parsable.
An alternative approach is to create a PT_NOTE for each SHT_NOTE, but
we'll have to incur the sizeof(Elf64_Phdr)=56 overhead every time a new
note section is introduced.
Reviewers: ruiu, jakehehrlich, phosek, jhenderson, pcc, espindola
Subscribers: emaste, arichardson, krytarowski, fedor.sergeev, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61296
llvm-svn: 359853
Eric Christopher [Fri, 3 May 2019 00:15:23 +0000 (00:15 +0000)]
Tidy up a comment, fix a typo, remove a comment that's obsolete.
llvm-svn: 359852
Fangrui Song [Fri, 3 May 2019 00:11:53 +0000 (00:11 +0000)]
[crtbegin] Fix an off-by-1 bug in __do_fini
Differential Revision: https://reviews.llvm.org/D61367
llvm-svn: 359850
Eli Friedman [Fri, 3 May 2019 00:10:45 +0000 (00:10 +0000)]
[AArch64][Windows] Compute function length correctly in unwind tables.
The primary fix here is to WinException.cpp: we need to exclude jump
tables when computing the length of a function, or else we fail to
correctly compute the length. (We can only compute the number of bytes
consumed by certain assembler directives after the entire file is
parsed. ".p2align" is one of those directives, and is used by jump table
generation.)
The secondary fix, to MCWin64EH, is to make sure we don't silently
miscompile if we hit a similar situation in the future.
It's possible we could extend ARM64EmitUnwindInfo so it allows function
bodies that contain assembler directives, but that's a lot more
complicated; see the FIXME in MCWin64EH.cpp.
Fixes https://bugs.llvm.org/show_bug.cgi?id=41581 .
Differential Revision: https://reviews.llvm.org/D61095
llvm-svn: 359849
Jonas Devlieghere [Fri, 3 May 2019 00:10:31 +0000 (00:10 +0000)]
[Reproducers] Improve reproducer help
Extend the documentation for the reproducer command.
llvm-svn: 359848
Jason Molenda [Thu, 2 May 2019 23:49:56 +0000 (23:49 +0000)]
RegisterContextLLDB::GetFullUnwindPlanForFrame has four verbose
logging messages that are written the same, making it difficult to
know for certain which code path was taken based on a logfile. Add
some words to make each unique.
Right now the ordering for finding a FullUnwindPlan (ignoring
fallback unwind plan logic) is
1. If this is a _sigtramp like function, try eh_frame which is
hand written on darwin systems to account for finding the
saved register context correctly.
2. Ask the DynamicLoader if eh_frame should be preferred for
this frame. Some binaries on the system may have hand-written
eh_frame and the DynamicLoader is the source for this. (primarily
this is for hand-written assembly in the objc runtime, and we tell
lldb to trust that for functions in libobjc.dylib.)
3. if 0th frame, use GetUnwindPlanAtNonCallSite plan.
4. GetUnwindPlanAtCallSite {for 0th or any other}
5. GetUnwindPlanAtNonCallSite {now for non-0th frames, only if not from a compiler? hm.}
6. GetUnwindPlanArchitectureDefaultAtFunctionEntry if we're on the first instruction
7. Architectural default unwind plan ABI::CreateDefaultUnwindPlan
I'm moving #6 -- DefaultAtFunctionEntry -- up to between #3 and #4,
where we're already doing things specific to the zeroth frame. If
we're on the zeroth frame and the GetUnwindPlanAtNonCallSite plan
has failed for some reason, and we're on the first instruction, we
should definitely use DefaultAtFunctionEntry instead of any other
unwind plan. If we're trying to step out of some rando function
on the system that we couldn't assembly instruction inspect, this
is sufficient for us to step out of it.
llvm-svn: 359847
Adrian Prantl [Thu, 2 May 2019 23:49:55 +0000 (23:49 +0000)]
Fix tests on non-Darwin platforms.
llvm-svn: 359846
Alina Sbirlea [Thu, 2 May 2019 23:41:58 +0000 (23:41 +0000)]
[MemorySSA] Check that block is reachable when adding phis.
Summary:
Originally the insertDef method was only used when building MemorySSA, and was limiting the number of Phi nodes that it created.
Now it's used for updates as well, and it can create additional Phis needed for correctness.
Make sure no Phis are created in unreachable blocks (condition met during MSSA build), otherwise the renamePass will find a null DTNode.
Resolves PR41640.
Reviewers: george.burgess.iv
Subscribers: jlebar, Prazek, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61410
llvm-svn: 359845
Richard Smith [Thu, 2 May 2019 23:21:28 +0000 (23:21 +0000)]
Fix -Wunsequenced false-positives in code controlled by a branch on
__builtin_constant_p.
If the operand of __builtin_constant_p is not constant and has
side-effects, then code controlled by a branch on it is unreachable and
we should not emit runtime behavior warnings in such code.
llvm-svn: 359844
Jason Molenda [Thu, 2 May 2019 23:14:26 +0000 (23:14 +0000)]
Upstreaming an apple local patch by Frederic Riss.
lldb has an expression that runs in the inferior process to collect
the isa values and hash of the class names for classes in the
system's shared cache. In recent OSes, swift classes are in this
table and the function the jitted expression calls returns demangled
names. We need to compute the hashes based on the mangled names.
So for these names, return a hash value of 0 which indicates that
lldb should read the class name directly out of the runtime tables
and compute the hash itself.
When this patch is absent, the lldb+swift testsuite has many failures
on a recent macOS system; there isn't a direct non-swift way to
test for this being correct.
<rdar://problem/
47935062>
llvm-svn: 359843
Alina Sbirlea [Thu, 2 May 2019 23:12:49 +0000 (23:12 +0000)]
[MemorySSA] Refactor removing multiple trivial phis [NFC].
Summary: Create a method to clean up multiple potentially trivial phis, since we will need this often.
Reviewers: george.burgess.iv
Subscribers: jlebar, Prazek, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61471
llvm-svn: 359842
Adrian Prantl [Thu, 2 May 2019 23:07:23 +0000 (23:07 +0000)]
Hide runtime support values such as clang's __vla_expr from frame variable
by respecting the "artificial" attribute on variables. Function
arguments that are artificial and useful to end-users are being
whitelisted by the language runtime.
<rdar://problem/
45322477>
Differential Revision: https://reviews.llvm.org/D61451
llvm-svn: 359841
Craig Topper [Thu, 2 May 2019 22:46:23 +0000 (22:46 +0000)]
[X86] Remove LEA16r references from X86FixupLEAs. NFCI
As far as I know, we never emit LEA16r
llvm-svn: 359840
Artem Belevich [Thu, 2 May 2019 22:37:19 +0000 (22:37 +0000)]
[CUDA] Do not pass deprecated option fo fatbinary
CUDA 10.1 tools deprecated some command line options.
fatbinary no longer needs --cuda.
Differential Revision: https://reviews.llvm.org/D61470
llvm-svn: 359838
Craig Topper [Thu, 2 May 2019 22:26:40 +0000 (22:26 +0000)]
[X86] Correct the register class for specific mask register constraints in getRegForInlineAsmConstraint when the VT is a scalar type
The default impementation in the base class for TargetLowering::getRegForInlineAsmConstraint doesn't work for mask registers when the VT is a scalar type integer types since the only legal mask types are vXi1. So we end up just getting whatever the first register class that contains the register. Currently this appears to be VK1, but its really dependent on the order tablegen outputs the register classes.
Some code in the caller ends up looking up the type for this register class and find v1i1 then generates a copyfromreg from the physical k-register with the v1i1 type. Then it generates an any_extend from v1i1 to the scalar VT which isn't legal. This bad any_extend sticks around until isel where it selects a MOVZX32rr8 with a v1i1 input or maybe a i8 input. Not sure but eventually we pick up a copy from VK1 to GR8 in MachineIR which isn't supported. This leads to a failure in physical register copying.
This patch uses the scalar type to find a VK class of the right size. In the attached test case this will be VK16. This causes a bitcast from vk16 to i16 to be generated instead of an any_extend. This will be properly iseled to a VK16 to GR32 copy and a GR32->GR16 extract_subreg.
Fixes PR41678
Differential Revision: https://reviews.llvm.org/D61453
llvm-svn: 359837
Craig Topper [Thu, 2 May 2019 22:26:26 +0000 (22:26 +0000)]
[SelectionDAG] Add asserts to verify the vectorness of input and output types of TRUNCATE/ZERO_EXTEND/ANY_EXTEND/SIGN_EXTEND agree
As a result of the underlying cause of PR41678 we created an ANY_EXTEND node with a scalar result type and v1i1 input type. Ideally we would have asserted for this instead of letting it go through to instruction selection and generate bad machine IR
Differential Revision: https://reviews.llvm.org/D61463
llvm-svn: 359836
Reid Kleckner [Thu, 2 May 2019 22:11:55 +0000 (22:11 +0000)]
Fix check-builtins on Windows after alias changes
llvm-svn: 359835
Evandro Menezes [Thu, 2 May 2019 22:01:39 +0000 (22:01 +0000)]
[AArch64] Update for Exynos
Fix the forwarding of multiplication results for Exynos M4.
llvm-svn: 359834
Craig Topper [Thu, 2 May 2019 21:57:18 +0000 (21:57 +0000)]
[X86] Remove string literal from an if. NFC
This if used to be an assert that got refactored into an if, but left the string literal behind.
Fixes PR41718
llvm-svn: 359833
Saleem Abdulrasool [Thu, 2 May 2019 21:49:29 +0000 (21:49 +0000)]
Initialization: move InstructionEmulation to full initialization
The debug server does not need to use the instruction emulation. This helps
reduce the size of the final lldb-server binary by another ~100K (~1% savings).
llvm-svn: 359832
Jordan Rupprecht [Thu, 2 May 2019 21:48:04 +0000 (21:48 +0000)]
Revert [ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' change
This reverts r359314 (git commit
5015aa854dc043b2ae5d95e04e00d98518207ce5)
llvm-svn: 359831
Jordan Rupprecht [Thu, 2 May 2019 21:42:46 +0000 (21:42 +0000)]
Revert [llvm-nm] Fix handling of symbol types + [llvm-nm] Generalize symbol types
This reverts r359311 and r359312 (git commit
0bf06a8f59b0074a60871865e828d92db8930c59 and
5f184f17800ea2ac27be5e4ab540cb94a46e80c7)
llvm-svn: 359830
Nico Weber [Thu, 2 May 2019 21:21:55 +0000 (21:21 +0000)]
lld-link: Add /force:multipleres extension to make dupe resource diag non-fatal
As a side benefit, lld-link now reports more than one duplicate resource
entry before exiting with an error even if the new flag is not passed.
llvm-svn: 359829
Petr Hosek [Thu, 2 May 2019 21:20:08 +0000 (21:20 +0000)]
[gn] Include the missing BUILD.gn file for libcxxabi includes
This was omitted in r359805.
Differential Revision: https://reviews.llvm.org/D61462
llvm-svn: 359828
Casey Carter [Thu, 2 May 2019 21:19:41 +0000 (21:19 +0000)]
[libc++][test] Remove non-portable assumption that thread's constructor allocates with ::new
Drive-by:
* Fix potential race between check and update of `throw_one` in `operator new`
* Fix latent bug in `operator delete`, which shouldn't decrement `outstanding_new` when passed a null pointer
* Specifically catch the expected `bad_alloc` in `main` instead of `...`
Differential Revision: https://reviews.llvm.org/D50860
llvm-svn: 359827
Leonard Chan [Thu, 2 May 2019 20:38:14 +0000 (20:38 +0000)]
[Attribute/Diagnostics] Print macro if definition is an attribute declaration
If an address_space attribute is defined in a macro, print the macro instead
when diagnosing a warning or error for incompatible pointers with different
address_spaces.
We allow this for all attributes (not just address_space), and for multiple
attributes declared in the same macro.
Differential Revision: https://reviews.llvm.org/D51329
llvm-svn: 359826
Petr Hosek [Thu, 2 May 2019 20:34:54 +0000 (20:34 +0000)]
[gn] Update the clangd test lit site configuration
This reflects changes made in r359763.
llvm-svn: 359825
Jan Korous [Thu, 2 May 2019 20:32:56 +0000 (20:32 +0000)]
[clangd][xpc] Cannonicalize value of CLANGD_BUILD_XPC before caching
llvm-svn: 359824
Amy Huang [Thu, 2 May 2019 20:07:35 +0000 (20:07 +0000)]
Change the metadata for heapallocsite calls when the type is cast.
llvm-svn: 359823
Alexey Bataev [Thu, 2 May 2019 20:05:01 +0000 (20:05 +0000)]
[OPENMP][NVPTX]Improve code by using parallel level counter.
Summary:
Previously for the different purposes we need to get the active/common
parallel level and with full runtime we iterated over all the records to
calculate this level. Instead, we can used the warp-based parallel level
counters used in no-runtime mode.
Reviewers: grokos, gtbercea, kkwli0
Subscribers: guansong, jfb, jdoerfert, caomhin, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D61395
llvm-svn: 359822
Eric Christopher [Thu, 2 May 2019 19:49:35 +0000 (19:49 +0000)]
Typo Functino->Function.
llvm-svn: 359821
Nico Weber [Thu, 2 May 2019 19:47:05 +0000 (19:47 +0000)]
Another attempt to fix "could not find clang-check" lit warning in analyzer-less builds
r359717 added clang-check as a dep of check-clang unconditionally
because I had missed lit.local.cfg in test/Tooling.
Instead, only add clang-check to the tools if the analyzer is enabled,
since the build target only exists then, and since all tests using
clang-check are skipped when the analyzer is disabled.
Differential Revision: https://reviews.llvm.org/D61418
llvm-svn: 359820
Saleem Abdulrasool [Thu, 2 May 2019 19:37:26 +0000 (19:37 +0000)]
build: add option to disable unwind tables
The unwind tables (`.eh_frame`, `.arm.extab`) add a significant chunk of data to
the final binaries. These should not be needed normally, particularly when
exceptions are disabled. This enables shrinking `lldb-server` by ~18% (3 MiB)
when built with gold.
llvm-svn: 359819
George Rimar [Thu, 2 May 2019 19:28:04 +0000 (19:28 +0000)]
[yaml2obj] - Make interface of `NameToIdxMap` class be human friendly and fix users.
This patch inverses the values returned by `addName` and
`lookup` methods of the class mentioned so that they
now return true on success and false on failure.
Also, it does minor code cleanup.
Differential revision: https://reviews.llvm.org/D61190
llvm-svn: 359818
Saleem Abdulrasool [Thu, 2 May 2019 19:25:18 +0000 (19:25 +0000)]
Initialization: correct macro usage
`_MSC_VER` indiciates that you are building with MSVC, not that you are building
for Windows. Use `_WIN32` (which identifies Win32 and Win64).
llvm-svn: 359817
Saleem Abdulrasool [Thu, 2 May 2019 19:09:58 +0000 (19:09 +0000)]
gdb-remote: fix the build on Windows
Windows does not have a definition for `mode_t`. Include the appropriate
header.
llvm-svn: 359816
Petr Hosek [Thu, 2 May 2019 19:07:23 +0000 (19:07 +0000)]
[gn] Include libcxx configuration file
This was omitted in r359806 but is already referenced in the GN build.
llvm-svn: 359815
Scott Linder [Thu, 2 May 2019 19:03:57 +0000 (19:03 +0000)]
[Sema] Emit warning for visibility attribute on internal-linkage declaration
GCC warns on these cases, but we currently just silently ignore the attribute.
Differential Revision: https://reviews.llvm.org/D61097
llvm-svn: 359814
Raphael Isemann [Thu, 2 May 2019 18:26:58 +0000 (18:26 +0000)]
Remove unnecessary check in SymbolFileDWARF::ParseImportedModules
Summary:
This check seems unnecessary as we already assert the same condition above and also access `sc.comp_unit`
before this check.
Reviewers: aprantl
Reviewed By: aprantl
Subscribers: jdoerfert, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D61394
llvm-svn: 359813
Jonas Devlieghere [Thu, 2 May 2019 18:26:46 +0000 (18:26 +0000)]
Disable TestArgumentPassingRestrictions for clang < 7
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/
llvm-svn: 359812
Saleem Abdulrasool [Thu, 2 May 2019 18:15:03 +0000 (18:15 +0000)]
gdb-remote: reduce some inclusion of Target/Process.h
Reduce the inclusion of Target/Process.h to help isolate why Process is being
preserved during the build of `lldb-server`.
llvm-svn: 359811
Saleem Abdulrasool [Thu, 2 May 2019 18:11:44 +0000 (18:11 +0000)]
Initialization: remove ObjectContainer from Common
This restructures the initialization path to move the ObjectContainer
initialization into the *full* initialization path. This is not needed
for the lldb-server initialization path. This helps strip off ~1MiB
from the binary.
llvm-svn: 359810
Reid Kleckner [Thu, 2 May 2019 17:45:54 +0000 (17:45 +0000)]
Use primary template parameter names for variable template debug info
Summary:
Fixes PR41677
Consider:
template <typename LHS, typename RHS> constexpr bool is_same_v = false;
template <typename T> constexpr bool is_same_v<T, T> = true;
template constexpr bool is_same_v<int, int>;
Before this change, when emitting debug info for the
`is_same_v<int, int>` global variable, clang would crash because it
would try to use the template parameter list from the partial
specialization to give parameter names to template arguments. This
doesn't work in general, since a partial specialization can have fewer
arguments than the primary template. Therefore, always use the primary
template. Hypothetically we could try to use the parameter names from
the partial specialization when possible, but it's not clear this really
helps debugging in practice.
Reviewers: JDevlieghere, aprantl, ormris, dblaikie
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61408
llvm-svn: 359809
Louis Dionne [Thu, 2 May 2019 17:43:48 +0000 (17:43 +0000)]
[libc++][CMake] Link against libSystem on Apple platforms
Instead of manually linking against libm/librt/libpthread, we should be
linking against libSystem on Apple platforms, and only that. libm and
libpthread are symlinks to libSystem anyway.
llvm-svn: 359808
Jonas Devlieghere [Thu, 2 May 2019 17:35:18 +0000 (17:35 +0000)]
[test] TestSharedPtr -> TestSharedPtrDbgInfoContent
Two tests cannot share the same name, because they will generate an
identical trace file. When that happens, this can lead to a race
condition where dotest fails when trying to move both files into the
trace directory, because the file has already been moved. Additionally,
the trace will have been overwritten by the test that finishes last.
llvm-svn: 359807
Petr Hosek [Thu, 2 May 2019 17:29:41 +0000 (17:29 +0000)]
[gn] Support for building libc++
This change introduces support for building libc++. The library
build should be complete, but not all CMake options have been
replicated in GN. We also don't support tests yet.
We only support two stage build at the moment.
Differential Revision: https://reviews.llvm.org/D61143
llvm-svn: 359806
Petr Hosek [Thu, 2 May 2019 17:29:39 +0000 (17:29 +0000)]
[gn] Support for building libcxxabi
This change introduces support for building libcxxabi. The library
build should be complete, but not all CMake options have been
replicated in GN. We also don't support tests yet.
We only support two stage build at the moment.
Differential Revision: https://reviews.llvm.org/D60372
llvm-svn: 359805
Petr Hosek [Thu, 2 May 2019 17:29:37 +0000 (17:29 +0000)]
[gn] Support for building libunwind
This change introduces support for building libuwind. The library
build should be complete, but not all CMake options have been
replicated in GN. We also don't support tests yet.
We only support two stage build at the moment.
Differential Revision: https://reviews.llvm.org/D60370
llvm-svn: 359804
Petr Hosek [Thu, 2 May 2019 17:24:53 +0000 (17:24 +0000)]
[compiler-rt] Set the ZX_VMO_RESIZABLE option for zx_vmo_create
Currently VMO in Zircon create using the zx_vmo_create is resizable
by default, but we'll be changing this in the future, requiring an
explicit flag to make the VMO resizable.
Prepare for this change by passing ZX_VMO_RESIZABLE option to all
zx_vmo_create calls that need resizable VMO.
Differential Revision: https://reviews.llvm.org/D61450
llvm-svn: 359803
Jonathan Metzman [Thu, 2 May 2019 16:45:17 +0000 (16:45 +0000)]
[libFuzzer] Re-enable libFuzzer on i386 Linux and fix test
Summary:
Re-enable libFuzzer on i386 Linux after it was accidentally
disabled.
Also disable gc-sections.test on i386 since lld isn't
garbage collecting properly with ASAN on i386.
Reviewers: morehouse
Reviewed By: morehouse
Subscribers: srhines, mgorny, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D61415
llvm-svn: 359802
Florian Gross [Thu, 2 May 2019 16:41:28 +0000 (16:41 +0000)]
Fixed: Duck-typing in readability-redundant-smartptr-get didn't catch MSVC STL smart pointers.
Differential Revision: https://reviews.llvm.org/D61209
llvm-svn: 359801
David Blaikie [Thu, 2 May 2019 16:30:49 +0000 (16:30 +0000)]
Do not warn on switches over enums that do not use [[maybe_unused]] enumerators
PR36231, [dcl.attr.unused]p3
Reviewers: aaron.ballman
Differential Revision: https://reviews.llvm.org/D61444
llvm-svn: 359800
Sam McCall [Thu, 2 May 2019 16:12:36 +0000 (16:12 +0000)]
Reapply r359778: [clangd] Fix code completion of macros defined in the preamble region of the main file.
The bad assert has been removed, and updateOutOfDateIdentifier has been guarded.
This reverts commit r359796.
llvm-svn: 359799
Anastasia Stulova [Thu, 2 May 2019 16:10:50 +0000 (16:10 +0000)]
[OpenCL] Fix initialisation of this via pointer.
When the expression used to initialise 'this' has a pointer type,
check the address space of the pointee type instead of the pointer
type to decide whether an address space cast is required.
It is the pointee type that carries the address space qualifier.
Fixing PR41674.
Patch by kpet (Kevin Petit)!
Differential Revision: https://reviews.llvm.org/D61319
llvm-svn: 359798
Michal Gorny [Thu, 2 May 2019 16:10:35 +0000 (16:10 +0000)]
[lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)
Differential Revision: https://reviews.llvm.org/D61439
llvm-svn: 359797
Simon Pilgrim [Thu, 2 May 2019 15:47:33 +0000 (15:47 +0000)]
Revert rL359778 : [clangd] Fix code completion of macros defined in the preamble region of the main file.
Summary:
This is a tricky case (we baked the assumption that symbols come from
the preamble xor mainfile pretty deeply) and the fix is a bit of a hack:
We look at the code to guess the macro names, and deserialize them from
the preamble "by hand".
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60937
........
Fix buildbots http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/47684/
llvm-svn: 359796
Pavel Labath [Thu, 2 May 2019 15:38:09 +0000 (15:38 +0000)]
Reinstate xfail-darwin in x86-64-ymm-write.test
It turns out writing into ymm registers really does not work there.
llvm-svn: 359795
Pavel Labath [Thu, 2 May 2019 15:16:01 +0000 (15:16 +0000)]
Fix the compile RUN line in x86-64-ymm-write.test
Optimistically assuming this was the result of the darwin failure too,
so removing the XFAIL there.
llvm-svn: 359794
Sanjay Patel [Thu, 2 May 2019 15:02:08 +0000 (15:02 +0000)]
[DAGCombiner] try repeated fdiv divisor transform before building estimate (2nd try)
The original patch was committed at rL359398 and reverted at rL359695 because of
infinite looping.
This includes a fix to check for a vector splat of "1.0" to avoid the infinite loop.
Original commit message:
This was originally part of D61028, but it's an independent diff.
If we try the repeated divisor reciprocal transform before producing an estimate sequence,
then we have an opportunity to use scalar fdiv. On x86, the trade-off is 1 divss vs. 5
vector FP ops in the default estimate sequence. On recent chips (Skylake, Ryzen), the
full-precision division is only 3 cycle throughput, so that's probably the better perf
default option and avoids problems from x86's inaccurate estimates.
The last 2 tests show that users still have the option to override the defaults by using
the function attributes for reciprocal estimates, but those patterns are potentially made
faster by converting the vector ops (including ymm ops) to scalar math.
Differential Revision: https://reviews.llvm.org/D61149
llvm-svn: 359793
Alexey Bataev [Thu, 2 May 2019 14:52:52 +0000 (14:52 +0000)]
[OPENMP][NVPTX]Improve omp_get_max_threads() function.
Summary:
Function omp_get_max_threads() can always return 1 if current execution
mode is SPMD.
Reviewers: grokos, gtbercea, kkwli0
Subscribers: guansong, jdoerfert, caomhin, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D61379
llvm-svn: 359792
Sanjay Patel [Thu, 2 May 2019 14:47:59 +0000 (14:47 +0000)]
[SelectionDAG] remove constant folding limitations based on FP exceptions
We don't have FP exception limits in the IR constant folder for the binops (apart from strict ops),
so it does not make sense to have them here in the DAG either. Nothing else in the backend tries
to preserve exceptions (again outside of strict ops), so I don't see how this could have ever
worked for real code that cares about FP exceptions.
There are still cases (examples: unary opcodes in SDAG, FMA in IR) where we are trying (at least
partially) to preserve exceptions without even asking if the target supports FP exceptions. Those
should be corrected in subsequent patches.
Real support for FP exceptions requires several changes to handle the constrained/strict FP ops.
Differential Revision: https://reviews.llvm.org/D61331
llvm-svn: 359791
Alexey Bataev [Thu, 2 May 2019 14:46:32 +0000 (14:46 +0000)]
[OPENMP][NVPTX]Improved omp_get_thread_limit() function.
Summary:
Function omp_get_thread_limit() in SPMD mode can return the maximum
available number of threads as a result.
Reviewers: grokos, gtbercea, kkwli0
Subscribers: guansong, jdoerfert, openmp-commits, caomhin
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D61378
llvm-svn: 359790
Anastasia Stulova [Thu, 2 May 2019 14:40:40 +0000 (14:40 +0000)]
[OpenCL] Deduce static data members to __global addr space.
Similarly to static variables in OpenCL, static class data
members should be deduced to __global addr space.
Differential Revision: https://reviews.llvm.org/D61304
llvm-svn: 359789
Fangrui Song [Thu, 2 May 2019 14:05:20 +0000 (14:05 +0000)]
[ELF] --plugin-opt=thinlto-index-only: create empty index files even if all bitcode files are lazy
Summary:
The gold plugin behavior (creating empty index files for lazy bitcode
files) was added in D46034, but it missed the case when there is no
non-lazy bitcode files, e.g.
ld.lld -shared crti.o crtbeginS.o --start-lib bitcode.o --end-lib ...
crti.o crtbeginS.o are not bitcode, but our distributed build system
wants bitcode.o.thinlto.bc to confirm all expected outputs are created
based on all of the modules provided to the linker.
Differential Revision: https://reviews.llvm.org/D61420
llvm-svn: 359788
Michal Gorny [Thu, 2 May 2019 14:03:42 +0000 (14:03 +0000)]
[lldb] [lit] Mark x86-64-ymm-write XFAIL on Darwin
llvm-svn: 359787
Simon Pilgrim [Thu, 2 May 2019 14:00:55 +0000 (14:00 +0000)]
[X86][SSE] lowerAddSubToHorizontalOp - enable ymm extraction+fold
Limiting scalar hadd/hsub generation to the lowest xmm looks to be unnecessary - we will be extracting one upper xmm whatever, and we can remove a shuffle by using the hop which is inline with what shouldUseHorizontalOp expects to happen anyway.
Testing on btver2 (the main target for fast-hops) shows this is beneficial even for float ops where we have a 'shuffle' to extract the float result:
https://godbolt.org/z/0R-U-K
Differential Revision: https://reviews.llvm.org/D61426
llvm-svn: 359786
Eric Fiselier [Thu, 2 May 2019 13:22:55 +0000 (13:22 +0000)]
Attempt to fix flaky tests.
The threaded cxa guard test attempted to test multithreaded waiting
by lining up a bunch of threads at a held init lock and releasing them.
The test initially wanted each thread to observe the lock being held,
but some threads may arive too late.
This patch cleans up the test and relaxes the restrictions.
llvm-svn: 359785
Michal Gorny [Thu, 2 May 2019 12:55:54 +0000 (12:55 +0000)]
[lldb] [lit] Use LLDB-like output for XMM registers in write tests
llvm-svn: 359784
Michal Gorny [Thu, 2 May 2019 12:55:44 +0000 (12:55 +0000)]
[lldb] [lit] Introduce tests for writing YMM registers
Differential Revision: https://reviews.llvm.org/D61431
llvm-svn: 359783
Simon Pilgrim [Thu, 2 May 2019 12:18:24 +0000 (12:18 +0000)]
[X86][SSE] Move shouldUseHorizontalOp inside isHorizontalBinOp. NFCI.
Matches what we do for lowerAddSubToHorizontalOp and will make it easier to peek through subvectors to help fix PR39921
llvm-svn: 359782
James Henderson [Thu, 2 May 2019 11:53:02 +0000 (11:53 +0000)]
[llvm-strip]Add --no-strip-all to disable --strip-all behaviour (including default stripping)
If certain switches are not specified, llvm-strip behaves as if
--strip-all were specified. This means that for testing, when we don't
want the stripping behaviour, we have to specify one of these switches,
which can be confusing. This change adds --no-strip-all to allow an
alternative way of suppressing the default stripping, in a less
confusing manner.
Reviewed by: jakehehrlich, MaskRay
Differential Revision: https://reviews.llvm.org/D61377
llvm-svn: 359781
Michal Gorny [Thu, 2 May 2019 11:26:30 +0000 (11:26 +0000)]
[lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+
Since Darwin target implements support for zmm* registers without
matching support for the respectively added xmm* and ymm* registers,
split the tests for each register group. To reduce code duplication,
the tests are using the same source file (which sets more registers
than necessary but that should not cause any harm).
Differential Revision: https://reviews.llvm.org/D61376
llvm-svn: 359780
Raphael Isemann [Thu, 2 May 2019 11:25:50 +0000 (11:25 +0000)]
Add std::stack and std::queue support to CxxModuleHandler
Reviewers: aprantl, shafik
Reviewed By: aprantl, shafik
Subscribers: lldb-commits
Tags: #c_modules_in_lldb, #lldb
Differential Revision: https://reviews.llvm.org/D61305
llvm-svn: 359779