Peter Waller [Mon, 10 Jun 2019 13:12:43 +0000 (14:12 +0100)]
[clang][driver] Add basic --driver-mode=flang support for fortran
This patch adds a new Flang mode. When in Flang mode, the driver will
invoke flang for fortran inputs instead of falling back to the GCC
toolchain as it would otherwise do.
The behaviour of other driver modes are left unmodified to preserve
backwards compatibility.
It is intended that a soon to be implemented binary in the flang project
will import libclangDriver and run the clang driver in the new flang
mode.
Please note that since the binary invoked by the driver is under
development, there will no doubt be further tweaks necessary in future
commits.
* Initial support is added for basic driver phases
* -E, -fsyntax-only, -emit-llvm -S, -emit-llvm, -S, (none specified)
* -### tests are added for all of the above
* This is more than is supported by f18 so far, which will emit errors
for those options which are unimplemented.
* A test is added that ensures that clang gives a reasonable error
message if flang is not available in the path (without -###).
* Test that the driver accepts multiple inputs in --driver-mode=flang.
* Test that a combination of C and Fortran inputs run both clang and
flang in --driver-mode=flang.
* clang/test/Driver/fortran.f95 is fixed to use the correct fortran
comment character.
Differential revision: https://reviews.llvm.org/D63607
Georgii Rymar [Mon, 28 Oct 2019 09:52:28 +0000 (12:52 +0300)]
[llvm-objcopy] - Do not crash on object that has relocations but no symbol table.
It was revealed by D69260.
Tool crashed when scanned relocations in a object without a symbol table.
This patch teaches it either to handle such objects (when relocations
does not use symbols we do not need a symbol table to proceed)
or to show an appropriate error otherwise.
Differential revision: https://reviews.llvm.org/D69304
AndreyChurbanov [Wed, 30 Oct 2019 09:35:53 +0000 (12:35 +0300)]
Enable OpenBSD support.
Patch by devnexen (David CARLIER)
Differential Revision: https://reviews.llvm.org/D69220
Alex Richardson [Wed, 30 Oct 2019 09:35:10 +0000 (09:35 +0000)]
[UpdateTestChecks] Fix invalid python string escapes
Guillaume Chatelet [Wed, 30 Oct 2019 09:13:15 +0000 (10:13 +0100)]
[Alignment] Use Align for TFI.getStackAlignment() in X86ISelLowering
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet, craig.topper, rnk
Reviewed By: rnk
Subscribers: rnk, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69034
Alex Richardson [Wed, 30 Oct 2019 09:17:29 +0000 (09:17 +0000)]
[update_cc_test_checks.py] Fix invalid python string escape sequence
This works with current python version but will be an error with 3.9
Karl-Johan Karlsson [Wed, 30 Oct 2019 06:45:39 +0000 (07:45 +0100)]
[AddressSanitizer] Only instrument globals of default address space
The address sanitizer ignore memory accesses from different address
spaces, however when instrumenting globals the check for different
address spaces is missing. This result in assertion failure. The fault
was found in an out of tree target.
The patch skip all globals of non default address space.
Reviewed By: leonardchan, vitalybuka
Differential Revision: https://reviews.llvm.org/D68790
QingShan Zhang [Wed, 30 Oct 2019 07:56:35 +0000 (07:56 +0000)]
[PowerPC] Clear the sideeffect bit for those instructions that didn't have the match pattern
If the instruction have match pattern, llvm-tblgen will infer the sideeffect bit from the match pattern and it works well.
If not, the tblgen will set it as true that hurt the scheduling.
PowerPC has some instructions that didn't specify the match pattern(i.e. LXSD etc), which is manually selected post-ra according
to the register pressure. We need to clear the sideeffect flag for these instructions.
Differential Revision: https://reviews.llvm.org/D69232
Craig Topper [Wed, 30 Oct 2019 07:35:20 +0000 (00:35 -0700)]
[Target] Change PATCHABLE_EVENT_CALL/PATCHABLE_TYPED_EVENT_CALL to use unknown instead of i8imm/i16imm/i32imm in its definition.
These instructions don't use immediates, they use registers. But
the register class needed is target specific. So just use unknown.
Craig Topper [Wed, 30 Oct 2019 05:59:37 +0000 (22:59 -0700)]
[X86] Add test case for PR43758. NFC
Seiya Nuta [Wed, 30 Oct 2019 07:08:24 +0000 (16:08 +0900)]
[llvm-objcopy] Add REQUIRES directive to fix a test
Buildbot failure log: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/11164
David Zarzycki [Mon, 28 Oct 2019 12:39:40 +0000 (14:39 +0200)]
[X86] Make memcmp vector lowering handle arbitrary expansions
Teach combineVectorSizedSetCCEquality() to handle arbitrary memcmp
expansions but do not change any default policy for now.
This also fixes a bug in the memcmp expansion itself when large
displacements are needed.
https://reviews.llvm.org/D69507
Seiya Nuta [Wed, 30 Oct 2019 06:12:17 +0000 (15:12 +0900)]
[llvm-objcopy][MachO] Support indirect symbol table
Summary:
Parse the indirect symbol table and update the indexes of
symbol entries in the table in the writer in case they have
been changed.
Reviewers: alexshap, rupprecht, jhenderson
Reviewed By: alexshap, rupprecht
Subscribers: jakehehrlich, abrachet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66280
Fangrui Song [Wed, 30 Oct 2019 05:55:17 +0000 (22:55 -0700)]
[Orc][test] Fix -DBUILD_SHARED_LIBS=on build
Fangrui Song [Wed, 30 Oct 2019 05:46:13 +0000 (22:46 -0700)]
[lli-child-target] Fix -DBUILD_SHARED_LIBS=on build
Fangrui Song [Wed, 30 Oct 2019 05:37:28 +0000 (22:37 -0700)]
[lli] Fix -DBUILD_SHARED_LIBS=on build
This fixes:
ld.lld: error: undefined symbol: vtable for llvm::orc::rpc::ResponseAbandoned
>>> referenced by lli.cpp
In -DBUILD_SHARED_LIBS=on builds, all directly referenced references must
be linked to appease -Wl,-z,defs.
Vlad Tsyrklevich [Wed, 30 Oct 2019 05:38:38 +0000 (22:38 -0700)]
Revert "[llvm-cov] Add option to whitelist filenames"
This reverts commit
bfed824b57d14e2ba98ddbaf1a1410cf04a3e279, the
included test fails on many bots including the sanitier bots, e.g. in
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36140
Sam Clegg [Mon, 28 Oct 2019 22:24:52 +0000 (15:24 -0700)]
[WebAssembly][lld] Fix for static linking of PIC code
When statically linking PIC code we create an internalized __memory_base
so that memory-base-relative relocation work correctly. The value of
this global should be zero, and not the globalBase since the globalBase
offset is already taken into account by getVirtualAddress.
Fixes: https://github.com/emscripten-core/emscripten/issues/9013
Differential Revision: https://reviews.llvm.org/D69600
Nico Weber [Wed, 30 Oct 2019 01:50:16 +0000 (21:50 -0400)]
gn build: (manually) merge
a34680a3
Vedant Kumar [Tue, 29 Oct 2019 22:47:23 +0000 (15:47 -0700)]
[llvm-cov] Add option to whitelist filenames
Add the `-whitelist-filename-regex` option to restrict coverage
reporting to file paths that match a whitelist regex.
Patch by Michael Daniels!
rdar://
56720320
Julian Lettner [Mon, 25 Feb 2019 05:49:42 +0000 (21:49 -0800)]
[lit] Refactor ordering of tests
Fedor Sergeev [Thu, 24 Oct 2019 19:24:44 +0000 (12:24 -0700)]
[ADT] add equality operator for SmallSet
Makes it easier to migrate existing code that uses std::set.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D69417
Chris Bieneman [Wed, 9 Oct 2019 21:27:52 +0000 (14:27 -0700)]
Break out OrcError and RPC
Summary:
When createing an ORC remote JIT target the current library split forces the target process to link large portions of LLVM (Core, Execution Engine, JITLink, Object, MC, Passes, RuntimeDyld, Support, Target, and TransformUtils). This occurs because the ORC RPC interfaces rely on the static globals the ORC Error types require, which starts a cycle of pulling in more and more.
This patch breaks the ORC RPC Error implementations out into an "OrcError" library which only depends on LLVM Support. It also pulls the ORC RPC headers into their own subdirectory.
With this patch code can include the Orc/RPC/*.h headers and will only incur link dependencies on LLVMOrcError and LLVMSupport.
Reviewers: lhames
Reviewed By: lhames
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68732
Richard Smith [Wed, 30 Oct 2019 00:05:40 +0000 (17:05 -0700)]
Suppress useless GCC "bitfield is too small to hold all values of enum class" warning.
Austin Kerbow [Tue, 29 Oct 2019 16:55:49 +0000 (09:55 -0700)]
AMDGPU/GlobalISel: Legalize FDIV32
Reviewers: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69581
Reid Kleckner [Tue, 29 Oct 2019 00:05:34 +0000 (17:05 -0700)]
[MS] Fix constexpr data member pointer conversions
Constexpr data member conversions work by starting with the class that
originally introduced the field, and converting from there to the type
that the user desires. Before this change, Clang was using the
inheritance model from the final destination class type instead of the
model from the class that originally introduced the field. To fix this,
find the relevant FieldDecl and take its parent class instead of using
the member pointer type the user provided.
Indirect field decls require some special handling to find the parent
class.
Fixes PR43803
Jonas Devlieghere [Tue, 29 Oct 2019 23:35:28 +0000 (16:35 -0700)]
[lldbsuite] Remove unused test_event files
These files don't appear to be used anywhere and the corresponding tests
are not run.
Jonas Devlieghere [Tue, 29 Oct 2019 23:30:37 +0000 (16:30 -0700)]
[lldbsuite] Remove the DumpFormatter
This formatter is never used or referenced.
Jonas Devlieghere [Tue, 29 Oct 2019 23:29:12 +0000 (16:29 -0700)]
[lldbsuite] Remove pre_kill_hook package
This package was only used by dosep.py which has since been removed.
Jonas Devlieghere [Tue, 29 Oct 2019 23:26:49 +0000 (16:26 -0700)]
[lldbsuite] Remove unused support files
To the best of my understanding these files or their content is nowhere
referenced.
Julian Lettner [Thu, 21 Feb 2019 07:33:15 +0000 (23:33 -0800)]
[lit] Small improvements in cl_arguments.py
*) `--max-tests` should be positive integer
*) `--max-time` should be positive integer
*) Remove unnecessary defaults for command line option parsing
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.