Commit Graph

411273 Commits

Author SHA1 Message Date
LLVM GN Syncbot b50c10fe59 [gn build] Port e6b153947d 2022-01-16 16:03:49 +00:00
Alexandre Ganea e6b153947d Revert [LLD] Remove global state in lldCommon
It seems to be causing issues on https://lab.llvm.org/buildbot/#/builders/123/builds/8383
2022-01-16 11:03:06 -05:00
Alexandre Ganea 30a4020a7d [LLD] Supplement with more comments. Clarify the intention in f860fe3622. 2022-01-16 09:17:39 -05:00
hyeongyu kim 4608b1d726 Resolve lit failures in clang-aarch64* 2022-01-16 23:06:05 +09:00
LLVM GN Syncbot 9a0e6b2abd [gn build] Port f860fe3622 2022-01-16 13:58:27 +00:00
Alexandre Ganea f860fe3622 [LLD] Remove global state in lldCommon
Move all variables at file-scope or function-static-scope into a hosting structure (lld::CommonLinkerContext) that lives at lldMain()-scope. Drivers will inherit from this structure and add their own global state, in the same way as for the existing COFFLinkerContext.

See discussion in https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html

Differential Revision: https://reviews.llvm.org/D108850
2022-01-16 08:57:57 -05:00
Florian Hahn 070d1034da
[LV] Restore metadata to disable runtime unrolling for epilogue loop.
After d4a8fc3a87 LV stopped adding metadata to disable runtime
unrolling to the vectorized epilogue loop. This was missed because
278aa65cc4 removed the relevant test coverage.

This patch fixes that by adding the relevant metadata after
vector loop generation.
2022-01-16 13:14:16 +00:00
hyeongyu kim be9eafc710 [msan] reflect the changed flag to the tests.
1b1c8d changed `enable-noundef-analysis` flag to
`disable-noundef-analysis`.  noundef_analysis.cpp was using old
`enable-noundef-analysis` flag and this patch fixes it.
2022-01-16 20:48:05 +09:00
owenca edbb8a843c [clang-format] Add return code to git-clang-format
https://github.com/llvm/llvm-project/issues/53220

Differential Revision: https://reviews.llvm.org/D117414
2022-01-16 02:41:10 -08:00
Florian Hahn 62739204d4
[LV] Move AddRuntimeUnrollDisableMetaData so it can be used earlier (NFC)
Move up the definition of AddRuntimeUnrollDisableMetaData, so it can be
re-used earlier in the file in a follow-up patch.
2022-01-16 10:30:24 +00:00
hyeongyu kim 1b1c8d83d3 [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default
Turning on `enable_noundef_analysis` flag allows better codegen by removing freeze instructions.
I modified clang by renaming `enable_noundef_analysis` flag to `disable-noundef-analysis` and turning it off by default.

Test updates are made as a separate patch: D108453

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D105169
2022-01-16 18:54:17 +09:00
Fangrui Song e7c8cd4a93 [ELF] Remove forEachRelSec. NFC 2022-01-16 00:28:47 -08:00
Fangrui Song 9e885eac54 [ELF] Remove !isLazy() condition from computeBinding
Seems applicable since we demote lazy symbols to Undefined (D111365).
2022-01-15 23:58:15 -08:00
Fangrui Song c0fc09ab91 [ELF] Remove config->relocatable condition from Symbol::computeBinding 2022-01-15 23:49:48 -08:00
Fangrui Song b3cc47006b [ELF] Speed up Symbol::computeBinding. NFC
When computeBinding is inlined into includeInDynsym and computeIsPreemptible,
the optimizer can remove the config->gnuUnique load.
2022-01-15 23:40:44 -08:00
Fangrui Song 01a51629c2 [ELF] Slightly speed up Symbol::includeInDynsym. NFC 2022-01-15 23:32:48 -08:00
Fangrui Song 7330fd236e [ELF] Simplify Symbol::includeInDynsym 2022-01-15 23:27:45 -08:00
Fangrui Song 3736d0854a [ELF] Optimize -z combreloc
Sorting dynamic relocations is a bottleneck. Simplifying the comparator improves
performance. Linking clang is 4~5% faster with --threads=8.

This change may shuffle R_MIPS_REL32 for Mips and is a NFC for non-Mips.
2022-01-15 22:33:51 -08:00
Luo, Yuanke 89e968fe8e [X86] Pre-checkin test case for combining const operand to VNNI
instruction.
2022-01-16 14:06:49 +08:00
John Ericson da77db58d7 Revert "[cmake] Use `GNUInstallDirs` to support custom installation dirs."
https://lab.llvm.org/buildbot/#/builders/46/builds/21146 Still have
this odd error, not sure how to reproduce, so I will just try breaking
up my patch.

This reverts commit 4a678f8072.
2022-01-16 05:48:30 +00:00
John Ericson 4a678f8072 [cmake] Use `GNUInstallDirs` to support custom installation dirs.
This is the original patch in my GNUInstallDirs series, now last to merge as the final piece!

It arose as a new draft of D28234. I initially did the unorthodox thing of pushing to that when I wasn't the original author, but since I ended up

 - Using `GNUInstallDirs`, rather than mimicking it, as the original author was hesitant to do but others requested.

 - Converting all the packages, not just LLVM, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I have used this patch series (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS), which was merged last spring (2021). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. Variables like `COMPILER_RT_INSTALL_PATH` have already been dealt with. Variables like `LLVM_LIBDIR_SUFFIX` however, will require further work, so that we may use `CMAKE_INSTALL_LIBDIR`.

These remaining items will be addressed in further patches. What is here is now rote and so we should get it out of the way before dealing more intricately with the remainder.

Reviewed By: #libunwind, #libc, #libc_abi, compnerd

Differential Revision: https://reviews.llvm.org/D99484
2022-01-16 05:33:07 +00:00
Lang Hames 1088c78c3b [ORC-RT] Remove some stale comments.
We switched to SPS serialization for these functions in 089acf2522.
2022-01-16 14:03:15 +11:00
Lang Hames 0ede1b906d [ORC-RT] Update WrapperFunctionCall for 089acf2522.
089acf2522 updated WrapperFunctionCall to carry arbitrary argument payloads
(rather than plain address ranges). This commit implements the corresponding
update for the ORC runtime.
2022-01-16 13:48:11 +11:00
Fangrui Song 102d0a2baf [ELF] Simplify elf::link exit. NFC 2022-01-15 17:59:05 -08:00
Fangrui Song 5456249736 [SelectionDAG] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D117235 2022-01-15 17:13:09 -08:00
Craig Topper 4c1e1e05cb [RISCV] Add RISCVISD::BFPW to ComputeNumSignBitsForTargetNode. 2022-01-15 15:23:49 -08:00
Dave Lee 696f9706f3 [lldb] Set result error state in 'frame variable'
Ensure that errors in `frame variable` are reflected in result object.

The statistics for `frame variable` show invocations as being successful, even
when executing one of the error paths.

This change replaces `result.GetErrorStream()` with `result.AppendError()`,
which also sets the status to `eReturnStatusFailed`.

Differential Revision: https://reviews.llvm.org/D116788

Recommitting after D116901 and D116863.

(cherry picked from commit 2c7d10c412)
2022-01-15 14:20:12 -08:00
Nikita Popov c63a3175c2 [AttrBuilder] Remove ctor accepting AttributeList and Index
Use the AttributeSet constructor instead. There's no good reason
why AttrBuilder itself should exact the AttributeSet from the
AttributeList. Moving this out of the AttrBuilder generally results
in cleaner code.
2022-01-15 22:39:31 +01:00
Lucas Prates c84b8be516 [AArch64] clang support for Armv8.8/9.3 MOPS
This introduces clang command line support for the new Armv8.8-A and
Armv9.3-A instructions for standardising memcpy, memset and memmove
operations, which was previously introduced into LLVM in
https://reviews.llvm.org/D116157.

Patch by Lucas Prates, Tomas Matheson and Son Tuan Vu.

Differential Revision: https://reviews.llvm.org/D117271
2022-01-15 19:52:30 +00:00
Jonas Devlieghere 0b010ef7b6 [lldb] Use PlatformMacOSX for Mac Catalyst
Use PlatformMacOSX for Mac Catalyst apps on both Intel (x86) and Apple
Silicon (arm64).
2022-01-15 11:42:29 -08:00
Mehdi Amini 772f7b87f8 Disable the MLIR ExecutionEngine library when the native target is not configured
The execution engine would not be functional anyway, we're already
disabling the tests, this also disable the rest of the code.

Anecdotally this reduces the number of static library built when the
builtin target is disabled goes from 236 to 218.

Here is the complete list of LLVM targets built when running
`ninja check-mlir`:

libLLVMAggressiveInstCombine.a
libLLVMAnalysis.a
libLLVMAsmParser.a
libLLVMBinaryFormat.a
libLLVMBitReader.a
libLLVMBitstreamReader.a
libLLVMBitWriter.a
libLLVMCore.a
libLLVMDebugInfoCodeView.a
libLLVMDebugInfoDWARF.a
libLLVMDemangle.a
libLLVMFileCheck.a
libLLVMFrontendOpenMP.a
libLLVMInstCombine.a
libLLVMIRReader.a
libLLVMMC.a
libLLVMMCParser.a
libLLVMObject.a
libLLVMProfileData.a
libLLVMRemarks.a
libLLVMScalarOpts.a
libLLVMSupport.a
libLLVMTableGen.a
libLLVMTableGenGlobalISel.a
libLLVMTextAPI.a
libLLVMTransformUtils.a

Differential Revision: https://reviews.llvm.org/D117287
2022-01-15 19:36:27 +00:00
Nikolas Klauser d3e49a41b1 [libc++] Add _LIBCPP_HIDE_FROM_ABI to in_in_result
Add `_LIBCPP_HIDE_FROM_ABI` to `in_in_result` conversion operators

Reviewed By: Quuxplusone, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D117399
2022-01-15 20:30:08 +01:00
Fangrui Song 8b2f33231c [ELF] Make some diagnostics follow the convention 2022-01-15 10:46:25 -08:00
paperchalice 62af3eb259 [CMake][LLDB] Resolve install conflict when `LLDB_BUILD_FRAMEWORK=ON`
Try to fix https://github.com/llvm/llvm-project/issues/108

Install python scripts into canonical resource path

Differential revision: https://reviews.llvm.org/D116853
2022-01-15 10:43:05 -08:00
Jonas Devlieghere a6469cdbc4 [lldb] Correctly display the number of types found
Correctly display the number of types found for `target modules lookup
--type` and add a test.

Fixes #53219
2022-01-15 10:31:49 -08:00
Dave Lee a7e7f541c0 [lldb] Remove anon struct from frame-var-anon-unions test
This test for anonymous unions seems off. It tests the following:

```
union {
  // fields
};

struct {
  // fields
} var{...};
```

Both are anonymous types, but the first does not declare a variable and the
second one does. The test then checks that `frame var` can directly access the
fields of the anonymous union, but can't directly access the fields of the
anonymous struct variable.

The second test, to directly access the members of the struct variable, seems
pointless as similar code would not compile. A demonstration:

```
struct {
  int a;
  int z;
} a_z{23, 45};

printf("%d\n", a_z.a); // fine
printf("%d\n", a); // this does not compile
```

Since we can't directly access the fields in code, I'm not sure there's a
reason to test that lldb also can't directly access them (other than perhaps as
a regression test).

Differential Revision: https://reviews.llvm.org/D116863
2022-01-15 10:20:52 -08:00
Jonas Devlieghere ff85dcb1c5 [lldb] Remove PlatformDarwin::GetCompatibleArch helper
This also removes the corresponding unit tests. I wrote them to sanity
check my original refactoring and checked them in because why not. The
current implementation, without the added complexity of indices, is
simple enough that we can do without it.
2022-01-15 09:51:16 -08:00
Peter Klausler 5c5bde1bb6 [flang] Fold SCALE()
Fold references to the intrinsic function SCALE().

(Also work around some MSVC headaches somehow exposed by
this patch: disable a bogus MSVC warning that began to appear
in unrelated source files, and avoid the otherwise-necessary
use of the "template" keyword in a call to a template member
function of a class template.)

Differential Revision: https://reviews.llvm.org/D117150
2022-01-15 09:31:00 -08:00
Arthur O'Dwyer cba72e4ce2 [libc++] Normalize some whitespace in preparation for D116570. NFC. 2022-01-15 12:20:33 -05:00
Nikita Popov 64590312d4 [AttrBuilder] Remove non-const td_attrs()
Mutations should happen through appropriate APIs that uphold the
sorting invariant. Exposing a mutable iterator is not necessary.
2022-01-15 18:13:06 +01:00
Alexandre Ganea 5d5d806e7b Silence warning with MSVC.
Fixes:

[2587/4073] Building CXX object projects\compiler-rt\lib\sanitizer_common\CMakeFiles\RTSanitizerCommon.x86_64.dir\sanitizer_stoptheworld_win.cpp.obj
D:\git\llvm-project\compiler-rt\lib\sanitizer_common\sanitizer_stoptheworld_win.cpp(125,33): warning: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Wsign-compare]
      if (SuspendThread(thread) == -1) {
          ~~~~~~~~~~~~~~~~~~~~~ ^  ~~
1 warning generated.
2022-01-15 12:06:38 -05:00
Alexandre Ganea 7fcc44bca4 [compiler-rt][cmake] Fix clang-cl warnings introduced in ae4c643bcd
See report in https://reviews.llvm.org/D116872#3245667
2022-01-15 12:06:38 -05:00
Nikita Popov d1675e4944 [AttrBuilder] Remove empty() / td_empty() methods
The empty() method is a footgun: It only checks whether there are
non-string attributes, which is not at all obvious from its name,
and of dubious usefulness. td_empty() is entirely unused.

Drop these methods in favor of hasAttributes(), which checks
whether there are any attributes, regardless of whether these are
string or enum attributes.
2022-01-15 17:57:18 +01:00
Florian Hahn e00158ed5c
[LoopUtils] Use InstSimplifyFolder in addRuntimeChecks.
Use the InstSimplifyFolder introduced earlier to perform initial
simplification during runtime check construction.
2022-01-15 15:21:16 +00:00
Simon Pilgrim c41ca1be7d [X86] LowerFunnelShift - enable vXi32 handling 2022-01-15 15:03:24 +00:00
Mark de Wever 3ba96cb2c9 [libc++] Adds tests for LWG-3373.
The code in libc++ already satisfy the requirements of LWG-3373. Since
the issue was written to specifically allow the types to be used in
structured bindings, tests have been added to validate the new
requirement.

Implements
LWG-3373 {to,from}_chars_result and format_to_n_result need the "we really mean what we say" wording

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D117337
2022-01-15 13:46:53 +01:00
Amir Ayupov de3e3fcfa3 [BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXE
Add CMake options to supply clang and lld binaries for use in check-bolt
instead of requiring the build of clang and lld projects.

Suggested by Mehdi Amini in https://lists.llvm.org/pipermail/llvm-dev/2021-December/154426.html

Test Plan:
```
cmake -G Ninja ~/local/llvm-project/llvm \
-DLLVM_TARGETS_TO_BUILD="X86"  \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS="bolt"  \
-DBOLT_CLANG_EXE=~/local/bin/clang \
-DBOLT_LLD_EXE=~/local/bin/lld

ninja check-bolt
...
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /home/aaupov/local/bin/clang
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld.lld: /home/aaupov/local/bin/ld.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld-link: /home/aaupov/local/bin/lld-link
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld64.lld: /home/aaupov/local/bin/ld64.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using wasm-ld: /home/aaupov/local/bin/wasm-ld
...
```

Tested all configurations:
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + no BOLT_*_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang" + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;lld" + BOLT_CLANG_EXE
- LLVM_ENABLE_PROJECTS="bolt" + BOLT_CLANG_EXE + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + BOLT_CLANG_EXE + BOLT_LLD_EXE

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D117061
2022-01-15 04:37:29 -08:00
Fraser Cormack 877d1b3d07 [SelectionDAG][VP] Add splitting/widening for VP_LOAD and VP_STORE
Original patch by @hussainjk.

This patch was split off from D109377 to keep vector legalization
(widening/splitting) separate from vector element legalization
(promoting).

While the original patch added a third overload of
SelectionDAG::getVPStore, this patch takes the liberty of collapsing
those all down to 1, as three overloads seems excessive for a
little-used node.

The original patch also used ModifyToType in places, but that method
still crashes on scalable vector types. Seeing as the other VP
legalization methods only work when all operands need identical
widening, this patch follows in that vein.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D117235
2022-01-15 11:41:29 +00:00
Florian Hahn ba3198cfd1
[IRBuilder] Migrate select-folding to value-based FoldSelect.
Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D117228
2022-01-15 11:26:44 +00:00
Fangrui Song be622a47ff [CMake] Fix compiler-rt -Wl,-z,gnu-version-script-compat warnings on non-Solaris 2022-01-15 01:35:48 -08:00