Aaron Puchert [Tue, 29 Oct 2019 23:37:06 +0000 (00:37 +0100)]
Thread safety analysis: Peel away NoOp implicit casts in initializers
Summary:
This happens when someone initializes a variable with guaranteed copy
elision and an added const qualifier. Fixes PR43826.
Reviewers: aaron.ballman, rsmith
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D69533
Nick Terrell [Tue, 29 Oct 2019 22:46:22 +0000 (15:46 -0700)]
[LLD][ELF] Support --[no-]mmap-output-file with F_no_mmap
Summary:
Add a flag `F_no_mmap` to `FileOutputBuffer` to support
`--[no-]mmap-output-file` in ELF LLD. LLD currently explicitly ignores
this flag for compatibility with GNU ld and gold.
We need this flag to speed up link time for large binaries in certain
scenarios. When we link some of our larger binaries we find that LLD
takes 50+ GB of memory, which causes memory pressure. The memory
pressure causes the VM to flush dirty pages of the output file to disk.
This is normally okay, since we should be flushing cold pages. However,
when using BtrFS with compression we need to write 128KB at a time when
we flush a page. If any page in that 128KB block is written again, then
it must be flushed a second time, and so on. Since LLD doesn't write
sequentially this causes write amplification. The same 128KB block will
end up being flushed multiple times, causing the linker to many times
more IO than necessary. We've observed 3-5x faster builds with
-no-mmap-output-file when we hit this scenario.
The bad scenario only applies to compressed filesystems, which group
together multiple pages into a single compressed block. I've tested
BtrFS, but the problem will be present for any compressed filesystem
on Linux, since it is caused by the VM.
Silently ignoring --no-mmap-output-file caused a silent regression when
we switched from gold to lld. We pass --no-mmap-output-file to fix this
edge case, but since lld silently ignored the flag we didn't realize it
wasn't being respected.
Benchmark building a 9 GB binary that exposes this edge case. I linked 3
times with --mmap-output-file and 3 times with --no-mmap-output-file and
took the average. The machine has 24 cores @ 2.4 GHz, 112 GB of RAM,
BtrFS mounted with -compress-force=zstd, and an 80% full disk.
| Mode | Time |
|---------|-------|
| mmap | 894 s |
| no mmap | 126 s |
When compression is disabled, BtrFS performs just as well with and
without mmap on this benchmark.
I was unable to reproduce the regression with any binaries in
lld-speed-test.
Reviewed By: ruiu, MaskRay
Differential Revision: https://reviews.llvm.org/D69294
Richard Smith [Wed, 16 Oct 2019 00:51:08 +0000 (17:51 -0700)]
Replace std::function in PrintingPolicy with a callbacks object.
This makes PrintingPolicy significantly more lightweight and provides
groundwork for more printing customization hooks.
Lawrence D'Anna [Tue, 29 Oct 2019 20:42:38 +0000 (13:42 -0700)]
[LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args
Summary:
Move breakpoints from the old, bad ArgInfo::count to the new, better
ArgInfo::max_positional_args. Soon ArgInfo::count will be no more.
It looks like this functionality is already well tested by
`TestBreakpointCommandsFromPython.py`, so there's no need to write
additional tests for it.
Reviewers: labath, jingham, JDevlieghere
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69468
Eli Friedman [Tue, 29 Oct 2019 21:52:56 +0000 (14:52 -0700)]
[Headers] Fix compatibility between arm_acle.h and intrin.h
Make sure they don't both define __nop.
Differential Revision: https://reviews.llvm.org/D69012
Richard Smith [Tue, 29 Oct 2019 21:44:38 +0000 (14:44 -0700)]
Accept __is_same_as as a GCC-compatibility synonym for the proper trait name __is_same.
Adrian Prantl [Tue, 29 Oct 2019 16:20:14 +0000 (09:20 -0700)]
[DWARF5] Added support for deleted C++ special member functions.
This patch adds support for deleted C++ special member functions in
clang and llvm. Also added Defaulted member encodings for future
support for defaulted member functions.
Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D69215
Daniel Sanders [Tue, 29 Oct 2019 20:27:48 +0000 (13:27 -0700)]
[globalisel][docs] Fix warning treated as error
I had hoped that I could have some
```
.. code-block:: MIR
```
sections for MIR examples which causes a warning about pygments not
supporting it but we have warnings treated as errors
Daniel Sanders [Sat, 26 Oct 2019 02:54:01 +0000 (19:54 -0700)]
[globalisel][docs] Rewrite the IRTranslator documentation
Summary:
I haven't refreshed the Function Calls section as I don't feel I have
sufficient knowledge of that area. It would be appreciated if someone could
review that section.
Note: I'm aware that pygments doesn't support 'mir' as used in one of the
code-block directives. This currently emits a warning and I decided to
keep it to enable finding them later. Maybe we can teach pygments to
support it.
Depends on D69456
Reviewers: volkan, aditya_nandakumar
Subscribers: rovka, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69457
Richard Smith [Tue, 29 Oct 2019 20:06:34 +0000 (13:06 -0700)]
Fix argument numbering confusion when diagnosing a non-viable operator().
This could lead to crashes if operator() is a variadic template, as we
could end up asking for an out-of-bounds argument.
Davide Italiano [Tue, 29 Oct 2019 20:05:56 +0000 (13:05 -0700)]
[ValueObjectDisplay] Generalize the description of an option.
Philip Reames [Tue, 29 Oct 2019 18:07:36 +0000 (11:07 -0700)]
[SelectionDAG] Enable lowering unordered atomics loads w/LoadSDNode (and stores w/StoreSDNode) by default
Enable the new SelectionDAG representation for unordered loads and stores introduced in r371441 by default. As a reminder, the new lowering changes the representation of an unordered atomic load from an AtomicSDNode - which is essentially a black box which gets passed through without combines messing with it - to a LoadSDNode w/a atomic marker on the MMO. The later parallels the way we handle volatiles, and I've audited the code to ensure that every location which checks one checks the other.
This has been fairly heavily fuzzed, and I examined diffs in a reasonable large corpus of assembly by hand, so I'm reasonable sure this is correct for the common case. Late in the review for this, it was discovered that I hadn't correctly handled cases which could be legalized into CAS operations. This points out that there's a strong bias in the IR of the frontend I'm working with towards only legal atomics. If there are problems with this patch, the most likely area will be legalization.
Differential Revision: https://reviews.llvm.org/D69219
Philip Reames [Fri, 25 Oct 2019 21:50:39 +0000 (14:50 -0700)]
[Docs] Reflect the slow migration from guard to widenable condition which is currently in progress.
Joel E. Denny [Thu, 17 Oct 2019 14:03:06 +0000 (14:03 +0000)]
[lit] Extend internal diff to support `-` argument
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:
```
# RUN: program | diff file -
```
Such cases exist now, in `clang/test/Analysis` for example. We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option. This patch adds support for
`-` to mean stdin.
Reviewed By: probinson, rnk
Differential Revision: https://reviews.llvm.org/D67643
Joel E. Denny [Thu, 17 Oct 2019 14:02:42 +0000 (14:02 +0000)]
[lit] Make internal diff work in pipelines
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:
```
# RUN: program | diff file -
# RUN: not diff file1 file2 | FileCheck %s
```
Such cases exist now, in `clang/test/Analysis` for example. We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.
To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation. A
follow-up patch will implement `-` to mean stdin.
Also, when lit's `diff` prints differences to stdout in Windows, this
patch ensures it always terminate lines with `\n` not `\r\n`. That
way, strict FileCheck directives checking the `diff` output succeed in
both Linux and Windows. This wasn't an issue when `diff` was internal
to lit because `diff` didn't then write to the true stdout, which is
where the `\n` -> `\r\n` conversion happened in Python.
Reviewed By: probinson, stella.stamenova
Differential Revision: https://reviews.llvm.org/D66574
Craig Topper [Tue, 29 Oct 2019 17:47:02 +0000 (10:47 -0700)]
[X86] Narrow i64 compares with constant to i32 when the upper 32-bits are known zero.
This catches some cases. There are probably ways to improve this.
I tried doing it as a combine on the setcc, but that broke
some cases involving flag reuse in place of test.
I renamed the isX86CCUnsigned to isX86CCSigned and flipped its
polarity to make it consistent with the similar functions for
ISD::SETCC. This avoids calling EQ/NE as being signed or unsigned.
Fixes PR43823.
Differential Revision: https://reviews.llvm.org/D69499
shafik [Tue, 29 Oct 2019 18:33:11 +0000 (11:33 -0700)]
[LLDB] Fix for windows bots broken by unsupported tests
Daniel Sanders [Sat, 26 Oct 2019 01:16:40 +0000 (18:16 -0700)]
[globalisel][docs] Rewrite the pipeline overview
Summary:
Rewrite the pipeline overview to be more focused on the structure and
flexibility as well as highlight the increased usefulness of
MachineVerifier and increased testability resulting from the smaller
incremental passes approach.
The diagrams are lifted from the slides for the LLVMDev 2019 talk
'Generating Optimized Code with GlobalISel' and adapted to be readable on
the white background used in the docs.
Reviewers: volkan
Subscribers: rovka, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69456
Simon Pilgrim [Tue, 29 Oct 2019 17:53:03 +0000 (17:53 +0000)]
[X86][VBMI2] Add vector funnel shift tests
Demonstrates missed opportunity to combine to the VBMI2 SHLDV/SHRDV ops - combineOrShiftToFunnelShift should handle vector ops (and we should eventually move this to DAGCombine).
Louis Dionne [Thu, 24 Oct 2019 21:16:37 +0000 (14:16 -0700)]
[libc++] Force the ABI namespace to be a reserved identifier
Summary:
When the ABI namespace isn't a reserved identifier, we were issuing a
warning, but this should have been an error since the beginning. This
commit enforces that the ABI namespace is a reserved identifier, and
changes the ABI namespace used by LibFuzzer.
Reviewers: phosek, EricWF
Subscribers: mgorny, christof, jkorous, dexonsmith, #sanitizers, libcxx-commits, llvm-commits
Tags: #sanitizers, #libc, #llvm
Differential Revision: https://reviews.llvm.org/D69408
Vlad Tsyrklevich [Tue, 29 Oct 2019 17:20:38 +0000 (10:20 -0700)]
Revert "[clang-format] Remove the dependency on frontend"
This reverts commit
ec66603ac7ea655be5c2c5f508c5bf0d5eaeb65b. It was
causing ubsan failures like the following on the ubsan bot:
llvm/lib/Support/SourceMgr.cpp:440:48: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffffa
Ehsan Amiri [Tue, 29 Oct 2019 16:08:00 +0000 (12:08 -0400)]
[SVE][AArch64] Adding pattern matching for some SVE instructions.
Adding patten matching for two SVE intrinsics: frecps and frsqrts.
Also added patterns for fsub and fmul - these SDNodes directly correspond
to machine instructions.
Review: https://reviews.llvm.org/D68476
Patch authored by mgudim (Mikhail Gudim).
Fangrui Song [Tue, 29 Oct 2019 17:00:46 +0000 (10:00 -0700)]
[ELF] Delete redundant comment after D56554. NFC
Michał Górny [Mon, 21 Oct 2019 17:27:51 +0000 (19:27 +0200)]
[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
Add a new '-z nognustack' option that suppresses emitting PT_GNU_STACK
segment. This segment is not supported at all on NetBSD (stack is
always non-executable), and the option is meant to be used to disable
emitting it.
Differential Revision: https://reviews.llvm.org/D56554
Lawrence D'Anna [Tue, 29 Oct 2019 04:59:04 +0000 (21:59 -0700)]
[LLDB][Python] fix another fflush issue on NetBSD
Summary:
Here's another instance where we were calling fflush on an input
stream, which is illegal on NetBSD.
Reviewers: labath, mgorny
Reviewed By: mgorny
Subscribers: krytarowski, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69488
Fangrui Song [Tue, 29 Oct 2019 16:38:33 +0000 (09:38 -0700)]
[SLP] Fix -Wunused-variable. NFC
Guillaume Chatelet [Tue, 29 Oct 2019 16:28:34 +0000 (17:28 +0100)]
isBuiltinFunc() uses StringRef instead of const char*
Summary: This prevents a bug when passing nullptr, StringRef ctor would call strlen(nullptr).
Reviewers: vlad.tsyrklevich
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69569
Sander de Smalen [Tue, 29 Oct 2019 12:49:34 +0000 (12:49 +0000)]
Reland [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2)
llvm/test/DebugInfo/MIR/X86/live-debug-values-reg-copy.mir failed with
EXPENSIVE_CHECKS enabled, causing the patch to be reverted in
rG2c496bb5309c972d59b11f05aee4782ddc087e71.
This patch relands the patch with a proper fix to the
live-debug-values-reg-copy.mir tests, by ensuring the MIR encodes the
callee-saves correctly so that the CalleeSaved info is taken from MIR
directly, rather than letting it be recalculated by the PEI pass. I've
done this by running `llc -stop-before=prologepilog` on the LLVM
IR as captured in the test files, adding the extra MOV instructions
that were manually added in the original test file, then running `llc
-run-pass=prologepilog` and finally re-added the comments for the MOV
instructions.
Alexey Bataev [Mon, 28 Oct 2019 17:46:10 +0000 (13:46 -0400)]
[SLP] Generalization of stores vectorization.
Stores are vectorized with maximum vectorization factor of 16. Patch
tries to improve the situation and use maximal vectorization factor.
Reviewers: spatel, RKSimon, mkuper, hfinkel
Differential Revision: https://reviews.llvm.org/D43582
Guillaume Chatelet [Tue, 29 Oct 2019 15:35:11 +0000 (16:35 +0100)]
Fix missing memcpy builtin on ppc64be
See D68028
Simon Pilgrim [Tue, 29 Oct 2019 15:29:32 +0000 (15:29 +0000)]
[X86] Pull out combineOrShiftToFunnelShift helper. NFCI.
Saleem Abdulrasool [Tue, 29 Oct 2019 15:24:10 +0000 (08:24 -0700)]
build: make standalone builds work again
Apple's greendragon bot uses a standalone build of lldb which would
fail to build after a recent change to LLVM as it relied on LLVM setting
global flags for its build. Attempt to repair the standalone build for
greendragon bot.
Saleem Abdulrasool [Tue, 29 Oct 2019 15:20:58 +0000 (08:20 -0700)]
build: workaround stale caches (NFC)
`LLVM_DEFAULT_TARGET_TRIPLE` is a cached variable, which means that it
may actually be unset. Furthermore, in standalone builds, the variable
may be fully undefined. Apply the regular expression over the empty
string in such a case. This should improve the state of the green
dragon bot.
Sanjay Patel [Tue, 29 Oct 2019 14:39:59 +0000 (10:39 -0400)]
[InstCombine] make icmp vector canonicalization safe for constant with undef elements
This is a fix for:
https://bugs.llvm.org/show_bug.cgi?id=43730
...and as shown there, we have existing test cases that show potential miscompiles.
We could just bail out for vector constants that contain any undef elements, or we can do as shown here:
allow the transform, but replace the undefs with a safe value.
For most of the tests shown, this results in a full splat constant (no undefs) which is probably a win
for further IR analysis because we conservatively don't match undefs in most cases. Codegen can probably
recover these kinds of undef lanes via demanded elements analysis if that's profitable.
Differential Revision: https://reviews.llvm.org/D69519
Guillaume Chatelet [Wed, 25 Sep 2019 09:31:28 +0000 (11:31 +0200)]
[clang] Add no_builtin attribute
Summary:
This is a follow up on https://reviews.llvm.org/D61634
This patch is simpler and only adds the no_builtin attribute.
Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert
Subscribers: mgrang, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68028
This is a re-submit after it got reverted in https://reviews.llvm.org/rGbd8791610948 since the breakage doesn't seem to come from this patch.
Raphael Isemann [Tue, 29 Oct 2019 14:13:02 +0000 (15:13 +0100)]
[lldb][NFC] Make LLVMUserExpression::DoExecute return early
The giant if-else isn't conforming to LLVM code style.
Alexey Bataev [Tue, 29 Oct 2019 14:06:11 +0000 (10:06 -0400)]
[OPENMP]Fix PR43772: No warning in non-combined target regions.
Need to analyze inner target regions in case of implicit mapping of the
data members when target region is created in one of the class member
functions.
Florian Hahn [Tue, 29 Oct 2019 13:41:19 +0000 (13:41 +0000)]
[bugpoint] Try to reduce passes after reducing everything.
In some cases, we fail to reduce the pass list earlier because of
complex pass dependencies, but we can reduce it after we simplified the
reproducer.
An example of that is PR43474, which can limit the crash to
-loop-interchange. Adding a test case would require at least 2
interacting Loop passes I think.
Reviewers: davide, reames, modocache
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D69236
Sanjay Patel [Tue, 29 Oct 2019 13:39:46 +0000 (09:39 -0400)]
[InstCombine] add tests for icmp predicate canonicalization with vector types; NFC
Increase coverage for D69519.
Krzysztof Parzyszek [Mon, 28 Oct 2019 20:12:43 +0000 (15:12 -0500)]
[Hexagon] Handle remaining registers in getRegisterByName()
This fixes https://llvm.org/PR43829.
Simon Pilgrim [Tue, 29 Oct 2019 13:52:32 +0000 (13:52 +0000)]
[BitVector] Define BitWord as uintptr_t
Define BitVector::BitWord as uintptr_t instead of unsigned long, as long does not necessarily translates to a pointer size (especially on 64-bit Visual Studio).
Committed on behalf of @ekatz (Ehud Katz)
Differential Revision: https://reviews.llvm.org/D69336
Sanjay Patel [Tue, 29 Oct 2019 13:25:36 +0000 (09:25 -0400)]
[IR] move/change null-check to assert
This should trigger a dereference before null-check warning,
but I don't see it when building with clang. In any case, the
current and known future users of this helper require non-null
args, so I'm converting the 'if' to an assert.
Simon Pilgrim [Tue, 29 Oct 2019 12:56:13 +0000 (12:56 +0000)]
[BitVector] Cast integer literals to BitWord [NFC]
Associate the integer literals with BitWord, instead of the embedded UL suffix.
Required for https://reviews.llvm.org/D69336.
Committed on behalf of @ekatz (Ehud Katz)
Differential Revision: https://reviews.llvm.org/D69357
Sanjay Patel [Tue, 29 Oct 2019 11:41:41 +0000 (07:41 -0400)]
[IR] move helper function to replace undef constant (elements) with fixed constants
This is the NFC part of D69519.
We had this functionality locally in instcombine, but it can be used
elsewhere, so hoisting it to Constant class.
Martin Storsjö [Mon, 21 Oct 2019 06:26:55 +0000 (09:26 +0300)]
[LLDB] [PECOFF] Use FindSectionByID to associate symbols to sections
The virtual container/header section caused the section list to be
offset by one, but by using FindSectionByID, the layout of the
section list shouldn't matter.
Differential Revision: https://reviews.llvm.org/D69366
Greg Bedwell [Tue, 29 Oct 2019 12:40:57 +0000 (12:40 +0000)]
Fix some spelling mistakes in comments. NFC
Greg Bedwell [Tue, 29 Oct 2019 12:32:01 +0000 (12:32 +0000)]
Fix a spelling mistake in a comment. NFC
(I'm currently trying to debug a strange error message I get when
pushing to github, despite the pushes being successful).
Greg Bedwell [Mon, 28 Oct 2019 14:28:00 +0000 (14:28 +0000)]
Fix a spelling mistake in a comment. NFC
Andrea Di Biagio [Tue, 29 Oct 2019 12:04:32 +0000 (12:04 +0000)]
Revert "[NFC] Replace a linked list in LiveDebugVariables pass with a DenseMap"
This reverts commit
8af5ada09319e5a021d57a1a03715b2fd022e415.
As Bjorn pointed out in D68816, the iteration over `UserVals` may not be safe.
Reverting on behalf of Orlando.
Simon Pilgrim [Tue, 29 Oct 2019 12:12:16 +0000 (12:12 +0000)]
Fix unused variable warning. NFCI.
Haojian Wu [Mon, 28 Oct 2019 15:27:42 +0000 (16:27 +0100)]
[clangd] Add a hidden tweak to dump symbol under the cursor.
Summary:
This provides a convenient way to see the SymbolID/USR of the symbol, mainly
for debugging purpose.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69517
Florian Hahn [Tue, 29 Oct 2019 11:54:18 +0000 (11:54 +0000)]
[LCSSA] Forget values we create LCSSA phis for
Summary:
Currently we only forget the loop we added LCSSA phis for. But SCEV
expressions in other loops could also depend on the instruction we added
a PHI for and currently we do not invalidate those expressions. This can
happen when we use ScalarEvolution before converting a function to LCSSA
form. The SCEV expressions will refer to the non-LCSSA value. If this
SCEV expression is then used with the expander, we do not preserve LCSSA
form.
This patch properly forgets the values we created PHIs for. Those need
to be recomputed again. This patch fixes PR43458.
Currently SCEV::verify does not catch this mismatch and any test would
need to run multiple passes to trigger the error (e.g. -loop-reduce
-loop-unroll). I will also look into catching this kind of mismatch in
the verifier. Also, we currently forget the whole loop in LCSSA and I'll
check if we can be more surgical.
Reviewers: efriedma, sanjoy.google, reames
Reviewed By: efriedma
Subscribers: zzheng, hiraditya, javed.absar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68194
Simon Pilgrim [Tue, 29 Oct 2019 11:54:38 +0000 (11:54 +0000)]
Revert rG70f5aecedef9a6e347e425eb5b843bf797b95319 - "Reland [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2)"
This fails on EXPENSIVE_CHECKS builds
Jeremy Morse [Tue, 29 Oct 2019 11:38:20 +0000 (11:38 +0000)]
[BranchFolding] skip debug instr to avoid code change
Use the existing helper function in BranchFolding, "countsAsInstruction",
to skip over non-instructions. Otherwise debug instructions can be
identified as the last real instruction in a block, leading to different
codegen decisions when debug is enabled as demonstrated by the test case.
Patch by: yechunliang (Chris Ye)!
Differential Revision: https://reviews.llvm.org/D66467
Jay Foad [Tue, 29 Oct 2019 10:31:52 +0000 (10:31 +0000)]
[ConstantFold] Push extractelement into getelementptr's operands
This fixes a minor oversight mentioned in the review of D69379:
we should push extractelement into the operands of getelementptr
regardless of whether that enables further folding.
Haojian Wu [Tue, 29 Oct 2019 09:49:27 +0000 (10:49 +0100)]
[clangd] NFC, use URI::resolve to simplify the code.
Georgii Rymar [Tue, 29 Oct 2019 08:58:19 +0000 (11:58 +0300)]
[obj2yaml] - Update a comment in a test case. NFC.
Addresses post-commit comments for D69160.
Georgii Rymar [Tue, 29 Oct 2019 08:49:19 +0000 (11:49 +0300)]
[llvm-readobj] - Fix a comment in stack-sizes.test. NFC.
To address post commit review comment for D69167.
Haojian Wu [Mon, 28 Oct 2019 12:42:20 +0000 (13:42 +0100)]
[clangd] Add missing highlights for using decls.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69506
Georgii Rymar [Mon, 28 Oct 2019 10:47:44 +0000 (13:47 +0300)]
[yaml2obj] - Make .symtab to be not mandatory section for SHT_REL[A] section.
Before this change .symtab section was required for SHT_REL[A] section
declarations. yaml2obj automatically defined it in case when YAML document
did not have it.
With this change it is now possible to produce an object that
has a relocation section, but has no symbol table.
It simplifies the code and also it is inline with how we handle Link fields
for another special sections.
Differential revision: https://reviews.llvm.org/D69260
Georgii Rymar [Mon, 28 Oct 2019 10:30:05 +0000 (13:30 +0300)]
[yaml2obj] - Improve handling of the SHT_GROUP section.
Currently, when we do not specify "Info" field in a YAML description
for SHT_GROUP section, yaml2obj reports an error:
"error: unknown symbol referenced: '' by YAML section '.group1'"
Also, we do not link it with a symbol table by default,
though it is what we do for AddrsigSection, HashSection, RelocationSection.
(http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_link)
The patch fixes missings mentioned.
Differential revision: https://reviews.llvm.org/D69299
Lang Hames [Tue, 29 Oct 2019 05:56:13 +0000 (22:56 -0700)]
[JITLink] Tighten section sorting criteria to fix a flaky test case.
Sections may have zero size and zero-sized sections may share a start address
with other zero-sized sections. For the section overlap test to function
correctly zero-sized sections must be ordered before any non-zero sized ones.
This should fix the intermittent failures in the
test/ExecutionEngine/JITLink/X86/MachO_zero_fill_alignment.s test case that
have been observed on some builders.
Matt Arsenault [Mon, 28 Oct 2019 19:26:27 +0000 (12:26 -0700)]
AMDGPU: Make VReg_1 only include 1 artificial register
When TableGen is inferring register classes from contexts, it uses a
sorting function based on the number of registers in the class. Since
this was being treated as an alias of VGPR_32, they had exactly the
same size. The sort used wasn't a stable sort, and even if it were, I
believe the tie breaker would effectively end up being the
alphabetical ordering of the class name. There appear to be issues
trying to use an empty set of registers, so add only one so this will
always sort to the end.
Also add a comment explaining how VReg_1 is a dirty hack for
SelectionDAG.
This does end up changing the behavior of i1 with inline asm and VGPR
constraints, but the existing behavior was was already nonsensical and
inconsistent. It should probably be disallowed anyway.
Fixes bug 43699
Shiva Chen [Tue, 15 Oct 2019 02:38:11 +0000 (10:38 +0800)]
[RISCV] Remove RA from reserved register to use as callee saved register
Remove RA from reserved register list, so we could use it as callee saved register
Differential Revision: https://reviews.llvm.org/D67698
Julian Lettner [Thu, 21 Feb 2019 07:05:11 +0000 (23:05 -0800)]
[lit] Remove callback indirection
The callback provides no benefits since `run.execute()` does not take
any arguments anymore.
Nico Weber [Tue, 29 Oct 2019 01:41:38 +0000 (21:41 -0400)]
Fix a few typos in lld/ELF to cycle bots
Johannes Doerfert [Mon, 21 Oct 2019 03:28:49 +0000 (22:28 -0500)]
[Attributor] Make IntegerState more flexible
To make IntegerState more flexible but also less error prone we split it
up into (1) incrementing, (2) decrementing, and (3) bit-tracking states.
This adds functionality compared to before and disallows misuse, e.g.,
"incrementing" updates on a bit-tracking state.
Part of the change is a single operator in the base class which
simplifies helper functions that deal with states.
There are certain functional changes but all of which should actually be
corrections.
LLVM GN Syncbot [Tue, 29 Oct 2019 01:06:42 +0000 (01:06 +0000)]
gn build: Merge
38839d08b8e
David Blaikie [Tue, 29 Oct 2019 01:03:59 +0000 (18:03 -0700)]
PR43764: Qualify a couple of calls to forward_as_tuple to be ADL-resilient.
Nico Weber [Tue, 29 Oct 2019 00:58:53 +0000 (20:58 -0400)]
gn build: fix bad merge of
75f72f6b done in
3431f1ba
Evgenii Stepanov [Tue, 29 Oct 2019 00:49:57 +0000 (17:49 -0700)]
[msan] Remove more attributes from sanitized functions.
Summary:
MSan instrumentation adds stores and loads even to pure
readonly/writeonly functions. It is removing some of those attributes
from instrumented functions and call targets, but apparently not enough.
Remove writeonly, argmemonly and speculatable in addition to readonly /
readnone.
Reviewers: pcc, vitalybuka
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69541
Nico Weber [Tue, 29 Oct 2019 00:56:21 +0000 (20:56 -0400)]
gn build: (manually) merge
75f72f6b
Michael Spencer [Tue, 29 Oct 2019 00:37:25 +0000 (17:37 -0700)]
[clang][clang-scan-deps] Add -fcxx-modules to test for Darwin.
Nemanja Ivanovic [Mon, 28 Oct 2019 23:33:31 +0000 (18:33 -0500)]
[PowerPC] Emit scalar fp min/max instructions
VSX provides floating point minimum and maximum instructions that conform
to IEEE semantics. This legalizes the respective nodes and emits VSX code
for them. Furthermore, on Power9 cores we have xsmaxcdp and xsmincdp
instructions that conform to language semantics for the conditional operator
even in the presence of NaNs.
Differential revision: https://reviews.llvm.org/D62993
Reid Kleckner [Tue, 29 Oct 2019 00:07:58 +0000 (17:07 -0700)]
[NFC] Fix some indentation disturbed in D67368
Joerg Sonnenberger [Tue, 29 Oct 2019 00:08:11 +0000 (01:08 +0100)]
Replace abort with llvm_unreachable.
The former depended on header pollution to be found and doesn't fit the
LLVM style of error handling.
Amy Huang [Mon, 28 Oct 2019 21:53:32 +0000 (14:53 -0700)]
Recommit "Add a heap alloc site marker field to the ExtraInfo in MachineInstrs"
Summary:
Fixes some things from original commit at https://reviews.llvm.org/D69136. The main
change is that the heap alloc marker is always stored as ExtraInfo in the machine
instruction instead of in the PointerSumType because it cannot hold more than
4 pointer types.
Add instruction marker to MachineInstr ExtraInfo. This does almost the
same thing as Pre/PostInstrSymbols, except that it doesn't create a label until
printing instructions. This allows for labels to be put around instructions that
are deleted/duplicated somewhere.
Use this marker to track heap alloc site call instructions.
Reviewers: rnk
Subscribers: MatzeB, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69536
Haibo Huang [Wed, 16 Oct 2019 05:22:53 +0000 (22:22 -0700)]
[lldb] move package generation from python to cmake
Summary: This is the last part. And we can remove the python script.
Subscribers: lldb-commits, mgorny
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69019
Jim Ingham [Mon, 28 Oct 2019 23:15:09 +0000 (16:15 -0700)]
Modernize TestThreadStepOut.py
This test was timing out on the swift CI bots. I didn't see any obvious reason
for that, and the test hasn't had problems on greendragon. OTOH, it was a bit
oddly written, and needed modernizing, so I did that.
Differential Revision: https://reviews.llvm.org/D69453
Amara Emerson [Mon, 28 Oct 2019 00:04:47 +0000 (17:04 -0700)]
[AArch64][GlobalISel] Fix assertion fail in C++ selection for vector zext of <4 x s8>
We bailed out of dealing with vectors only after the assertion, move it before.
Fixes PR43794
Vedant Kumar [Mon, 28 Oct 2019 18:35:36 +0000 (11:35 -0700)]
[debugserver] Detect arch from LLVM_DEFAULT_TARGET_TRIPLE
The debugserver build needs to conditionally include files depending on the
target architecture.
Switch on the architecture specified by LLVM_DEFAULT_TARGET_TRIPLE, as
the llvm and swift build systems use this variable to identify the
target (the latter, indirectly, through LLVM_HOST_TRIPLE).
It would be possible to switch on CMAKE_OSX_ARCHITECTURES, but the swift
build does not provide it, preferring instead to pass arch-specific
CFLAGS etc explicitly. Switching on LLVM_HOST_TRIPLE is also an option,
but it breaks down when cross-compiling.
Differential Revision: https://reviews.llvm.org/D69523
Dávid Bolvanský [Sun, 27 Oct 2019 14:57:54 +0000 (15:57 +0100)]
[Builtins] Teach Clang about memccpy
Summary: Hopefully, -fno-builtin-memccpy will work now. Required for https://reviews.llvm.org/D67986.
Reviewers: aaron.ballman, rsmith
Reviewed By: aaron.ballman
Subscribers: RKSimon, kristina, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68377
Nemanja Ivanovic [Mon, 28 Oct 2019 21:08:30 +0000 (16:08 -0500)]
[PowerPC] Do not emit HW loop if the body contains calls to lrint/lround
These two intrinsics are lowered to calls so should prevent the formation of
CTR loops. In a subsequent patch, we will handle all currently known intrinsics
and prevent the formation of HW loops if any unknown intrinsics are encountered.
Differential revision: https://reviews.llvm.org/D68841
Vlad Tsyrklevich [Mon, 28 Oct 2019 22:21:38 +0000 (15:21 -0700)]
Revert "[clang] Add no_builtin attribute"
This reverts commit
bd87916109483d33455cbf20da2309197b983cdd. It was
causing ASan/MSan failures on the sanitizer buildbots.
Kostya Kortchinsky [Mon, 28 Oct 2019 22:06:10 +0000 (15:06 -0700)]
[scudo][standalone] Lists fix
Summary:
Apparently during the review of D69265, and my flailing around with
git, a somewhat important line disappeared.
On top of that, there was no test exercising that code path, and
while writing the follow up patch I intended to write, some `CHECK`s
were failing.
Re-add the missing line, and add a test that fails without said line.
Reviewers: hctim, morehouse, pcc, cferris
Reviewed By: hctim
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D69529
jasonliu [Mon, 28 Oct 2019 21:46:22 +0000 (21:46 +0000)]
[NFCI][XCOFF][AIX] Skip empty Section during object file generation
This is a fix to D69112 where we common up the logic of writing CsectGroup.
However, we forget to skip the Sections that are empty in that patch.
Reviewed by: daltenty, xingxue
Differential Revision: https://reviews.llvm.org/D69447
Jonas Devlieghere [Mon, 28 Oct 2019 22:01:27 +0000 (15:01 -0700)]
[Docs] Repurpose 'sources' page as 'contributing'.
The page describing how to get the sources was more about contributing
to LLDB than getting the actual source. This patch moves some things
around and repurposes this page as a contributing to LLDB landing page.
Vlad Tsyrklevich [Mon, 28 Oct 2019 21:36:31 +0000 (14:36 -0700)]
Revert "[Concepts] Constraint Enforcement & Diagnostics"
This reverts commit
ffa214ef22892d75340dc6720271863901dc2c90, it was
causing ASAN test failures on sanitizer-x86_64-linux-bootstrap.
Puyan Lotfi [Mon, 28 Oct 2019 21:57:51 +0000 (17:57 -0400)]
[MachineOutliner][NFC] clang-formating the MachineOutliner.
Reid Kleckner [Mon, 28 Oct 2019 21:40:17 +0000 (14:40 -0700)]
Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings"
This reverts commit
9d4806a387892972fd544c0dcaefb0926126220c.
There seem to be bugs in llvm-cov --path-equivalence that are causing
Chromium problems. Revert this until they are understood or fixed.
shafik [Mon, 28 Oct 2019 21:26:54 +0000 (14:26 -0700)]
Add support for DW_AT_export_symbols for anonymous structs
Summary:
We add support for DW_AT_export_symbols to detect anonymous struct on top of the heuristics implemented in D66175
This should allow us to differentiate anonymous structs and unnamed structs.
We also fix TestTypeList.py which was incorrectly detecting an unnamed struct as an anonymous struct.
Differential Revision: https://reviews.llvm.org/D68961
Leonard Chan [Mon, 28 Oct 2019 21:19:38 +0000 (14:19 -0700)]
[Driver] Enable ShadowCallStack, not SafeStack, by default on AArch64 Fuchsia
Submitted for mcgrathr.
On AArch64, Fuchsia fully supports both SafeStack and ShadowCallStack ABIs.
The latter is now preferred and will be the default. It's possible to
enable both simultaneously, but ShadowCallStack is believed to have most
of the practical benefit of SafeStack with less cost.
Differential Revision: https://reviews.llvm.org/D66712
Julian Lettner [Thu, 21 Feb 2019 06:54:38 +0000 (22:54 -0800)]
[lit] Refactor merging of user parameters
Artem Belevich [Tue, 22 Oct 2019 21:07:15 +0000 (14:07 -0700)]
[NVPTX] Added llvm.nvvm.mma.m8n8k4.* intrinsics
Differential Revision: https://reviews.llvm.org/D69324
Evgenii Stepanov [Mon, 28 Oct 2019 20:00:40 +0000 (13:00 -0700)]
[hwasan] Fix typo in the error type.
"alocation-tail-overwritten" -> "allocation-tail-overwritten"
Jonas Devlieghere [Mon, 28 Oct 2019 20:14:47 +0000 (13:14 -0700)]
[LLDB] Remove incorrect dotest.py invocation
The invocation shown by dotest.py to re-run a single test is misleading:
it ranges from missing arguments (best case scenario) to being totally
wrong (worst case scenario).
In the past I've tried to get it right, but given the dotest
architecture this is harder than it looks. Furthermore, we have pretty
good documentation on the website [1] for most use cases.
This patch removes the rerun invocation.
[1] https://lldb.llvm.org/resources/test.html
Francis Visoiu Mistrih [Mon, 28 Oct 2019 20:13:39 +0000 (13:13 -0700)]
[Remarks] Fix Sphinx formatting
Francis Visoiu Mistrih [Mon, 28 Oct 2019 20:07:05 +0000 (13:07 -0700)]
[Remarks] Add bitstream to the list of supported formats in clang
Hiroshi Yamauchi [Mon, 28 Oct 2019 19:35:34 +0000 (12:35 -0700)]
[PGO][PGSO] SizeOpts changes.
Summary:
(Split of off D67120)
SizeOpts/MachineSizeOpts changes for profile guided size optimization.
(A second try after previously committed as r375254 and reverted as r375375.)
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69409
Francis Visoiu Mistrih [Mon, 28 Oct 2019 18:14:48 +0000 (11:14 -0700)]
[Remarks] Remove references to ELF support
There is no ELF support at the moment.
Remove all the references to the `.remarks` section.