LLVM GN Syncbot [Mon, 2 Nov 2020 18:32:12 +0000 (18:32 +0000)]
[gn build] Port
c17da8676a0
Duncan P. N. Exon Smith [Fri, 30 Oct 2020 15:13:37 +0000 (11:13 -0400)]
Support: Avoid std::tie in Support/FileSystem/UniqueID.h, NFC
Running `-fsyntax-only` on UniqueID.h is 2x faster with this patch
(which avoids calling `std::tie` for `operator<`). Since the transitive
includers of this file will go up as `FileEntryRef` gets used in more
places, avoid that compile-time hit. This is a follow-up to
23ed570af1cc165afea1b70a533a4a39d6656501 (suggested by Reid Kleckner).
Also drop the `<tuple>` include from FileSystem.h (which was vestigal
from before UniqueID.h was split out).
Differential Revision: https://reviews.llvm.org/D90471
Alex Richardson [Mon, 2 Nov 2020 17:35:59 +0000 (17:35 +0000)]
[clang-format] Improve BAS_DontAlign+AllowAllArgumentsOnNextLine=false
TokenAnnotator::splitPenalty() was always returning 0 for opening parens if
AlignAfterOpenBracket was set to BAS_DontAlign, so the preferred point for
line breaking was always after the open paren (and was ignoring
PenaltyBreakBeforeFirstCallParameter). This change restricts the zero
penalty to the AllowAllArgumentsOnNextLine case. This results in improved
formatting for FreeBSD where we set AllowAllArgumentsOnNextLine: false
and a high value for PenaltyBreakBeforeFirstCallParameter to avoid breaking
after the open paren.
Before:
```
functionCall(
paramA, paramB, paramC);
void functionDecl(
int A, int B, int C)
```
After:
```
functionCall(paramA, paramB,
paramC);
void functionDecl(int A, int B,
int C)
```
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D90246
Alex Richardson [Mon, 2 Nov 2020 17:33:07 +0000 (17:33 +0000)]
[AtomicExpand] Avoid creating an unnamed libcall
I recently modified this pass to better support CHERI-RISC-V and while
doing so I noticed that this pass was calling M->getOrInsertFunction()
with the result of TLI->getLibcallName(RTLibType). However, AMDGPU fills
the libcalls array with nullptr, so this creates an anonymous function
instead. This patch changes expandAtomicOpToLibcall to return false in
case the libcall does not exist and changes the assert() in the callees to
a report_fatal_error() instead.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D88800
Aaron Ballman [Mon, 2 Nov 2020 17:49:40 +0000 (12:49 -0500)]
Correct the nomerge attribute documentation
The nomerge attribute is a statement attribute not a function attribute.
David Green [Mon, 2 Nov 2020 17:46:48 +0000 (17:46 +0000)]
[ARM] Cost model test for target intrinsics. NFC
Ben Dunbobbin [Mon, 2 Nov 2020 17:32:55 +0000 (17:32 +0000)]
Revert "[Clang] Add the ability to map DLL storage class to visibility"
This reverts commit
415f7ee8836944942d8beb70e982e95a312866a7.
The added tests were failing on the build bots!
Craig Topper [Mon, 2 Nov 2020 17:31:01 +0000 (09:31 -0800)]
[RISCV] Make SelectRORIW handle the commutability of OR.
The SHL and SRL could be in opposite order so account for that.
Differential Revision: https://reviews.llvm.org/D90586
Simon Pilgrim [Mon, 2 Nov 2020 17:26:22 +0000 (17:26 +0000)]
[AggressiveInstCombine] Add funnel shift tests
Based off existing rotate test coverage
Simon Pilgrim [Mon, 2 Nov 2020 17:23:33 +0000 (17:23 +0000)]
[AggressiveInstCombine] Regenerate rotate tests
Louis Dionne [Thu, 29 Oct 2020 21:30:28 +0000 (17:30 -0400)]
[libc++] Migrate warning flags to the DSL
This makes us closer to running the test suite on platforms where the
legacy test suite configuration doesn't work.
One notable change after this commit is that the tests will be run with
warnings enabled on GCC too, which wasn't the case before. However,
previous commits should have tweaked the test suite to make sure it
passes with warnings enabled on GCC.
Note that warnings can still be disabled with `--param enable_warnings=False`,
as before.
Differential Revision: https://reviews.llvm.org/D90432
peter klausler [Fri, 30 Oct 2020 21:21:45 +0000 (14:21 -0700)]
[flang] Design document for runtime derived type descriptions (NFC)
Differential revision: https://reviews.llvm.org/D90500
Paul C. Anagnostopoulos [Mon, 2 Nov 2020 13:40:49 +0000 (08:40 -0500)]
[TableGen] Fix a couple of minor issues regarding the paste operator.
Update the documentation to fully describe it.
Differential Revision: https://reviews.llvm.org/D90617
Sanjay Patel [Mon, 2 Nov 2020 17:01:49 +0000 (12:01 -0500)]
[x86] add AVX2 cost model entries for maxnum of 256-bit vectors
As noticed in D90554 ,
the AVX2 costs for 256-bit vectors did not include FMAXNUM entries,
so we fell back to AVX1 which assumes those ops will be split into
128-bit halves or something close to that.
Differential Revision: https://reviews.llvm.org/D90613
Sanjay Patel [Sun, 1 Nov 2020 16:26:07 +0000 (11:26 -0500)]
[InstCombine] add multi-use tests for negator; NFC
PR47997
Craig Topper [Mon, 2 Nov 2020 16:45:33 +0000 (08:45 -0800)]
[RISCV] When matching RORIW, make sure the same input is given to both shifts.
The code is looking for (sext_inreg (or (shl X, C2), (shr (and Y, C3), C1))).
We need to ensure X and Y are the same.
Differential Revision: https://reviews.llvm.org/D90580
Simon Pilgrim [Mon, 2 Nov 2020 16:19:32 +0000 (16:19 +0000)]
[AggressiveInstCombine] foldGuardedRotateToFunnelShift - generalize rotation to funnel shift matcher.
Replace matchRotate with a more general matchFunnelShift - at the moment this is still just used for rotation patterns.
Ben Dunbobbin [Mon, 2 Nov 2020 15:11:56 +0000 (15:11 +0000)]
[Clang] Add the ability to map DLL storage class to visibility
For PlayStation we offer source code compatibility with
Microsoft's dllimport/export annotations; however, our file
format is based on ELF.
To support this we translate from DLL storage class to ELF
visibility at the end of codegen in Clang.
Other toolchains have used similar strategies (e.g. see the
documentation for this ARM toolchain:
https://developer.arm.com/documentation/dui0530/i/migrating-from-rvct-v3-1-to-rvct-v4-0/changes-to-symbol-visibility-between-rvct-v3-1-and-rvct-v4-0)
This patch adds the ability to perform this translation. Options
are provided to support customizing the mapping behaviour.
Differential Revision: https://reviews.llvm.org/D89970
Teresa Johnson [Mon, 2 Nov 2020 17:05:11 +0000 (09:05 -0800)]
[test] Fix unused FileCheck prefix in ThinLTO test
Add intended and missing prefix check.
Shoaib Meenai [Sat, 31 Oct 2020 00:43:41 +0000 (17:43 -0700)]
[clangd] Account for vendor in version string
The vendor will be prefixed to the "clangd" and can be an arbitrary
string, so account for it in the test.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D90517
Shoaib Meenai [Sat, 31 Oct 2020 00:42:09 +0000 (17:42 -0700)]
[clang] Limit scope of CLANG_VENDOR definition
It's only used by Version.cpp, so limit the definition to just that one
file instead of making all of Clang recompile if you change CLANG_VENDOR.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D90516
Teresa Johnson [Fri, 30 Oct 2020 15:03:35 +0000 (08:03 -0700)]
[MemProf] Reenable test with fix for bot failures
The issue was unexpected macro expansion when the bot's test output
directory contained a token matching a build system macro (e.g.
"linux"). Switch to using a hardcoded path, which is invalid but is
sufficient for ensuring that the path is passed down to the runtime.
Differential Revision: https://reviews.llvm.org/D90466
Louis Dionne [Mon, 2 Nov 2020 16:58:01 +0000 (11:58 -0500)]
[libc++][CI] Allow retries in case an agent is lost
We see this fairly often on our Linux bots, which appear to be killed
by GCE from time to time.
Pedro Tammela [Sun, 1 Nov 2020 18:02:30 +0000 (18:02 +0000)]
[LLDB/Lua] call lua_close() on Lua dtor
This patch calls `lua_close()` on Lua dtor.
This guarantees that the Lua GC finalizers are honored, aside from the
usual internal clean up.
It also guarantees a call to the `__close` metamethod of any active
to-be-closed variable in Lua 5.4.
Since the previous `luaL_openlibs()` was a noop, because the standard
library is cached internally, I've removed it.
Differential Revision: https://reviews.llvm.org/D90557
Mircea Trofin [Mon, 2 Nov 2020 16:50:34 +0000 (08:50 -0800)]
[FileCheck] Fix comments and eof in allow-unused-prefixes.txt
Momchil Velikov [Mon, 2 Nov 2020 16:26:10 +0000 (16:26 +0000)]
[ARM][MachineOutliner] Do not overestimate LR liveness in return block
The `LiveRegUnits` utility (as well as `LivePhysRegs`) considers
callee-saved registers to be alive at the point after the return
instruction in a block. In the ARM backend, the `LR` register is
classified as callee-saved, which is not really correct (from an ARM
eABI or just common sense point of view). These two conditions cause
the `MachineOutliner` to overestimate the liveness of `LR`, which
results in unnecessary saves/restores of `LR` around calls to outlined
sequences. It also causes the `MachineVerifer` to crash in some
cases, because the save instruction reads a dead `LR`, for example
when the following program:
int h(int, int);
int f(int a, int b, int c, int d) {
a = h(a + 1, b - 1);
b = b + c;
return 1 + (2 * a + b) * (c - d) / (a - b) * (c + d);
}
int g(int a, int b, int c, int d) {
a = h(a - 1, b + 1);
b = b + c;
return 2 + (2 * a + b) * (c - d) / (a - b) * (c + d);
}
is compiled with `-target arm-eabi -march=armv7-m -Oz`.
This patch computes the liveness of `LR` in return blocks only, while
taking into account the few ARM instructions, which read `LR`, but
nevertheless the register is not mentioned (explicitly or implicitly)
in the instruction operands.
Differential Revision: https://reviews.llvm.org/D89189
Fangrui Song [Mon, 2 Nov 2020 16:37:15 +0000 (08:37 -0800)]
[ELF] --emit-relocs: fix st_value of STT_SECTION in the presence of a gap before the first input section
In the presence of a gap, the st_value field of a STT_SECTION symbol is the
address of the first input section (incorrect if there is a gap). Set it to the
output section address instead.
In -r mode, this bug can cause an incorrect non-zero st_value of a STT_SECTION
symbol (while output sections have zero addresses, input sections may have
non-zero outSecOff). The non-zero st_value can cause the final link to have
incorrect relocation computation (both GNU ld and LLD add st_value of the
STT_SECTION symbol to the output section address).
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D90520
Louis Dionne [Mon, 2 Nov 2020 16:35:21 +0000 (11:35 -0500)]
[libc++] NFC: Re-generate the ABI lists with the new script
The new script keeps the results sorted, which is why the ABI lists appear
to have changed so much. However, this commit makes no actual ABI change.
Louis Dionne [Wed, 30 Sep 2020 20:30:04 +0000 (16:30 -0400)]
[libc++] Make it easier to re-generate the ABI lists
Instead of having to remember the command-line to use every time, this
commit adds a CMake target to generate the ABI list in the current
configuration, if it is supported.
As a fly-by change, remove scripts that are now unused (sym_match.py
and sym_extract.py).
Frederik Gossen [Mon, 2 Nov 2020 16:13:15 +0000 (16:13 +0000)]
Revert "[MLIR] Support walks over regions and blocks"
This reverts commit
dbae3d50f114a8ec0a7c3211e3b1b9fb6ef22dbd.
Cannot build with gcc/g++ 7.5.0.
Frederik Gossen [Mon, 2 Nov 2020 16:10:59 +0000 (16:10 +0000)]
Revert "[MLIR] Use `llvm::is_one_of` in walk templates"
This reverts commit
56299b1e58bf3720dff2fe60163739ee1554a371.
Cannot build with gcc/g++ 7.5.0.
Fangrui Song [Mon, 2 Nov 2020 16:16:43 +0000 (08:16 -0800)]
[Debugify] Port -debugify-each to NewPM
Preemptively switch 2 tests to the new PM
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D90365
Louis Dionne [Mon, 2 Nov 2020 16:07:10 +0000 (11:07 -0500)]
[libc++/libc++abi] Use Python3_EXECUTABLE consistently to run utilities
Nico Weber [Mon, 2 Nov 2020 15:49:54 +0000 (10:49 -0500)]
[gn build] Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`
Nico Weber [Mon, 2 Nov 2020 15:43:38 +0000 (10:43 -0500)]
[gn build] (manually) port
c6eaa14e11
Kirstóf Umann [Mon, 2 Nov 2020 15:37:59 +0000 (16:37 +0100)]
[analyzer][ReturnPtrRangeChecker] Fix a false positive on end() iterator
ReturnPtrRange checker emits a report if a function returns a pointer which
points out of the buffer. However, end() iterator of containers is always such
a pointer, so this always results a false positive report. This false positive
case is now eliminated.
This patch resolves these tickets:
https://bugs.llvm.org/show_bug.cgi?id=20929
https://bugs.llvm.org/show_bug.cgi?id=25226
https://bugs.llvm.org/show_bug.cgi?id=27701
Patch by Tibor Brunner!
Differential Revision: https://reviews.llvm.org/D83678
Florian Hahn [Mon, 2 Nov 2020 12:40:34 +0000 (12:40 +0000)]
Reland "[TTI] Add VecPred argument to getCmpSelInstrCost."
This reverts the revert commit
408c4408facc3a79ee4ff7e9983cc972f797e176.
This version of the patch includes a fix for a crash caused by
treating ICmp/FCmp constant expressions as instructions.
Original message:
On some targets, like AArch64, vector selects can be efficiently lowered
if the vector condition is a compare with a supported predicate.
This patch adds a new argument to getCmpSelInstrCost, to indicate the
predicate of the feeding select condition. Note that it is not
sufficient to use the context instruction when querying the cost of a
vector select starting from a scalar one, because the condition of the
vector select could be composed of compares with different predicates.
This change greatly improves modeling the costs of certain
compare/select patterns on AArch64.
I am also planning on putting up patches to make use of the new argument in
SLPVectorizer & LV.
Louis Dionne [Mon, 2 Nov 2020 15:30:29 +0000 (10:30 -0500)]
[libc++] Split off iostreams explicit instantiations into its own source file
This makes it cleaner to add more instantiations without cluttering the
actual implementation of ios.
Pavel Labath [Mon, 2 Nov 2020 15:11:47 +0000 (16:11 +0100)]
[lldb] Generalize an deflake gdb-remote *client* tests
This is similar in spirit to what D90313 did for server tests.
Nico Weber [Mon, 2 Nov 2020 15:29:13 +0000 (10:29 -0500)]
Revert "Add a new altera kernel name restriction check to clang-tidy."
This reverts commit
43a38a65233039b5e71797a644d41a890f8d7f2b,
and follow-up
5a7bc5e2595903e51f0b31e3faf82024e965c962.
The commit breaks check-clang-tools, the test added in the change
does not pass.
Matt Arsenault [Sat, 17 Oct 2020 18:28:52 +0000 (14:28 -0400)]
AMDGPU: Reorder checks
Louis Dionne [Fri, 30 Oct 2020 21:33:02 +0000 (17:33 -0400)]
[libc++abi] Get rid of warnings when running the tests with GCC
Aaron Ballman [Mon, 2 Nov 2020 15:18:47 +0000 (10:18 -0500)]
Fix link to a new check within the release notes.
Nico Weber [Mon, 2 Nov 2020 15:14:52 +0000 (10:14 -0500)]
[gn build] (manually) port
76a168bce01 better
Matt Arsenault [Tue, 20 Oct 2020 17:05:38 +0000 (13:05 -0400)]
RegisterCoalescer: Use Register
Frank Derry Wanye [Mon, 2 Nov 2020 15:11:38 +0000 (10:11 -0500)]
Add a new altera kernel name restriction check to clang-tidy.
The altera kernel name restriction check finds kernel files and include
directives whose filename is "kernel.cl", "Verilog.cl", or "VHDL.cl".
Such kernel file names cause the Altera Offline Compiler to generate
intermediate design files that have the same names as certain internal
files, which leads to a compilation error.
As per the "Guidelines for Naming the Kernel" section in the "Intel FPGA
SDK for OpenCL Pro Edition: Programming Guide."
Dávid Bolvanský [Mon, 2 Nov 2020 15:01:51 +0000 (16:01 +0100)]
[SLP] Added testcase for PR47623
Pavel Labath [Mon, 2 Nov 2020 10:35:13 +0000 (11:35 +0100)]
[lldb/test] Fix a fragile assumption in TestTypeGetModule
the binary can contain more than three compile units if the compiler
support files (crtbegin/end, etc.) come with their own debug info.
Evgeny Leviant [Mon, 2 Nov 2020 14:39:04 +0000 (17:39 +0300)]
[TableGen][SchedModels] Fix read/write variant substitution
Patch fixes case when sched class has write and read variants belonging
to different processor models.
Differential revision: https://reviews.llvm.org/D89777
Ben Dunbobbin [Mon, 2 Nov 2020 14:09:53 +0000 (14:09 +0000)]
[PS4] Support dllimport/export attributes
For PS4 development we support dllimport/export annotations in
source code. This patch enables the dllimport/export attributes
on PS4 by adding a new function to query the triple for whether
dllimport/export are used and using that function to decide
whether these attributes are supported. This replaces the current
method of checking if the target is Windows.
This means we can drop the use of "TargetArch" in the .td file
(which is an improvement as dllimport/export support isn't really
a function of the architecture).
I have included a simple codgen test to show that the attributes
are accepted and have an effect on codegen for PS4. I have also
enabled the DLLExportStaticLocal and DLLImportStaticLocal
attributes, which we support downstream. However, I am unable to
write a test for these attributes until other patches for PS4
dllimport/export handling land upstream. Whilst writing this
patch I noticed that, as these attributes are internal, they do
not need to be target specific (when these attributes are added
internally in Clang the target specific checks have already been
run); however, I think leaving them target specific is fine
because it isn't harmful and they "really are" target specific
even if that has no functional impact.
Differential Revision: https://reviews.llvm.org/D90442
Nico Weber [Mon, 2 Nov 2020 14:22:06 +0000 (09:22 -0500)]
[gn build] (manually) port
76a168bce01
Clement Courbet [Mon, 2 Nov 2020 14:10:41 +0000 (15:10 +0100)]
Revert "[llvm-exegesis] Save target state before running the benchmark."
_fxsave64 is not available on some buildbots.
This reverts commit
274de447fe9621082a523a7227157aeb84702a7d.
Caroline Concatto [Tue, 27 Oct 2020 12:26:47 +0000 (12:26 +0000)]
[Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`)
This patch implements the first frontend action for the Flang parser (i.e.
Fortran::parser). This action runs the preprocessor and is invoked with the
`-E` flag. (i.e. `flang-new -E <input-file>). The generated output is printed
to either stdout or the output file (specified with `-` or `-o <output-file>`).
Note that currently there is no mechanism to map options for the
frontend driver (i.e. Fortran::frontend::FrontendOptions) to options for
the parser (i.e. Fortran::parser::Options). Instead,
Frotran::parser::options are hard-coded to:
```
std::vector<std::string> searchDirectories{"."s};
searchDirectories = searchDirectories;
isFixedForm = false;
_encoding(Fortran::parser::Encoding::UTF_8);
```
These default settings are compatible with the current Flang driver. Further
work is required in order for CompilerInvocation to read and map
clang::driver::options to Fortran::parser::options.
Co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com>
Differential Revision: https://reviews.llvm.org/D88381
Clement Courbet [Mon, 2 Nov 2020 08:15:17 +0000 (09:15 +0100)]
[llvm-exegesis] Save target state before running the benchmark.
Some benchmarked instructions might set target state. Preserve this
state. See PR26418.
Differential Revision: https://reviews.llvm.org/D90592
Jay Foad [Mon, 2 Nov 2020 14:01:33 +0000 (14:01 +0000)]
Revert "Fix ds_read2/write2 unaligned offsets"
This reverts commit
2e7e898c8f0b38dc11fbce2553fc715067aaf42f.
It was committed by mistake.
Jay Foad [Mon, 2 Nov 2020 13:05:15 +0000 (13:05 +0000)]
Fix ds_read2/write2 unaligned offsets
Jay Foad [Mon, 2 Nov 2020 13:47:44 +0000 (13:47 +0000)]
[AMDGPU] Precommit ds_read2/write2 with unaligned offset tests. NFC.
Jay Foad [Mon, 2 Nov 2020 12:50:16 +0000 (12:50 +0000)]
[AMDGPU] Generate test checks. NFC.
Jay Foad [Mon, 2 Nov 2020 12:52:32 +0000 (12:52 +0000)]
[AMDGPU] Remove a comment. NFC.
This was obsoleted by
f78687df9b7 which added gfx9 aligned/unaligned
tests.
David Sanders [Mon, 2 Nov 2020 13:38:20 +0000 (08:38 -0500)]
Use --use-color in run-clang-tidy.py
Now that clang-tidy supports the --use-color command line option, it's
a better user experience to use --use-color in run-clang-tidy.py and
preserving the colored output.
Louis Dionne [Mon, 2 Nov 2020 13:25:16 +0000 (08:25 -0500)]
[libc++] NFC: Remove warning about non-void function returning void
Simon Pilgrim [Mon, 2 Nov 2020 11:57:37 +0000 (11:57 +0000)]
[LV][X86] Regenerate gather_scatter tests. NFCI.
Reduce diff in D90554
Simon Pilgrim [Mon, 2 Nov 2020 11:40:40 +0000 (11:40 +0000)]
[SLP][X86] Add AVX512VL test target coverage for PR47629
As suggested on D90445 - the AVX512F test case alone won't handle 128/256-bit vector gather pattern very well
Simon Pilgrim [Mon, 2 Nov 2020 11:30:39 +0000 (11:30 +0000)]
[RISCV] Avoid std::pair<> in FPReg StringSwitch to avoid MSVC compile failures. NFCI.
As discussed on D90322, some MSVC builds are failing with is_trivially_copyable static asserts (see D86126) - we can avoid this by not using the std::pair<unsigned,unsigned> which held both the FP+DP Registers, just handle the FP register and convert to DP on the fly.
Andrzej Warzynski [Wed, 28 Oct 2020 10:47:48 +0000 (10:47 +0000)]
[flang][driver] Rename the accessors/mutators (NFC)
As per point 3 in [1]:
```
Accessor member functions are named with the non-public data member's
name, less the trailing underscore. Mutator member functions are named
set_...
```
Originally we just followed the LLVM's style, which is incompatible with
Flang. This patch renames the accessors and mutators accordingly.
`getDiagnostics` and `GetDiagnostics` are replaced with one accessor:
`diagnostics`. `SetDiagnostics` was neither implemented nor used, so
it's deleted.
[1] https://github.com/llvm/llvm-project/blob/master/flang/docs/C++style.md#naming
Differential Revision: https://reviews.llvm.org/D90300
Kadir Cetinkaya [Thu, 29 Oct 2020 15:04:53 +0000 (16:04 +0100)]
[clangd] Value initialize SymbolIDs
We were default initializing SymbolIDs before, which would leave
indeterminate values in underlying std::array.
This patch updates the underlying data initalization to be value-init and adds a
way to check for validness of a SymbolID.
Differential Revision: https://reviews.llvm.org/D90397
Andrzej Warzynski [Mon, 2 Nov 2020 09:34:27 +0000 (09:34 +0000)]
[flang][driver] Use --match-full-lines in tests for `-test-io`
Use `--match-full-lines` to make sure that FileCheck doesn't match the
output against the `CHECK` lines (which, like other comments, are also
printed).
More specifically, we want to make sure that the following `check` in the
input file:
```
! CHECK: <some-fortran-input>
```
is matched by FileCheck with `<some-fortran-input>` in the generated
output. Without `--match-full-lines`, that check-line will be matched
with `!CHECK: <some-fortran-input>` instead (which is also
printed together with other contents of the file).
Adding `--match-full-lines` makes the tests stricter and this change
revealed that some `check`s were passing only because that flag was
missing. These are updated accordingly.
Reviewed By: CarolineConcatto, sameeranjoshi
Differential Revision: https://reviews.llvm.org/D90306
Kirill Bobyrev [Mon, 2 Nov 2020 09:55:17 +0000 (10:55 +0100)]
[clangd] Improve remote-index test
Introduce a separate thread that will kill `clangd-index-server` after 10 seconds regardless. This helps shut down the test if the server hangs and `stderr.readline()` does not contain inititalizatiton message. It prevents "necessary" waiting delay for the server warm-up and only introduces additional delay if the test fails.
It also makes use of `subprocess.Popen.kill()` which is a portable way of handling process shutdown and avoids using signals.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D90590
Clement Courbet [Fri, 30 Oct 2020 10:35:47 +0000 (11:35 +0100)]
[llvm-exegesis] Print signal name when the snippet crashed.
Differential Revision: https://reviews.llvm.org/D90453
Georgii Rymar [Fri, 30 Oct 2020 07:58:13 +0000 (10:58 +0300)]
[yaml2obj] - Add support of Offset for .strtab/.shstrtab/.dynstr sections.
These sections are implicit and handled a bit differently.
Currently the "Offset" is ignored for them.
This patch fixes an issue.
Differential revision: https://reviews.llvm.org/D90446
Caroline Concatto [Mon, 2 Nov 2020 08:15:50 +0000 (08:15 +0000)]
Revert "[AArch64][AsmParser] Remove 'x31' alias for 'sp/xzr' register."
This reverts commit
8b281bfaf35d00d42c2993fd5a80d749cc21f45e.
Caroline Concatto [Fri, 23 Oct 2020 09:37:08 +0000 (10:37 +0100)]
[AArch64][AsmParser] Remove 'x31' alias for 'sp/xzr' register.
Only the aliases 'xzr' and 'sp' exist for the physical register x31.
The reason for wanting to remove the alias 'x31' is because it allows users
to write invalid asm that is not accepted by the GNU assembler.
Is there any objection to removing this alias? Or do we want to keep
this for compatibility with existing code that uses w31/x31?
Differential Revision: https://reviews.llvm.org/D90153
Kirill Bobyrev [Mon, 2 Nov 2020 07:38:05 +0000 (08:38 +0100)]
[clangd] Add lit tests for remote index
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D90291
Ilya Golovenko [Mon, 2 Nov 2020 07:25:45 +0000 (08:25 +0100)]
[clangd] Fix ParsedASTTest.TopLevelDecls test.
Google test matcher `DeclKind` uses `NamedDecl::getDeclKindName()` to compare its result with expected declaration name.
Both, returned value of this function and the expected kind name argument have type `const char *`, so this matcher effectively
compares two pointers instead of the respective strings.
The test was passing on most platforms because compilers mostly were able to coalesce these string literals.
Patch By: Ilya Golovenko
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D90384
Wang, Pengfei [Mon, 2 Nov 2020 06:30:40 +0000 (14:30 +0800)]
[CodeGen][X86] Remove unused check-prefix in strict FP tests.
Craig Topper [Mon, 2 Nov 2020 06:12:20 +0000 (22:12 -0800)]
[RISCV] Add a test case for another issue in SelectRORIW. NFC
When validating C3 in (sext_inreg (or (shl X, C2), (shr (and Y, C3), C1)), i32)
we are truncating it to 32 bits before checking its value. We need
to check all 64 bits.
Qiu Chaofan [Mon, 2 Nov 2020 06:29:43 +0000 (14:29 +0800)]
[PowerPC] Fix a crash in POWER 9 setb peephole
Variable InnerIsSel references FalseRes, while FalseRes might be
zext/sext. So InnerIsSel should reference SetOrSelCC, otherwise a crash
will happen.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D90142
Jim Lin [Mon, 2 Nov 2020 02:58:07 +0000 (10:58 +0800)]
[compiler-rt][NFC] Fix typo in comment
Craig Topper [Mon, 2 Nov 2020 04:24:09 +0000 (20:24 -0800)]
[RISCV] Add a test case to show a bug in SelectRORIW. NFC
The function is matching (sext_inreg (or (shl X, C2), (shr (and Y, C3), C1))),
with appropriate checks for the constants to be a rotate. But it
fails to check that X and Y are the same which is also necessary.
Craig Topper [Sun, 1 Nov 2020 20:40:31 +0000 (12:40 -0800)]
[RISCV] Add more rev32 and rev16 test cases using fshl/fshr intrinsics. NFC
fshl/fshr intrinsics turn into rotl/rotr ISD opcodes and we don't
have a complete set of patterns.
We pattern match rotl, but we have a custom match for rori that gets
priority. We don't pattern match rotr and we don't have patterns
or custom code for rori from rotr.
Wang, Pengfei [Mon, 2 Nov 2020 03:38:46 +0000 (11:38 +0800)]
[CodeGen][X86] Remove unused check-prefix in adx tests.
Not needed after
226261353288e.
Stella Laurenzo [Mon, 2 Nov 2020 03:23:44 +0000 (19:23 -0800)]
NFC: Wrap lines in Python.md.
Teresa Johnson [Mon, 2 Nov 2020 03:06:50 +0000 (19:06 -0800)]
[MemProf] Fix test failure on windows
Fix failure in new test from
0949f96dc6521be80ebb8ebc1e1c506165c22aac:
Don't match exact file path separator.
Should fix:
http://lab.llvm.org:8011/#/builders/119/builds/437/steps/9/logs/FAIL__Clang__memory-profile-filename_c
Stella Laurenzo [Sun, 1 Nov 2020 06:40:25 +0000 (23:40 -0700)]
[mlir][Python] Context managers for Context, InsertionPoint, Location.
* Finishes support for Context, InsertionPoint and Location to be carried by the thread using context managers.
* Introduces type casters and utilities so that DefaultPyMlirContext and DefaultPyLocation in method signatures does the right thing (allows explicit or gets from the thread context).
* Extend the rules for the thread context stack to handle nesting, appropriately inheriting and clearing depending on whether the context is the same.
* Refactors all method signatures to follow the new convention on trailing parameters for defaulting parameters (loc, ip, context). When the objects are carried in the thread context, this allows most explicit uses of these values to be elided.
* Removes the style guide section on putting accessors to construct global objects on the PyMlirContext: this style fails to make good use of the new facility since it is often the only thing remaining needing an MlirContext.
* Moves Module parse/creation from mlir.ir.Context to static methods on mlir.ir.Module.
* Moves Context.create_operation to a static Operation.create method.
* Moves Type parsing from mlir.ir.Context to static methods on mlir.ir.Type.
* Moves Attribute parsing from mlir.ir.Context to static methods on mlir.ir.Attribute.
* Move Location factory methods from mlir.ir.Context to static methods on mlir.ir.Location.
* Refactors the std dialect fake "ODS" generated code to take advantage of the new scheme.
Differential Revision: https://reviews.llvm.org/D90547
Nico Weber [Mon, 2 Nov 2020 02:34:51 +0000 (21:34 -0500)]
[libcxx] Fix regression where `ninja all` doesn't copy libcxx headers
Before
6db314e86b2674, when running cmake with clang, libcxx, and
compiler-rt enabled, building `ninja all` would run the
generate-cxx-headers target, due to the sanitizers depending on it.
After
6db314e86b2674, if LIBCXX_ENABLE_SHARED and LIBCXX_ENABLE_STATIC
and LIBCXX_INCLUDE_TESTS and LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY are
disabled (https://reviews.llvm.org/D82702#2153627), `ninja all`
no longer copies the libcxx headers, which means clang can't compile
programs like `#include <string>` on macOS.
Explicitly add the copy target to the all target to restore the old
behavior.
Chen Zheng [Mon, 2 Nov 2020 01:55:05 +0000 (20:55 -0500)]
[MachineSink] sink more profitable loads
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D86864
QingShan Zhang [Mon, 2 Nov 2020 02:06:14 +0000 (02:06 +0000)]
[Scheduling] Fall back to the fast cluster algorithm if the DAG is too complex
We have added a new load/store cluster algorithm in D85517. However, AArch64 see
some compiling deg with the new algorithm as the IsReachable() is not cheap if
the DAG is complex. O(M+N) See https://bugs.llvm.org/show_bug.cgi?id=47966
So, this patch added a heuristic to switch to old cluster algorithm if the DAG is too complex.
Reviewed By: Owen Anderson
Differential Revision: https://reviews.llvm.org/D90144
Teresa Johnson [Tue, 29 Sep 2020 22:53:41 +0000 (15:53 -0700)]
[MemProf] Pass down memory profile name with optional path from clang
Similar to -fprofile-generate=, add -fmemory-profile= which takes a
directory path. This is passed down to LLVM via a new module flag
metadata. LLVM in turn provides this name to the runtime via the new
__memprof_profile_filename variable.
Additionally, always pass a default filename (in $cwd if a directory
name is not specified vi the = form of the option). This is also
consistent with the behavior of the PGO instrumentation. Since the
memory profiles will generally be fairly large, it doesn't make sense to
dump them to stderr. Also, importantly, the memory profiles will
eventually be dumped in a compact binary format, which is another reason
why it does not make sense to send these to stderr by default.
Change the existing memprof tests to specify log_path=stderr when that
was being relied on.
Depends on D89086.
Differential Revision: https://reviews.llvm.org/D89087
Nikita Popov [Sun, 1 Nov 2020 12:42:39 +0000 (13:42 +0100)]
[SCEV] Delay strengthening of nowrap flags
Strengthening nowrap flags is relatively expensive. Make sure we
only do it if we're actually going to use the flags -- we don't
use them for many recursive invocations. Additionally, if we're
reusing an existing SCEV node, there's no point in trying to
strengthen the flags if we don't have any new baseline facts.
This change falls slightly short of being NFC, because the way
flags during add+addrec / mul+addrec folding are handled may be
more precise (as less operands are included in the calculation).
Craig Topper [Sun, 1 Nov 2020 20:10:47 +0000 (12:10 -0800)]
[RISCV] Add tests to show missed opportunities to use rori for fshr intrinsic with same inputs. NFC
The fshr intrinsic with same inputs produces rotr ISD node. The
fshl intrinsic produces rotl ISD node.
There were only test cases and isel patterns for the fshl/rotl case.
This patch adds fshr/rotr test cases.
Craig Topper [Sun, 1 Nov 2020 18:31:59 +0000 (10:31 -0800)]
Recommit "[RISCV] Remove include of RISCVRegisterInfo.h from RISCVBaseInfo.h. NFCI"
This reverts
781917254dba17df7fb357a5f621ada2ac1b36e3 and recommits
781917254dba17df7fb357a5f621ada2ac1b36e3.
I've changed getRegForInlineAsmConstraint to not use a std::pair
of Register in a previous commit. Hopefully that fixes the reported
issue with expensive checks on Windows. I'm still not sure exactly
why this commit removing an include affected a different file.
Original message:
RISCVRegisterInfo.h is part of the CodeGen layer. The Utils library
is intended to be shared with the MC layer so shouldn't use files
from the CodeGen layer.
The register enum names are already available from
RISCVMCTargetDesc.h. It appears what was coming from this include
was a transitive include of the Register class which I've replaced
with MCRegister. Register has a constructor from MCRegister so it
should be convertible.
Craig Topper [Sun, 1 Nov 2020 18:16:50 +0000 (10:16 -0800)]
[RISCV] Use 'unsigned' instead of Register in getRegForInlineAsmConstraint. NFC
The return value of this interface still uses an 'unsigned' on all
targets. So we convert Register back to unsigned at the end.
I'm hoping this will prevent the issue that caused the revert of
D90322.
Nikita Popov [Sun, 1 Nov 2020 17:34:01 +0000 (18:34 +0100)]
[SCEV] Construct GEP expression more efficiently (NFCI)
Instead of performing a sequence of pairwise additions, directly
construct a multi-operand add expression.
This should be NFC modulo any SCEV canonicalization deficiencies.
Florian Hahn [Sat, 3 Oct 2020 20:05:39 +0000 (21:05 +0100)]
[VPlan] Assert no users remaining when deleting a VPValue.
When deleting a VPValue, all users must already by deleted. Add an
assertion to make sure and catch violations.
David Green [Sun, 1 Nov 2020 16:24:23 +0000 (16:24 +0000)]
[ARM] Add extra MVE tests for various patches. NFC
Qiu Chaofan [Sun, 1 Nov 2020 15:22:47 +0000 (23:22 +0800)]
[PowerPC] Avoid unnecessary fadd for unsigned to ppcf128
Unsigned 32-bit or shorter integer to ppcf128 conversion are currently
expanded as signed-to-double with an extra fadd to 'complement'. But on
PowerPC we have native instruction to directly convert unsigned to
double since ISA v2.06. This patch exploits it.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D89786
Nathan James [Sun, 1 Nov 2020 14:37:06 +0000 (14:37 +0000)]
[NFC][lldb] Silence unused variable warning
Ilya Bukonkin [Sun, 1 Nov 2020 10:53:06 +0000 (13:53 +0300)]
[lldb] TestTypeGetModule.py review improvements
Christudasan Devadasan [Sun, 1 Nov 2020 07:41:14 +0000 (13:11 +0530)]
[AMDGPU] Some refactoring after D90404. NFC.
Christudasan Devadasan [Thu, 29 Oct 2020 15:06:14 +0000 (20:36 +0530)]
[AMDGPU] Add alignment check for v3 to v4 load type promotion
It should be enabled only when the load alignment is at least 8-byte.
Fixes: SWDEV-256824
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D90404