Konstantin Pyzhov [Mon, 6 Apr 2020 09:10:37 +0000 (05:10 -0400)]
[AMDGPU] Disable 'Skip Uniform Regions' optimization by default for AMDGPU.
Reviewers: sameerds, dstuttard
Differential Revision: https://reviews.llvm.org/D77228
Matt Morehouse [Mon, 6 Apr 2020 16:55:56 +0000 (09:55 -0700)]
[sanitizer_common] Update global_symbols.txt.
Matt Morehouse [Mon, 6 Apr 2020 16:55:03 +0000 (09:55 -0700)]
Revert "[sanitizer_common] Show new unexpected symbols."
This reverts commit
68d73dfa1a422fd045e25d06c3e8ff01621c377a.
Matt Morehouse [Mon, 6 Apr 2020 16:54:56 +0000 (09:54 -0700)]
Revert "[sanitizer_common] Update global_symbols.txt."
This reverts commit
98bb7fdbe586e7f95588c99c5363e94870da75f5.
Fangrui Song [Tue, 10 Mar 2020 00:35:50 +0000 (17:35 -0700)]
[AArch64] Allow logical immediates to have all-1 in top bits
So that constant expressions like the following are permitted:
and w0, w0, #~(0xfe<<24)
and w1, w1, #~(0xff<<24)
The behavior matches GNU as (opcodes/aarch64-opc.c:aarch64_logical_immediate_p).
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D75885
Florian Hahn [Mon, 6 Apr 2020 16:53:38 +0000 (17:53 +0100)]
[LV] Fix value that could be read uninitialized.
This should fix
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/18569
Amy Huang [Tue, 31 Mar 2020 20:31:42 +0000 (13:31 -0700)]
[DebugInfo] Change to constructor homing debug info mode: skip literal types
Summary:
In constructor type homing mode sometimes complete debug info for constexpr
types was missing, because there was not a constructor emitted. This change
makes constructor type homing ignore constexpr types.
Reviewers: rnk, dblaikie
Subscribers: aprantl, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77432
Fangrui Song [Wed, 1 Apr 2020 23:11:31 +0000 (16:11 -0700)]
[ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls
Fixes https://bugs.llvm.org/show_bug.cgi?id=45391
The LTO code generator happens after version script scanning and may
create references which will fetch some lazy symbols.
Currently a version script does not assign VER_NDX_LOCAL to lazy symbols
and such symbols will be made global after they are fetched.
Change findByVersion and findAllByVersion to work on lazy symbols.
For unfetched lazy symbols, we should keep them non-local (D35263).
Check isDefined() in computeBinding() as a compensation.
This patch fixes a companion bug that --dynamic-list does not export
libcall fetched symbols.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D77280
Matt Morehouse [Mon, 6 Apr 2020 16:42:32 +0000 (09:42 -0700)]
[sanitizer_common] Update global_symbols.txt.
Matt Morehouse [Mon, 6 Apr 2020 16:39:53 +0000 (09:39 -0700)]
[sanitizer_common] Show new unexpected symbols.
Louis Dionne [Mon, 6 Apr 2020 16:40:54 +0000 (12:40 -0400)]
[libc++] Mark two std::timed_mutex tests as flaky
Nikita Popov [Sat, 4 Apr 2020 22:46:20 +0000 (00:46 +0200)]
[RDA] Only store most recent reaching def from predecessors (NFCI)
When entering a basic block, RDA inserts reaching definitions coming
from predecessor blocks (which will be negative numbers) in a rather
peculiar way. If you have incoming reaching definitions -4, -3, -2, -1,
it will insert those. If you have incoming reaching definitions
-1, -2, -3, -4, it will insert -1, -1, -1, -1, as the max is taken
at each step. That's probably not what was intended...
However, RDA only actually cares about the most recent reaching
definition from a predecessor (to calculate clearance), so this
ends up working fine as far as behavior is concerned. It does
waste memory on unnecessary reaching definitions though.
This patch changes the implementation to first compute the most
recent reaching definition in one loop, and then insert only that
one in a separate loop.
Differential Revision: https://reviews.llvm.org/D77508
Sanjay Patel [Mon, 6 Apr 2020 16:34:59 +0000 (12:34 -0400)]
[x86] add size cost tests for casts and binops; NFC
Shows bugs for div/rem/fdiv and possibly others.
Nikita Popov [Sun, 5 Apr 2020 17:16:56 +0000 (19:16 +0200)]
[RDA] Don't adjust ReachingDefDefaultVal (NFCI)
At the end of a basic block, RDA adjusts all the reaching defs it
found to be relative to the end of the basic block, rather than the
start of it. However, it also does this to registers which don't
have a reaching def, indicated by ReachingDefDefaultVal. This means
that code checking against ReachingDefDefaultVal will not skip them,
and may insert them into the reaching definition list. This is
ultimately harmless, but causes unnecessary work and is logically
not right.
Differential Revision: https://reviews.llvm.org/D77506
Alexey Bataev [Mon, 6 Apr 2020 15:49:17 +0000 (11:49 -0400)]
[OPENMP]Fix PR45439: `omp for collapse(2) ordered(2)` generates invalid
IR.
Fixed a crash because of the not quite correct casting of the value of
iterations.
Kazuaki Ishizaki [Mon, 6 Apr 2020 16:06:02 +0000 (01:06 +0900)]
[lldb] NFC: Fix trivial typo in comments, documents, and messages
Differential Revision: https://reviews.llvm.org/D77460
Scott Linder [Fri, 3 Apr 2020 19:48:28 +0000 (15:48 -0400)]
Use in-tree clang-format-diff.py as Arcanist linter
Summary:
The only guarantee there seems to be in the clang-format packaging is
that an executable called `clang-format` is in the PATH. Use the
in-tree `clang-format-diff.py` to avoid assuming anything else.
Also remove dead code for SVN repo and switch to `git diff-index` which
is the git plumbing equivalent of `git diff` in this case.
Reviewers: starsid, mehdi_amini, vitalybuka, fhahn, kadircet
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77428
Jonathan Roelofs [Mon, 6 Apr 2020 15:37:14 +0000 (09:37 -0600)]
[llvm-objdump] Fix case of -Wmismatched-tags
Jonathan Roelofs [Thu, 2 Apr 2020 22:28:32 +0000 (16:28 -0600)]
[llvm] Fix missing FileCheck directive colons
https://reviews.llvm.org/D77352
Sanjay Patel [Mon, 6 Apr 2020 15:40:45 +0000 (11:40 -0400)]
[ValueTracking] enhance matching of umin/umax with 'not' operands
The cmyk test is based on the known regression that resulted from:
rGf2fbdf76d8d0
This improves on the equivalent signed min/max change:
rG867f0c3c4d8c
The underlying icmp equivalence is:
~X pred ~Y --> Y pred X
For an icmp with constant, canonicalization results in a swapped pred:
~X < C --> X > ~C
BoYao Zhang [Mon, 6 Apr 2020 15:49:51 +0000 (11:49 -0400)]
Fix a typo in an assert message; NFC.
Matt Arsenault [Mon, 6 Apr 2020 01:16:00 +0000 (21:16 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.div.scale
Matt Arsenault [Sun, 5 Apr 2020 23:49:09 +0000 (19:49 -0400)]
AMDGPU/GlobalISel: Fix llvm.amdgcn.div.fmas.ll
Jay Foad [Mon, 6 Apr 2020 15:44:08 +0000 (16:44 +0100)]
[AMDGPU] Fix inaccurate comments
Louis Dionne [Mon, 6 Apr 2020 15:04:13 +0000 (11:04 -0400)]
[libc++] Always use -fsyntax-only in .fail.cpp tests
We had a workaround because GCC 5 does not evaluate static assertions
that are dependent on template parameters. This commit removes the
workaround and marks the corresponding tests as unsupported with GCC 5.
This has the benefit of bringing the new and the old test formats closer
without having to carry a workaround for an old compiler in the new
test format.
Gabor Marton [Fri, 3 Apr 2020 15:01:00 +0000 (17:01 +0200)]
[analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl
Summary:
Currently we match the summary signature based on the arguments in the CallExpr.
There are a few problems with this approach.
1) Variadic arguments are handled badly. Consider the below code:
int foo(void *stream, const char *format, ...);
void test_arg_constraint_on_variadic_fun() {
foo(0, "%d%d", 1, 2); // CallExpr
}
Here the call expression holds 4 arguments, whereas the function declaration
has only 2 `ParmVarDecl`s. So there is no way to create a summary that
matches the call expression, because the discrepancy in the number of
arguments causes a mismatch.
2) The call expression does not handle the `restrict` type qualifier.
In C99, fwrite's signature is the following:
size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
However, in a call expression, like below, the type of the argument does not
have the restrict qualifier.
void test_fread_fwrite(FILE *fp, int *buf) {
size_t x = fwrite(buf, sizeof(int), 10, fp);
}
This can result in an unmatches signature, so the summary is not applied.
The solution is to match the summary against the referened callee
`FunctionDecl` that we can query from the `CallExpr`.
Further patches will continue with additional refactoring where I am going to
do a lookup during the checker initialization and the signature match will
happen there. That way, we will not check the signature during every call,
rather we will compare only two `FunctionDecl` pointers.
Reviewers: NoQ, Szelethus, gamesh411, baloghadamsoftware
Subscribers: whisperity, xazax.hun, kristof.beyls, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, steakhal, danielkiss, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77410
Louis Dionne [Mon, 6 Apr 2020 14:25:51 +0000 (10:25 -0400)]
[libc++] Make sure we include %{flags} when building with the new format
Otherwise, we're missing some flags like the flags that are used by
sanitizer builds and the 32-bit builds. In the long term, I think it
would be better to have only %{compile_flags} and %{link_flags}, but
for the benefit of adopting the new format by default, I think it's OK
to add %{flags} to it.
Louis Dionne [Mon, 6 Apr 2020 14:46:14 +0000 (10:46 -0400)]
[libc++] Mark is_scalar test as unsupported in C++11 and C++14
That test requires std::optional. We never noticed that because our
test format was skipping Objective-C++ tests altogether.
Nicolas Vasilache [Mon, 6 Apr 2020 15:18:28 +0000 (11:18 -0400)]
[mlir][Linalg] Add a linalg.tensor_reshape to operate on tensors
Summary:
This revision adds a tensor_reshape operation that operates on tensors.
In the tensor world the constraints are less stringent and we can allow more
arbitrary dynamic reshapes, as long as they are contractions.
The expansion of a dynamic dimension into multiple dynamic dimensions is under-specified and is punted on for now.
Differential Revision: https://reviews.llvm.org/D77360
Sanjay Patel [Mon, 6 Apr 2020 15:12:16 +0000 (11:12 -0400)]
[ValueTracking] add/adjust tests for min/max; NFC
Martin Probst [Mon, 6 Apr 2020 13:20:54 +0000 (15:20 +0200)]
clang-format: [JS] handle pseudo-keywords.
Summary:
The previous change in https://reviews.llvm.org/D77311 attempted to
detect more C++ keywords. However it also precisely detected all
JavaScript keywords. That's generally correct, but many JavaScripy
keywords, e.g. `get`, are so-called pseudo-keywords. They can be used in
positions where a keyword would never be legal, e.g. in a dotted
expression:
x.type; // type is a pseudo-keyword, but can be used here.
x.get; // same for get etc.
This change introduces an additional parameter to
`IsJavaScriptIdentifier`, allowing clients to toggle whether they want
to allow `IdentifierName` tokens, i.e. pseudo-keywords.
Reviewers: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77548
Gabor Marton [Fri, 3 Apr 2020 15:56:28 +0000 (17:56 +0200)]
[analyzer] StdLibraryFunctionsChecker: Add test for function with default parameter
Reviewers: Szelethus, baloghadamsoftware, gamesh411, steakhal, balazske
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77411
Florian Hahn [Mon, 6 Apr 2020 14:59:45 +0000 (15:59 +0100)]
[VPlan] Introduce new VPWidenCallRecipe (NFC).
This patch moves calls to their own recipe, to simplify the transition
to VPUser for operands of VPWidenRecipe, as discussed in D76992.
Subsequently additional information can be added to the recipe rather
than computing it during the execute step.
Reviewers: rengolin, Ayal, gilr, hsaito
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D77467
Chris Bowler [Mon, 6 Apr 2020 14:41:48 +0000 (10:41 -0400)]
[AIX][PPC] Implement by-val caller arguments in multiple registers
Differential Revision: https://reviews.llvm.org/D76380
Matt Arsenault [Thu, 6 Feb 2020 19:44:56 +0000 (14:44 -0500)]
AMDGPU/GlobalISel: Add unmerge of concat tests
Guillaume Chatelet [Mon, 6 Apr 2020 10:53:56 +0000 (10:53 +0000)]
[Alignment][NFC] Assume AlignmentFromAssumptions::getNewAlignment is always set.
Summary:
In D77454 we explain that `LoadInst` and `StoreInst` always have their alignment defined.
This allows to work backward here and to infer that `getNewAlignment` does not need to return `0` in case of failure.
Returning `1` also works since it needs to be greater than the Load/Store alignment which is a least `1`.
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
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77538
Nico Weber [Mon, 6 Apr 2020 14:47:41 +0000 (10:47 -0400)]
try to fix tsan bot
Chris Bowler [Mon, 6 Apr 2020 13:51:21 +0000 (09:51 -0400)]
[NFC][PPC][AIX] Test updates for byval args that fit in a single register
Differential Revision: https://reviews.llvm.org/D76875
diggerlin [Mon, 6 Apr 2020 14:09:12 +0000 (10:09 -0400)]
[llvm-objdump][XCOFF] Use symbol index+symbol name + storage mapping class as label for -D
SUMMARY:
For the llvm-objdump -D, the symbol name is used as a label in the disassembly for the specific address (when a symbol address is equal to the virtual address in the dump).
In XCOFF, multiple symbols may have the same name, being differentiated by their storage mapping class. It is helpful to print the QualName and not just the name when forming the output label for a csect symbol. The symbol index further removes any ambiguity caused by duplicate names.
To maintain compatibility with the binutils objdump, the XCOFF-specific --symbol-description option is added to enable the enhanced format.
Reviewers: hubert.reinterpretcast, James Henderson, Jason Liu ,daltenty
Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D72973
Konrad Kleine [Mon, 6 Apr 2020 12:37:58 +0000 (08:37 -0400)]
[lldb][nfc] remove overriden funcs with default impl
Summary:
These `SearchFilter` methods all return `true` by their default
implementation:
```lang=c++
virtual bool ModulePasses(const FileSpec &spec);
virtual bool ModulePasses(const lldb::ModuleSP &module_sp);
virtual bool AddressPasses(Address &addr);
virtual bool CompUnitPasses(FileSpec &fileSpec);
virtual bool CompUnitPasses(CompileUnit &compUnit);
```
That's why I've documented the default behavior and remove the overrides
(except for `AddressPasses`) in these `SearchFilter`-subclasses which all just
repeated the default implementation: `SearchFilterByModule`,
`SearchFilterByModuleList`.
Reviewers: jankratochvil, labath
Reviewed By: jankratochvil, labath
Subscribers: labath, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77376
Hans Wennborg [Mon, 6 Apr 2020 14:01:48 +0000 (16:01 +0200)]
Make clang/test/Driver/cl-options.cu pass in 32-bit builds
Johannes Doerfert [Mon, 6 Apr 2020 13:59:47 +0000 (08:59 -0500)]
[OpenMP][FIX] Add missing cmake dependence needed after
931c0cd713ee
Louis Dionne [Mon, 6 Apr 2020 13:33:08 +0000 (09:33 -0400)]
[libc++] SSH: Fix tarring of dependencies on Windows
On Windows, we must make sure to close the temporary tar file before we
try to scp it.
This is an alternative approach to https://reviews.llvm.org/D77500.
Michael Kruse [Thu, 2 Apr 2020 15:06:17 +0000 (10:06 -0500)]
[Polly] Add -polly-isl-arg command line option.
The option is passed as argv to ISL's command line option parser.
Polly's own own command line options take precedence over options passed
as `-polly-isl-arg`. For instance,
`-polly-isl-arg=--schedule-outer-coincidence` will be ignored in favor
of `-polly-opt-outer-coincidence`.
Reviewed By: grosser
Differential Revision: https://reviews.llvm.org/D77303
Benjamin Kramer [Mon, 6 Apr 2020 13:21:16 +0000 (15:21 +0200)]
[MC] Use a byte_swap in emitIntValue instead of doing it in a loop. NFCI.
Florian Hahn [Mon, 6 Apr 2020 13:44:00 +0000 (14:44 +0100)]
[Matrix] Update load/storeMatrix to take indices as Value* (NFC).
This allows using the functions to be used with loop dependent indices.
James Henderson [Mon, 6 Apr 2020 09:47:13 +0000 (10:47 +0100)]
Make test more robust
llvm-readobj prints the file path as part of the output, so
--implicit-check-not patterns can accidentally match it. This patch
makes the test more robust by preventing failures if "foo" is in
somebody's path.
Reviewed by: grimar
Differential Revision: https://reviews.llvm.org/D77546
Jaroslav Sevcik [Mon, 6 Apr 2020 13:41:33 +0000 (15:41 +0200)]
[lldb-server] jThreadsInfo returns stack memory
This patch adds parts of the stack that should be useful for unwinding
to the jThreadsInfo reply from lldb-server. We return the top of the
stack (12 words), and we also try to walk the frame pointer linked list
and return the memory containing frame pointer and return address pairs.
The idea is to cover the cases with and without frame pointer omission.
Differential Revision: https://reviews.llvm.org/D74398
Chris Bowler [Mon, 6 Apr 2020 13:36:59 +0000 (09:36 -0400)]
test commit
Matt Arsenault [Fri, 20 Dec 2019 16:09:45 +0000 (21:39 +0530)]
AMDGPU: Use DAG patterns for div_fmas
Matt Arsenault [Thu, 21 Feb 2019 19:55:29 +0000 (14:55 -0500)]
AMDGPU: Remove DisableInst feature
I'm not sure why these were bothering to check the instruction
profile, since those profiles should only be used with these
instruction classes.
Matt Arsenault [Wed, 29 Aug 2018 06:25:36 +0000 (09:25 +0300)]
DAG: Combine extract_vector_elt of concat_vectors
Fixes extra canonicalize regressions when legalizing
vector fminnum/fmaxnum.
Nico Weber [Sun, 5 Apr 2020 00:25:27 +0000 (20:25 -0400)]
Make paths in generated llvm-lit relative as well.
This builds on top of D77184. With this, I can rename my build directory
to a different name and `bin/llvm-lit ../llvm-project/clang/test
../llvm-project/llvm/test` still succeeds.
I haven't tried copying the build dir to a different machine to run
tests there yet, but I tried something like it a few months ago and it
worked back then.
Changes:
- Make configure_lit_site_cfg() store the main / generated config pair
interleaved in the LLVM_LIT_CONFIG_FILES list and postpone converting
it to python code to llvm-lit's CMakeList.
- Pull the relpath code into a new function make_paths_relative() and
call that in llvm-lit's CMakeList, prior to converting the list to
python code.
- Pull the path() function into a variable and use that in llvm-lit's
CMakeList too.
Differential Revision: https://reviews.llvm.org/D77496
Sergej Jaskiewicz [Mon, 6 Apr 2020 13:12:44 +0000 (09:12 -0400)]
[libc++] [test] Add missing FILE_DEPENDENCIES to align.pass.sh.cpp
Differential Revision: https://reviews.llvm.org/D77541
Hans Wennborg [Mon, 6 Apr 2020 13:05:08 +0000 (15:05 +0200)]
Revert
43f031d3126 "Enable IBT(Indirect Branch Tracking) in JIT with CET(Control-flow Enforcement Technology)"
ExecutionEngine/MCJIT/cet-code-model-lager.ll is failing on 32-bit
windows, see llvm-commits thread for fef2dab.
This reverts commit
43f031d31264d20cfb8f1ebd606c66e57c231d4d
and the follow-ups
fef2dab100dfc7c49ccf0ce2bacea409324b54ba and
6a800f6f622a7ade275fa6cb1ef07803460d8bb3.
Djordje Todorovic [Sat, 4 Apr 2020 16:32:43 +0000 (18:32 +0200)]
[mlir][LowerToAffineLoops] Handle tensors of rank 0
This will fix the case:
$ toyc -emit=jit test.toy
$ cat test.toy
def main() {
var a = 1;
print(a);
}
Without this patch it would trigger an assertion.
Differential Revision: https://reviews.llvm.org/D77464
Hans Wennborg [Mon, 6 Apr 2020 12:18:35 +0000 (14:18 +0200)]
Add a triple to test/ExecutionEngine/MCJIT/cet-code-model-lager.ll
It was failing in 32-bit Windows builds with:
$ ":" "RUN: at line 1"
$ "c:\src\llvm_package_944db8a4\build32_stage0\bin\lli.exe" "-mtriple=i686-pc-windows-msvc-elf" "-code-model=large" "C:\src\llvm_package_944db8a4\llvm-project\llvm\test\ExecutionEngine\MCJIT\cet-code-model-lager.ll"
# command stderr:
Assertion failed: Is64Bit && "Large code model is only legal in 64-bit mode.", file C:\src\llvm_package_944db8a4\llvm-project\llvm\lib\Target\X86\X86ISelLowering.cpp, line 4212
Let's see if this helps.
Sourabh Singh Tomar [Fri, 3 Apr 2020 07:14:09 +0000 (12:44 +0530)]
[DWARF5] Added support for emission of debug_macro section.
Summary:
This patch adds support for emission of following DWARFv5 macro forms
in .debug_macro section.
1. DW_MACRO_start_file
2. DW_MACRO_end_file
3. DW_MACRO_define_strp
4. DW_MACRO_undef_strp.
Reviewed By: dblaikie, ikudrin
Differential Revision: https://reviews.llvm.org/D72828
Pavel Labath [Thu, 2 Apr 2020 12:48:12 +0000 (14:48 +0200)]
[llvm/Support] Don't crash on empty nullptr ranges when decoding LEBs
Summary:
If the decoding functions are called with both start and end pointers
being nullptr, the function will crash due to a nullptr dereference.
This happens because the function does not recognise nullptr as a valid
end pointer.
Obviously, nobody is going to pass null pointers here deliberately, but
it can happen indirectly (as it did for me), when calling these
functions on an ArrayRef, as a default-initialized empty ArrayRef will
have both begin() and end() pointers equal to nullptr.
The fix is to simply remove the nullptr check. Passing nullptr for "end"
with a valid "begin" pointer will still work, as one cannot reach
nullptr by incrementing a valid pointer without triggerring UB.
Reviewers: dblaikie
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77304
Pavel Labath [Tue, 24 Mar 2020 16:49:55 +0000 (17:49 +0100)]
[llvm/Support] Make more DataExtractor methods error-aware
Summary:
This patch adds the optional Error argument, and the Cursor variants to
more DataExtractor methods. The functions now behave the same way as
other error-aware functions (they set the error when they fail, and
don't do anything if the error is already set).
I have merged the LEB128 implementations via a template (similarly to
how fixed-size functions are handled) to reduce code duplication.
Depends on D77304.
Reviewers: dblaikie, aprantl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77306
Pavel Labath [Mon, 23 Mar 2020 15:15:49 +0000 (16:15 +0100)]
[Support] Make DataExtractor string functions error-aware
Summary:
This patch adds an optional Error argument to DataExtractor functions
for string extraction, and makes them behave like other DataExtractor
functions (set the error if extraction fails, don't do anything if the
error is already set).
I have merged the StringRef and C string versions of the functions to
reduce code duplication.
Reviewers: dblaikie, MaskRay
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77307
Guillaume Chatelet [Mon, 6 Apr 2020 10:08:22 +0000 (10:08 +0000)]
[Alignment][NFC] Add DebugStr and operator*
Summary:
This is a roll forward of D77394 minus AlignmentFromAssumptions (which needs to be addressed separately)
Differences from D77394:
- DebugStr() now prints the alignment value or `None` and no more `Align(x)` or `MaybeAlign(x)`
- This is to keep Warning message consistent (CodeGen/SystemZ/alloca-04.ll)
- Removed a few unneeded headers from Alignment (since it's included everywhere it's better to keep the dependencies to a minimum)
Reviewers: courbet
Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77537
Guillaume Chatelet [Fri, 3 Apr 2020 15:26:35 +0000 (15:26 +0000)]
[Alignment][NFC] Remove deprecated functions introduced in 10.0.0
Summary:
24 March 2020: LLVM 10.0.0 is out.
I gathered all deprecated function introduced between 9 and 10 and cleaned them up so they will be removed from 11.
> git log -p -S LLVM_ATTRIBUTE_DEPRECATED llvmorg-9.0.0..llvmorg-10.0.0
Reviewers: courbet
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77409
Simon Pilgrim [Mon, 6 Apr 2020 09:42:14 +0000 (10:42 +0100)]
[X86][SSE] combineVectorSignBitsTruncation - remove minimum vector length limitations
truncateVectorWithPACK has its own vector length controls, so we can rely on those directly. This helps some existing truncation to subvector tests, which were being combined later during shuffle lowering at which point the sign/zero bit detection had become obscured preventing lowerShuffleWithPACK working as well as it could.
Benjamin Kramer [Mon, 6 Apr 2020 11:23:27 +0000 (13:23 +0200)]
[LTO] Replace hand-rolled endian conversion with support::endian. NFCI.
Benjamin Kramer [Mon, 6 Apr 2020 11:22:53 +0000 (13:22 +0200)]
[RuntimeDyld] Replace hand-rolled endian conversion with support::endian. NFCI.
Benjamin Kramer [Mon, 6 Apr 2020 10:50:34 +0000 (12:50 +0200)]
[llvm-bcanalyzer] Simplify code. NFCI.
David Green [Mon, 6 Apr 2020 09:26:40 +0000 (10:26 +0100)]
[ARM] MVE vqmovn tests. NFC.
Kazushi (Jam) Marukawa [Mon, 6 Apr 2020 07:17:20 +0000 (09:17 +0200)]
[VE] Update lea/load/store instructions
Summary:
Modify lea/load/store instructions to accept `disp(index, base)`
style addressing mode (called ASX format). Also, uniform the
number of DAG nodes to have 3 operands for this ASX format
instructions, and update selectADDR functions to lower
appropriate MI.
Reviewers: arsenm, simoll, k-ishizaka
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D76822
Oliver Stannard [Mon, 6 Apr 2020 09:33:55 +0000 (10:33 +0100)]
Revert "[IPRA][ARM] Spill extra registers at -Oz"
Reverting because this is causing failures on bots with expensive checks
enabled.
This reverts commit
73cea83a6f5ab521edf3cccfc603534776d691ec.
Raphael Isemann [Mon, 6 Apr 2020 09:08:12 +0000 (11:08 +0200)]
[lldb] Add option to retry Fix-Its multiple times to failed expressions
Summary:
Usually when Clang emits an error Fix-It it does two things. It emits the diagnostic and then it fixes the
currently generated AST to reflect the applied Fix-It. While emitting the diagnostic is easy to implement,
fixing the currently generated AST is often tricky. That causes that some Fix-Its just keep the AST as-is or
abort the parsing process entirely. Once the parser stopped, any Fix-Its for the rest of the expression are
not detected and when the user manually applies the Fix-It, the next expression will just produce a new
Fix-It.
This is often occurring with quickly made Fix-Its that are just used to bridge temporary API changes
and that often are not worth implementing a proper API fixup in addition to the diagnostic. To still
give some kind of reasonable user-experience for users that have these Fix-Its and rely on them to
fix their expressions, this patch adds the ability to retry parsing with applied Fix-Its multiple time to
give the normal Fix-It experience where things Clang knows how to fix are not causing actual expression
error (at least when automatically applying Fix-Its is activated).
The way this is implemented is just by having another setting in the expression options that specify how
often we should try applying Fix-Its and then reparse the expression. The default setting is still 1 for everyone
so this should not affect the speed in which we fail to parse expressions.
Reviewers: jingham, JDevlieghere, friss, shafik
Reviewed By: shafik
Subscribers: shafik, abidh
Differential Revision: https://reviews.llvm.org/D77214
Kerry McLaughlin [Mon, 6 Apr 2020 08:35:05 +0000 (09:35 +0100)]
[AArch64][SVE] Add SVE intrinsics for saturating add & subtract
Summary:
Adds the following intrinsics:
- @llvm.aarch64.sve.[s|u]qadd.x
- @llvm.aarch64.sve.[s|u]qsub.x
Reviewers: sdesmalen, c-rhodes, dancgr, efriedma, cameron.mcinally, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77054
Florian Hahn [Mon, 6 Apr 2020 08:43:41 +0000 (09:43 +0100)]
[Matrix] Add option to use row-major matrix layout as default.
This patch adds a -matrix-default-layout option which can be used to
set the default matrix layout to row-major or column-major (default).
The initial patch updates codegen for loads, stores, binary operators
and matrix multiply.
Reviewers: anemet, Gerolf, andrew.w.kaylor, LuoYuanke
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D76325
Oliver Bruns [Mon, 6 Apr 2020 08:38:30 +0000 (10:38 +0200)]
[clang] fix undefined behaviour in RawComment::getFormattedText()
Summary:
Calling `back()` and `pop_back()` on the empty string is undefined
behavior [1,2].
The issue manifested itself as an uncaught `std::out_of_range` exception
when running `clangd` compiled on RHEL7 using devtoolset-9.
[1] https://en.cppreference.com/w/cpp/string/basic_string/back
[2] https://en.cppreference.com/w/cpp/string/basic_string/pop_back
Fixes:
1ff7c32fc91c607b690d4bb9cf42f406be8dde68
Reviewers: teemperor, ioeric, cfe-commits
Reviewed By: teemperor
Subscribers: ilya-biryukov, kadircet, usaxena95
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77468
Raphael Isemann [Mon, 6 Apr 2020 07:44:04 +0000 (09:44 +0200)]
[lldb] Also apply Fix-Its in "note:" diagnostics that belong to an error diagnostic
Summary:
LLDB currently applies Fix-Its if they are attached to a Clang diagnostic that has the
severity "error". Fix-Its connected to warnings and other severities are supposed to
be ignored as LLDB doesn't seem to trust Clang Fix-Its in these situations.
However, LLDB also ignores all Fix-Its coming from "note:" diagnostics. These diagnostics
are usually emitted alongside other diagnostics (both warnings and errors), either to keep
a single diagnostic message shorter or because the Fix-It is in a different source line. As they
are technically their own (non-error) diagnostics, we currently are ignoring all Fix-Its associated with them.
For example, this is a possible Clang diagnostic with a Fix-It that is currently ignored:
```
error: <user expression 1>:2:10: too many arguments provided to function-like macro invocation
ToStr(0, {,})
^
<user expression 1>:1:9: macro 'ToStr' defined here
#define ToStr(x) #x
^
<user expression 1>:2:1: cannot use initializer list at the beginning of a macro argument
ToStr(0, {,})
^ ~~~~
```
We also don't store "note:" diagnostics at all, as LLDB's abstraction around the whole diagnostic
concept doesn't have such a concept. The text of "note:" diagnostics is instead
appended to the last non-note diagnostic (which is causing that there is no "note:" text in the
diagnostic above, as all the "note:" diagnostics have been appended to the first "error: ..." text).
This patch fixes the ignored Fix-Its in note-diagnostics by appending them to the last non-note
diagnostic, similar to the way we handle the text in these diagnostics.
Reviewers: JDevlieghere, jingham
Reviewed By: JDevlieghere
Subscribers: abidh
Differential Revision: https://reviews.llvm.org/D77055
Pavel Labath [Mon, 6 Apr 2020 08:29:19 +0000 (10:29 +0200)]
[lldb] XFAIL TestThreadPlanCommands _only_ on aarch64
The test works fine on x86-linux.
Florian Hahn [Mon, 6 Apr 2020 08:24:03 +0000 (09:24 +0100)]
[Matrix] Add initial tiling for load/multiply/store chains.
This patch adds initial fusion for load/multiply/store chains of matrix
operations.
The patch contains roughly two parts:
1. Code generation for a fused load/multiply/store chain (LowerMatrixMultiplyFused).
First, we ensure that both loads of the multiply operands do not alias the store.
If they do, we create new non-aliasing copies of the operands. Note that this
may introduce new basic block. Finally we process TileSize x TileSize blocks.
That is: load tiles from the input operands, multiply and store them.
2. Identify fusion candidates & matrix instructions.
As a first step, collect all instructions with shape info and fusion candidates
(currently @llvm.matrix.multiply calls). Next, try to fuse candidates and
collect instructions eliminated by fusion. Finally iterate over all matrix
instructions, skip the ones eliminated by fusion and lower the rest as usual.
Reviewers: anemet, Gerolf, hfinkel, andrew.w.kaylor, LuoYuanke
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D75566
Alexander Belyaev [Mon, 6 Apr 2020 07:06:21 +0000 (09:06 +0200)]
[MLIR] Change return type of ParallelOp::getInductionVars to ValueRange.
The current return type sometimes leads to code like
to_vector<2>(ValueRange(loop.getInductionIvs())). It would be nice to
shorten it. Users who need access to Block::BlockArgListType (if there
are any), can always call getBody()->getArguments(); if needed.
Also remove getNumInductionVars(), since there is getNumLoops().
Differential Revision: https://reviews.llvm.org/D77526
Guillaume Chatelet [Mon, 6 Apr 2020 07:55:25 +0000 (07:55 +0000)]
Revert "[Alignment][NFC] Add DebugStr and operator*"
This reverts commit
1e34ab98fc6f5ea7e264c0cd19d96b87cbd9c8a5.
Raphael Isemann [Mon, 6 Apr 2020 07:02:49 +0000 (09:02 +0200)]
[lldb][NFC] Modernize lang/cpp/scope test
Igor Kudrin [Fri, 20 Mar 2020 16:10:05 +0000 (23:10 +0700)]
[llvm-dwp] Fix a possible out of bound access.
llvm-dwp did not check section identifiers read from input files.
In the case of an unexpected identifier, the calculated index for
Contributions[] pointed outside the array. This fix avoids the issue
by skipping unsupported identifiers.
Differential Revision: https://reviews.llvm.org/D76543
Kazuaki Ishizaki [Mon, 6 Apr 2020 07:18:55 +0000 (16:18 +0900)]
[libc] NFC: Fix trivial typo in comments, documents, and messages
Differential Revision: https://reviews.llvm.org/D77462
Guillaume Chatelet [Fri, 3 Apr 2020 13:55:17 +0000 (13:55 +0000)]
[Alignment][NFC] Add DebugStr and operator*
Summary:
Also updates files to use them.
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
Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77394
Igor Kudrin [Wed, 1 Apr 2020 14:54:12 +0000 (21:54 +0700)]
[DebugInfo] Fix reading range lists of v5 units in DWP.
In package files, the base offset provided by index sections should be
used to find the contribution of a unit. The patch adds that base
offset when reading range list tables.
Differential revision: https://reviews.llvm.org/D77401
Igor Kudrin [Fri, 20 Mar 2020 16:33:19 +0000 (23:33 +0700)]
[DebugInfo] Fix reading location tables headers of v5 units in DWP.
This fixes the reading of location lists headers for compilation units
in package files by adjusting the reading offset according to the
corresponding record in the unit index. This is required for
DW_FORM_loclistx to work.
Differential revision: https://reviews.llvm.org/D77146
Igor Kudrin [Fri, 20 Mar 2020 16:33:19 +0000 (23:33 +0700)]
[DebugInfo] Fix reading location tables of v5 units in DWP.
Without the patch, all version 5 compile units in a DWP file read
location tables from the beginning of a .debug_loclists.dwo section.
The patch fixes that by adjusting the reading offset the same way as
for pre-v5 units. The section identifier to find the contribution
entry corresponds to the version of the unit.
Differential revision: https://reviews.llvm.org/D77145
Igor Kudrin [Fri, 20 Mar 2020 16:26:56 +0000 (23:26 +0700)]
[DebugInfo] Support DWARFv5 index sections.
DWARFv5 defines index sections in package files in a slightly different
way than the pre-standard GNU proposal, see Section 7.3.5 in the DWARF
standard and https://gcc.gnu.org/wiki/DebugFissionDWP for GNU proposal.
The main concern here is values for section identifiers, which are
partially overlapped with changed meanings. The patch adds support for
v5 index sections and resolves that difficulty by defining a set of
identifiers for internal use which can represent and distinct values
of both standards.
Differential Revision: https://reviews.llvm.org/D75929
Igor Kudrin [Fri, 20 Mar 2020 10:28:59 +0000 (17:28 +0700)]
[DebugInfo] Rename section identifiers which are deprecated in DWARFv5. NFC.
This is a preparation for an upcoming patch which adds support for
DWARFv5 unit index sections. The patch adds tag "_EXT_" to identifiers
which reference sections that are deprecated in the DWARFv5 standard.
See D75929 for the discussion.
Differential Revision: https://reviews.llvm.org/D77141
Igor Kudrin [Wed, 11 Mar 2020 14:54:51 +0000 (21:54 +0700)]
[llvm-dwp] Refactor handling of section identifiers. NFCI.
There is a number of places in llvm-dwp.cpp where a section identifier
is translated into an index of an internal array of section
contributions, and another place where the index is converted to an
on-disk value. All these places use direct expressions like
"<id> - DW_SECT_INFO" or "<index> + DW_SECT_INFO", exploiting the fact
that DW_SECT_INFO is the minimum valid value of that kind.
The patch adds distinct functions for that translation. The goal is to
make the code more readable and to prepare it to support index sections
of new versions, where the numeric scheme of section indexes is changed.
Differential Revision: https://reviews.llvm.org/D76067
Richard Smith [Mon, 6 Apr 2020 06:10:08 +0000 (23:10 -0700)]
PR45239: Don't deallocate TemplateIdAnnotations if they might still be
in the token stream.
Previously we deleted all template-id annotations at the end of each
top-level declaration. That doesn't work: we can do some lookahead and
form a template-id annotation, and then roll back that lookahead, parse,
and decide that we're missing a semicolon at the end of a top-level
declaration, before we reach the annotation token. In that situation,
we'd end up parsing the annotation token after deleting its associated
data, leading to various forms of badness.
We now only delete template-id annotations if the preprocessor can
assure us that there are no annotation tokens left in the token stream
(or if we're already at EOF). This lets us delete the annotation tokens
earlier in a lot of cases; we now clean them up at the end of each
statement and class member, not just after each top-level declaration.
This also permitted some simplification of the delay-parsed templates
cleanup code.
Craig Topper [Mon, 6 Apr 2020 05:35:01 +0000 (22:35 -0700)]
[DAGCombiner] Use getAnyExtOrTrunc instead of getSExtOrTrunc in the zext(setcc) combine.
We're ANDing with 1 right after which will cause the SIGN_EXTEND to
be combined to ANY_EXTEND later. Might as well just start with an
ANY_EXTEND.
While there replace create the AND using the getZeroExtendInReg
helper to remove the need to explicitly create the VecOnes constant.
Johannes Doerfert [Mon, 30 Mar 2020 05:57:28 +0000 (00:57 -0500)]
[OpenMP][NFC] Move and simplify directive -> allowed clause mapping
Move the listing of allowed clauses per OpenMP directive to the new
macro file in `llvm/Frontend/OpenMP`. Also, use a single generic macro
that specifies the directive and one allowed clause explicitly instead
of a dedicated macro per directive.
We save 800 loc and boilerplate for all new directives/clauses with no
functional change. We also need to include the macro file only once and
not once per directive.
Depends on D77112.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D77113
Johannes Doerfert [Mon, 6 Apr 2020 04:09:36 +0000 (23:09 -0500)]
[OpenMP] Add extra qualification to OpenMP clause id
Forgot to adjust this use in
419a559c5a73f13578d891feb1299cada08d581e.
Craig Topper [Mon, 6 Apr 2020 02:26:15 +0000 (19:26 -0700)]
[DAGCombiner] Replace a hardcoded constant in visitZERO_EXTEND with a proper check for the condition its trying to protect.
This code is replacing a shift with a new shift on an extended type.
If the shift amount type can't represent the maximum shift amount
for the new type, the amount needs to be extended to a type that
can.
Previously, the code just hardcoded a check for 256 bits which
seems to have been an assumption that the original shift amount
was MVT::i8. But that seems more catered to a specific target
like X86 that uses i8 as its legal shift amount type. Other
targets may use different types.
This commit changes the code to look at the real type of the shift
amount and makes sure it has enough bits for the Log2 of the
new type. There are similar checks to this in SelectionDAGBuilder
and LegalizeIntegerTypes.
Nathan Ridge [Wed, 1 Apr 2020 05:29:58 +0000 (01:29 -0400)]
[clang] Persist Attr::IsPackExpansion into the PCH
Summary: Fixes https://github.com/clangd/clangd/issues/309
Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77194
Johannes Doerfert [Tue, 31 Mar 2020 00:58:40 +0000 (19:58 -0500)]
[OpenMP][NFCI] Move OpenMP clause information to `lib/Frontend/OpenMP`
This is a cleanup and normalization patch that also enables reuse with
Flang later on. A follow up will clean up and move the directive ->
clauses mapping.
Reviewed By: fghanim
Differential Revision: https://reviews.llvm.org/D77112
Tarindu Jayatilaka [Sun, 5 Apr 2020 16:45:19 +0000 (11:45 -0500)]
Expose `attributor-disable` to the new and old pass managers
The new and old pass managers (PassManagerBuilder.cpp and
PassBuilder.cpp) are exposed to an `extern` declaration of
`attributor-disable` option which will guard the addition of the
attributor passes to the pass pipelines.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D76871
Lang Hames [Sat, 4 Apr 2020 16:50:56 +0000 (09:50 -0700)]
[ORC] Add MachO universal binary support to StaticLibraryDefinitionGenerator.
Add a new overload of StaticLibraryDefinitionGenerator::Load that takes a triple
argument and supports loading archives from MachO universal binaries in addition
to regular archives.
The LLI tool is updated to use this overload.
Lei Zhang [Mon, 6 Apr 2020 00:00:56 +0000 (20:00 -0400)]
[mlir][spirv] NFC: remove uncessary return after llvm_unreachable
David Blaikie [Sun, 5 Apr 2020 19:49:02 +0000 (12:49 -0700)]
DebugInfo: Fix default template parameter computation for dependent non-type template parameters
This addresses the immediate bug, though in theory we could still
produce a default parameter for the DWARF in this test case - but other
cases will be definitely unachievable (you could have a default
parameter that cannot be evaluated - so long as the user overrode it
with another value rather than relying on that default)