Commit Graph

383357 Commits

Author SHA1 Message Date
Martin Storsjö c027553d95 [cmake] Disable GCC 9's -Wpessimizing-move
Similar to the existing code for disabling GCC's -Wredudant-move,
also check for the -Wpessimizing-move option and disable it if
possible.

This silences another bunch of noisy warnings when building LLVM
with GCC 9.

As noted for -Wredundant-move, the code can't be fixed to silence the
warnings while retaining support for older compilers.

Differential Revision: https://reviews.llvm.org/D98942
2021-03-22 15:14:46 +02:00
Alexey Lapshin 972b6a3a34 [llvm-objcopy][Support] move writeToOutput helper function to Support.
writeToOutput function is useful when it is necessary to create different kinds
of streams(based on stream name) and when we need to use a temporary file
while writing(which would be renamed into the resulting file in a success case).
This patch moves the writeToStream helper into the Support library.

Differential Revision: https://reviews.llvm.org/D98426
2021-03-22 15:41:10 +03:00
Dmitri Gribenko 9cd7c41306 [analyzer] Don't include private gtest headers 2021-03-22 13:31:38 +01:00
Roman Lebedev 233db43967
[lit] Do not forget test times for tests that weren't executed
Even though we have read the times before,
we intentionally forget about it for performance reasons.
But that means we also forget all the times for the tests
that weren't executed this time. This is mildly inconvenient.

So, when recording the new times, first re-read the old times,
and update times for the tests that were executed,
thus preserving all original times, too.
2021-03-22 15:26:00 +03:00
Roman Lebedev 0088164477
[NFC][lit] Extract 'test time' reading/writing into standalone functions
Simply refactor code into reusable functions,
to allow read_test_times() to be reused later.
2021-03-22 15:25:32 +03:00
Roman Lebedev b32fe2b514
[NFC][lit] Add a test showing that timing data for tests not executed is lost
I.e. when you first run lit on a directory, and then on a single test,
the timing knowledge about anything else other than that single test
is lost. This isn't right.
2021-03-22 15:25:32 +03:00
Roman Lebedev ef4b3a4571
[NFCI][lit] Unbreak more lit self-tests after D98179
All of these depend on the order of tests, so if one runs them twice,
the tests within them will naturally be reordered
using the previous run times, which breaks them.
2021-03-22 15:25:32 +03:00
Roman Lebedev aae10a94ff
[NFC][lit] discovery: find_tests_for_inputs: avoid py warning when no suites found
If lit was run on a directory that contained no suites,
then naturally suite[0] will not be there,
and that line would cause python warnings.

So just predicate it with a check that it is there in the first place.
2021-03-22 15:25:32 +03:00
Florian Hahn 46b055287b
[ConstraintElimination] Add gep tests without inbounds.
Add a set of interesting test cases for GEPs without inbounds for
upcoming patches.
2021-03-22 12:23:30 +00:00
Muhammad Omair Javaid 89aab750b0 [LLDB] XFAIL dwarf5-debug_line-file-index.s on arm-linux
Tests dwarf5-debug_line-file-index.s fails on arm-linux-gnueabihf.
Bug # 49678 has been filed against it.
2021-03-22 17:06:53 +05:00
Bradley Smith 48f5a392cb [IR] Add vscale_range IR function attribute
This attribute represents the minimum and maximum values vscale can
take. For now this attribute is not hooked up to anything during
codegen, this will be added in the future when such codegen is
considered stable.

Additionally hook up the -msve-vector-bits=<x> clang option to emit this
attribute.

Differential Revision: https://reviews.llvm.org/D98030
2021-03-22 12:05:06 +00:00
Sven van Haastregt 2bbc9bccf0 [OpenCL] Support template parameters for as_type
Implement the TreeTransform for AsTypeExpr.  Split `BuildAsTypeExpr`
out of `ActOnAsTypeExpr`, such that we can call the Build method from
the TreeTransform.

Fixes PR47979.

Differential Revision: https://reviews.llvm.org/D98855
2021-03-22 11:59:05 +00:00
Kadir Cetinkaya f71404c37c
[clangd] Replace usages of dummy with more descriptive words
Dummy is a word with inappropriate associations. This patch updates the
references to it in clangd code base with more precise ones.

The only user-visible change is the default variable name used when extracting a
variable. It will be named as `placeholder` from now on.

Differential Revision: https://reviews.llvm.org/D99065
2021-03-22 12:49:24 +01:00
Andrzej Warzynski b3b002b12f [clang][flang] Moke the definition of `-module-dir` restricted to Flang
`-module-dir` is a Flang specific option and should not be visible in
Clang. This patch adds `FlangOnlyOption` flag to its definition. This
way Clang will know that it should reject it and skip it when generating
output for `clang -help`.

The definition of `-module-dir` is moved next to other Flang options.
As `-J` is an alias for `-module-dir`, it has to be moved as well (the
alias cannot be defined before the original option). As `gfortran` mode
is effectively no longer supported (*), `-J` is claimed as Flang only
option.

This is a follow-up of a post-commit review for
https://reviews.llvm.org/D95448.

* https://reviews.llvm.org/rG6a75496836ea14bcfd2f4b59d35a1cad4ac58cee

Differential Revision: https://reviews.llvm.org/D99018
2021-03-22 11:06:50 +00:00
Sjoerd Meijer 7515e81e8c [AArch64] Add some float -> int -> float conversion patterns
This adds some conversion match patterns for which we want to keep the int
values in FP registers using the corresponding NEON instructions (not the FP
instructions) to avoid more costly int <-> fp register transfers.

Differential Revision: https://reviews.llvm.org/D98956
2021-03-22 11:06:08 +00:00
Valeriy Savchenko 02b51e5316 [analyzer][solver] Redesign constraint ranges data structure
ImmutableSet doesn't seem like the perfect fit for the RangeSet
data structure.  It is good for saving memory in a persistent
setting, but not for the case when the population of the container
is tiny.  This commit replaces RangeSet implementation and
redesigns the most common operations to be more efficient.

Differential Revision: https://reviews.llvm.org/D86465
2021-03-22 13:52:35 +03:00
Stefan Gränitz 9cdbdbea29 [llvm-jitlink] Fix Windows build after 4a8161fe40 2021-03-22 11:42:05 +01:00
Florian Hahn cb3b5f0770
[ConstraintElimination] Add multi-dimension GEP tests.
Add a set of interesting test cases with multi-dimensional GEPs for
upcoming patches.
2021-03-22 10:37:12 +00:00
Stefan Gränitz f21cc55fb8 [llvm-jitlink] Add diagnostic output and port executor to getaddrinfo(3) as well
Add diagnostic output for TCP connections on both sides, llvm-jitlink and llvm-jitlink-executor.
Port the executor to use getaddrinfo(3) as well. This makes the code more symmetric and seems to be the recommended way for implementing the server side.

Reviewed By: rzurob

Differential Revision: https://reviews.llvm.org/D98581
2021-03-22 11:20:23 +01:00
Stefan Gränitz 4a8161fe40 [llvm-jitlink] Fix use of getaddrinfo(3) when connecting remote executor via TCP socket
Since llvm-jitlink moved from gethostbyname to getaddrinfo in D95477, it seems to no longer connect to llvm-jitlink-executor via TCP. I can reproduce this behavior on both, Debian 10 and macOS 10.15.7:

```
> llvm-jitlink-executor listen=localhost:10819
--
> llvm-jitlink --oop-executor-connect=localhost:10819 /path/to/obj.o
Failed to resolve localhost:10819
```

Reviewed By: rzurob

Differential Revision: https://reviews.llvm.org/D98579
2021-03-22 11:20:23 +01:00
Sven van Haastregt 20d93267e1 [OpenCL] Use -fdeclare-opencl-builtins for some tests
This speeds up the test running times, as the large `opencl-c.h`
header no longer needs to be parsed.
2021-03-22 09:46:28 +00:00
serge-sans-paille f51ab18716 Make clangd CompletionModel usable even with non-standard (but supported) layout
llvm supports specifying a non-standard layout where each project lies in its
own place. Do not assume a fixed layout and use the appropriate cmake variable
instead.

Differential Revision: https://reviews.llvm.org/D96787
2021-03-22 10:05:25 +01:00
serge-sans-paille b2f7ce91a6 [NFC] Simpler and faster key computation for getSubtargetImpl memoization
There's no use in computing a large key that's only used for a memoization
optimization.
2021-03-22 10:02:51 +01:00
Adrian Kuegel c691b9686b [mlir] Add an option to still use bottom-up traversal
GreedyPatternRewriteDriver was changed from bottom-up traversal to top-down traversal. Not all passes work yet with that change for traversal order. To give some time for fixing, add an option to allow to switch back to bottom-up traversal. Use this option in FusionOfTensorOpsPass which fails otherwise.

Differential Revision: https://reviews.llvm.org/D99059
2021-03-22 09:49:44 +01:00
Fangrui Song 82f6e0dde2 [Driver] -m32: Add /usr/include/i386-linux-gnu for Debian 2021-03-22 01:27:06 -07:00
Kristof Beyls ba0a28596e [docs] GettingInvolved: split out flang and openmp meeting series
Split out the flang and openmp meeting series, as each has a separate
canonical page where the information is maintained.
As part of that, also call out the alias analysis series separately as
it doesn't seem to be relevant for just flang.

Differential Revision: https://reviews.llvm.org/D99012
2021-03-22 09:25:57 +01:00
Yang Fan 0db28c0f3b
[ELF][docs] Add line breaks 2021-03-22 16:08:47 +08:00
Valeriy Savchenko 3085bda2b3 [analyzer][solver] Fix infeasible constraints (PR49642)
Additionally, this patch puts an assertion checking for feasible
constraints in every place where constraints are assigned to states.

Differential Revision: https://reviews.llvm.org/D98948
2021-03-22 11:02:02 +03:00
Kim-Anh Tran 68dafe40a6 [lldb] Use CompileUnit::ResolveSymbolContext in SymbolFileDWARF
SymbolFileDWARF::ResolveSymbolContext is currently unaware that in DWARF5 the primary file is specified at file index 0. As a result it misses to correctly resolve the symbol context for the primary file when DWARF5 debug data is used and the primary file is only specified at index 0.

This change makes use of CompileUnit::ResolveSymbolContext to resolve the symbol context. The ResolveSymbolContext in CompileUnit has been previously already updated to reflect changes in DWARF5
and contains a more readable version. It can resolve more, but will also do a bit more work than
SymbolFileDWARF::ResolveSymbolContext (getting the Module, and going through SymbolFileDWARF::ResolveSymbolContextForAddress), however, it's mostly directed by $resolve_scope
what will be resolved, and ensures that code is easier to maintain if there's only one path.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D98619
2021-03-22 08:44:16 +01:00
Fangrui Song f263418402 [Driver] Gnu.cpp: remove obsoleted i386 triple detection from end-of-life distribution versions
This saves 16 openat syscalls for `clang a.cc` on x86_64.
2021-03-22 00:23:55 -07:00
Nathan Ridge 2e58226d8d [clangd] Fix linker error when linking clang-index-server with shared libraries
Fixes https://github.com/clangd/clangd/issues/723

Differential Revision: https://reviews.llvm.org/D99049
2021-03-22 02:38:58 -04:00
Qiu Chaofan 52f33f7953 [PowerPC] Enable redundant TOC save removal on AIX
Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D97039
2021-03-22 14:29:22 +08:00
Fangrui Song 874bdc8e61 [Driver] Clean up Debian multiarch /usr/include/<triplet> madness
Debian multiarch additionally adds /usr/include/<triplet> and somehow
Android borrowed the idea. (Note /usr/<triplet>/include is already an
include dir...). On Debian, we should just assume a GCC installation is
available and use its triple.
2021-03-21 22:40:38 -07:00
Stella Laurenzo bdf4e93b2c Fix extraneous context parameter in templated helper function.
(missed in lattner's overall updates related to D99028)
2021-03-22 05:08:44 +00:00
Bing1 Yu 113f077f80 [X86] Pass to transform tdpbf16ps intrinsics to scalar operation.
In previous patch https://reviews.llvm.org/D93594, we only scalarize tilezero, tileload, tilestore and tiledpbssd. In this patch we scalarize tdpbf16ps intrinsic.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D96110
2021-03-22 13:00:40 +08:00
Max Kazantsev 8fab9f824f [IndVars] Sharpen context in eliminateIVComparison
When eliminating comparisons, we can use common dominator of
all its users as context. This gives better results when ICMP is not
computed right before the branch that uses it.

Differential Revision: https://reviews.llvm.org/D98924
Reviewed By: lebedev.ri
2021-03-22 11:55:57 +07:00
Lang Hames fc36a511c6 [JITLink][ELF/x86-64] Add support for R_X86_64_GOTPC64 and R_X86_64_GOT64.
Start adding support for ELF x86-64 large code model, PIC relocations.
2021-03-21 21:52:54 -07:00
Siva Chandra b22f448c21 [libc] Add a target "install-llvmlibc" to install LLVM libc static archive. 2021-03-22 04:45:14 +00:00
Lang Hames 0a74ec3299 [JITLink] Start laying the groundwork for ELF x86-64 large code model support.
Introduces DefineExternalSectionStartAndEndSymbols.h, which defines a template
for a JITLink pass that transforms external symbols meeting a user-supplied
predicate into defined symbols pointing at the start and end of a Section
identified by the predicate. JITLink.h is updated with a new makeAbsolute
function to support this pass.

Also renames BasicGOTAndStubsBuilder to PerGraphGOTAndPLTStubsBuilder -- the new
name better describes the intent of this GOT and PLT stubs builder, and will
help to distinguish it from future GOT and PLT stub builders that build entries
that may be shared between multiple graphs.
2021-03-21 20:56:47 -07:00
Lang Hames 209ceed745 [JITLink][ELF/x86-64] Add Delta32, NegDelta32, NegDelta64 support.
These were missing, but are used in eh-frame section support.
2021-03-21 20:15:40 -07:00
Chuanqi Xu 55486161fa [ASTMatcher] Add AST Matcher support for C++20 coroutine keywords
Summary: Try to enable the support for C++20 coroutine keywords for AST
Matchers.

Reviewers: sammccall, njames93, aaron.ballman

Differential Revision: https://reviews.llvm.org/D96316
2021-03-22 10:27:46 +08:00
Luo, Yuanke 661c016f68 [X86][AMX] Add test cases for AMX load/store lowering.
Differential Revision: https://reviews.llvm.org/D99030
2021-03-22 09:14:52 +08:00
Fangrui Song 74933efeb6 [Driver] Detect Debian hack g++-multiarch-incdir.diff to simplify addLibStdCXXIncludePaths call sites 2021-03-21 17:33:31 -07:00
Fangrui Song 6a4fbf14ef [test] Add test for cross compiling on Linux 2021-03-21 15:37:35 -07:00
Fangrui Song 72ac988dc7 [test] Delete obsoleted debian_multiarch_tree and ubuntu_13.04_multiarch_tree
They are quite outdated. Delete them to avoid unnecessary test churn.
2021-03-21 15:37:34 -07:00
Jacques Pienaar 113baa2b9f Update examples post OwningRewritePatternList change 2021-03-21 15:15:54 -07:00
Nico Weber 2554b95db5 Revert "[lld-macho] Implement -dependency_info (partially - more opcodes needed)"
This reverts commit c53a1322f3.
Test only passes depending on build dir having a lexicographically later name
than the source dir, and doesn't link on mac/win. See
https://reviews.llvm.org/D98559#2640265 onward.
2021-03-21 16:35:38 -04:00
Roman Lebedev be87321280
[clang][Codegen] EmitBranchOnBoolExpr(): emit prof branch counts even at -O0
This restores the original behaviour before i unadvertedly broke it in
e3a4701627 and clang/test/Profile/ caught it.
2021-03-21 23:24:27 +03:00
Roman Lebedev e3a4701627
[clang][CodeGen] Lower Likelihood attributes to @llvm.expect intrin instead of branch weights
08196e0b2e exposed LowerExpectIntrinsic's
internal implementation detail in the form of
LikelyBranchWeight/UnlikelyBranchWeight options to the outside.

While this isn't incorrect from the results viewpoint,
this is suboptimal from the layering viewpoint,
and causes confusion - should transforms also use those weights,
or should they use something else, D98898?

So go back to status quo by making LikelyBranchWeight/UnlikelyBranchWeight
internal again, and fixing all the code that used it directly,
which currently is only clang codegen, thankfully,
to emit proper @llvm.expect intrinsics instead.
2021-03-21 22:50:21 +03:00
Roman Lebedev 37d6be9052
Revert "[BranchProbability] move options for 'likely' and 'unlikely'"
Upon reviewing D98898 i've come to realization that these are
implementation detail of LowerExpectIntrinsicPass,
and they should not be exposed to outside of it.

This reverts commit ee8b53815d.
2021-03-21 22:50:21 +03:00