Commit Graph

407855 Commits

Author SHA1 Message Date
Kazu Hirata 4e310d89f2 [clang] Strip redundant lambda (NFC) 2021-12-17 20:55:10 -08:00
Fangrui Song 552d84414d [ELF] Use SmallVector for many SyntheticSections. NFC
This decreases struct sizes and usually decreases the lld executable
size (39KiB for my x86-64 executable) (unless in some cases smaller
SmallVector leads to more inlining, e.g. StringTableBuilder).
For --gdb-index, there may be memory usage saving.
2021-12-17 19:22:16 -08:00
Joshua Huels 212e6c9977 [doc] Fix regex in ClangFormatStyleOptions for IncludeCategories
This fixes the regex in ClangFormatStyleOptions for IncludeCategories
to match anything starting with < or starting with | AND followed by
(gtest|gmock|isl|json) then /.

Differential Revision: https://reviews.llvm.org/D115910
2021-12-17 18:46:12 -08:00
Kazu Hirata fee57711fe Use DenseMap::lookup (NFC) 2021-12-17 18:19:25 -08:00
Jonas Devlieghere fa1260697e [lldb] Remove reproducer replay functionality
This is part of a bigger rework of the reproducer feature. See [1] for
more details.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
2021-12-17 17:14:52 -08:00
Kazu Hirata 713ee230f8 [clang] Use llvm::reverse (NFC) 2021-12-17 16:51:42 -08:00
Yuanfang Chen ac313c37e1 WinMsvc.cmake: try lower-case include/lib when searching for windows SDK
if the pascal case ones failed. Some tools, like msvc-wine/xwin, use the
lower case.
2021-12-17 16:30:36 -08:00
Julian Lettner 64f4041725 [TSan][Darwin] Fix shadow mapping for iOS simulator on Apple Silicon
With the introduction of Apple Silicon `defined(__aarch64__)` is not a
reliable way to check for the platform anymore.

We want to use the "normal" `Mapping48AddressSpace` mapping everywhere
except devices, including the iOS simulators on AS.

Relevant revisions:
https://reviews.llvm.org/D35147
https://reviews.llvm.org/D86377
https://reviews.llvm.org/D107743
https://reviews.llvm.org/D107888

Differential Revision: https://reviews.llvm.org/D115843
2021-12-17 15:59:43 -08:00
Julian Lettner 4399f3b6b0 [TSan][Darwin] Make malloc_size interceptor more robust
Previously we would crash in the TSan runtime if the user program passes
a pointer to `malloc_size()` that doesn't point into app memory.

In these cases, `malloc_size()` should return 0.

For ASan, we fixed a similar issue here:
https://reviews.llvm.org/D15008

Radar-Id: rdar://problem/86213149

Differential Revision: https://reviews.llvm.org/D115947
2021-12-17 15:38:08 -08:00
Vitaly Buka 96aa1e73b3
[runtimes] Remove LLVM_ENABLE_LLD
It was added D115852 and related patches and it brakes https://lab.llvm.org/buildbot/#/builders/fuchsia-x86_64-linux
2021-12-17 15:03:57 -08:00
Kazu Hirata 766d32f582 [Hexagon] Use is_contained (NFC) 2021-12-17 14:34:30 -08:00
Jon Chesterfield 38af5b4fd1 [libomptarget][nfc] Refactor dlwrap.h for easier reuse in D115966 and upcoming patches 2021-12-17 22:28:31 +00:00
Ellis Hoag 3429c7c328 [InstrProf][NFC] Require zlib for debug info tests
There was a build failure on the `instrprof-debug-info-correlate.c` test
because zlib was missing so we need to require it to run the test.

Differential Revision: https://reviews.llvm.org/D115970
2021-12-17 14:06:05 -08:00
Marek Kurdej 9cf4b7266b [clang-format] Refactor common handling of attributes. NFC.
Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D115968
2021-12-17 23:02:45 +01:00
Kazu Hirata 26bd534a79 [llvm] Use none_of instead of \!any_of (NFC) 2021-12-17 13:48:57 -08:00
Philip Reames a8a51fe556 [DSE] Remove calls with known writes to dead memory
The majority of this change is sinking logic from instcombine into MemoryLocation such that it can be generically reused. If we have a call with a single analyzable write to an argument, we can treat that as-if it were a store of unknown size.

Merging the code in this was unblocks DSE in the store to dead memory code paths. In theory, it should also enable classic DSE of such calls, but the code appears to not know how to use object sizes to refine unknown access bounds (yet).

In addition, this does make the isAllocRemovable path slightly stronger by reusing the libfunc and additional intrinsics bits which are already in getForDest.

Differential Revision: https://reviews.llvm.org/D115904
2021-12-17 13:42:36 -08:00
Vy Nguyen 4f90e67e2f [lld-macho] Handle $ld$hide[$os] symbols.
PR/52708

Differential Revision: https://reviews.llvm.org/D115775
2021-12-17 16:40:07 -05:00
Vitaly Buka 6969f8415d [runtimes] Fix type on flag name in D115852 2021-12-17 13:38:25 -08:00
Sanjay Patel 79932211f9 [SDAG] remove FP-to-int cast attribute check in fold to FTRUNC
We were using a function attribute to indicate a non-standard FP mode,
but now we can use intrinsics for that job as shown in the new tests.
Presumably the x86 asm could be improved for that IR with intrinsics,
but I have not worked out exactly how to do that. Note that the
transform to FTRUNC still requires a hacky check for "nsz" (because
FMF are not applied to FP casts).

This is a cleanup based on the clang change in D115804 / 8c7f2a4f87 .
This is effectively a revert of 5a90285bd9 + D46237 .

Differential Revision: https://reviews.llvm.org/D115885
2021-12-17 16:01:37 -05:00
Jacques Pienaar 2d4f3ed551 [mlir][vscode] Highlight inside c++ raw strings
Within C++ raw strings with mlir delimitter use MLIR syntax.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D115963
2021-12-17 12:56:08 -08:00
Alexey Bataev 71fe59212c [SLP][NFC]Adjust type in debug output loop.
The ReuseShuffleIndices indeces are integer, not unsigned, need to fix
the type in the debug print loop.
2021-12-17 12:43:01 -08:00
Philip Reames d9d6e6a048 [tests] Precommit tests from D115904 2021-12-17 12:42:51 -08:00
Nico Weber c4b45eeb44 [lld/mac] Don't lose "weak ref" bit when doing LTO
Fixes #52778.

Probably fixes Chromium crashing on startup on macOS 10.15 (and older) systems
when building with LTO, but I haven't verified that yet.

Differential Revision: https://reviews.llvm.org/D115949
2021-12-17 15:26:35 -05:00
Jonas Devlieghere 67bc243535 [lldb] Remove --reproducer-finalize and associated functionality
This is part of a bigger rework of the reproducer feature. See [1] for
more details.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
2021-12-17 12:19:55 -08:00
Greg Clayton 2a844c8869 Fix macOS buildbots after https://reviews.llvm.org/D115324.
The test was attempting to make a universal x86_64/arm64 binary, but some older bots don't have a macOS SDK that can handle this. Switching over to using a yaml file instead should solve the problem.
2021-12-17 12:14:44 -08:00
Alexey Bataev 46ad66b817 [SLP][NFC]Use 'llvm::copy' instead of element-by-elemen copying. 2021-12-17 12:07:59 -08:00
Nikita Popov eb2cad8329 [DSE] Make isRemovable() for calls more robust (NFCI)
We can only drop calls if they have an analyzable write, the return
value is not used, they don't throw and they don't diverge. The last
two conditions were previously not checked, because all the libcalls
with analyzable writes already happened to satisfy those conditions
anyway. This may not be true for generalizations (with D115904 in mind).

No test changes because the necessary attributes are already inferred
for currently supported libcalls.

Differential Revision: https://reviews.llvm.org/D115962
2021-12-17 20:52:34 +01:00
Nikita Popov 18ab892ff7 [Bitcode] Avoid setting invalid comdat pointer (NFC)
Instead track global objects with implicit comdat in a separate
set. The current approach of temporarily assigning an invalid
comdat pointer is incompatible with D115864.
2021-12-17 20:27:37 +01:00
LLVM GN Syncbot 7de813e14c [gn build] Port 65d7fd0239 2021-12-17 18:52:31 +00:00
Kazu Hirata 2b7be47b22 [llvm] Strip redundant lambda (NFC) 2021-12-17 10:51:40 -08:00
Jon Chesterfield 91dfb32f2f [openmp][amdgpu][nfc] Mark all external functions extern C to get type checking 2021-12-17 18:46:43 +00:00
Ellis Hoag 65d7fd0239 [Try2][InstrProf] Add Correlator class to read debug info
Extend `llvm-profdata` to read in a `.proflite` file and also a debug info file to generate a normal `.profdata` profile. This reduces the binary size by 8.4% when building an instrumented Clang binary without value profiling (164 MB vs 179 MB).

This work is part of the "lightweight instrumentation" RFC: https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

This was first landed in https://reviews.llvm.org/D114566 but had to be reverted due to build errors.

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D115915
2021-12-17 10:45:59 -08:00
Peter Stys 163c13fed9 [clang-format] Fix formatting of the code that follows C# Lambda Expressions
The alignment fix introduced by https://reviews.llvm.org/D104388 caused a regression whereby formatting of code that follows the lambda block is incorrect i.e. separate expressions are put on the same line.

Differential Revision: https://reviews.llvm.org/D115738
2021-12-17 10:42:15 -08:00
LLVM GN Syncbot 2fefb66e53 [gn build] Port cc324af0d6 2021-12-17 18:41:48 +00:00
Martin Storsjö cc324af0d6 Revert "Port __sanitizer::StopTheWorld to Windows"
This reverts commit 3f5f687e2e.

That commit broke building for mingw, where the sanitizers are
built with -nostdinc++, while the added source file includes
the C++ standard library's <algorithm>.

Additionally, the new code fails to build for i386, as it
unconditionally uses the CONTEXT member Rsp.
2021-12-17 20:41:14 +02:00
Tue Ly 9369aa1444 [libc][Obvious] Change func_ to <func>_ in add_math_function.md. 2021-12-17 13:32:51 -05:00
mydeveloperday 62ead36547 [clang-format] Formatter does not handle c++11 string literal prefix with stringize #
https://github.com/llvm/llvm-project/issues/27740

Ensure
```
```
behave the same as
```
```

when formatted, ensure clang-format follows the conventions for `L` `u` `U` `u8`

https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp?redirectedfrom=MSDN&view=msvc-170

Fixes #27740

Reviewed By: curdeius, owenpan

Differential Revision: https://reviews.llvm.org/D115938
2021-12-17 18:29:32 +00:00
Alexey Bataev 667485413f [OPENMP]Look through member function call base during implicit DSA analysis.
Need to look through the base of the member function calls at the DSA
analysis stage to correctly capture implicit class instances.

Differential Revision: https://reviews.llvm.org/D115902
2021-12-17 10:18:51 -08:00
Kazu Hirata f78c1b07cb [Target] Use range-based for loops (NFC) 2021-12-17 10:11:08 -08:00
Philip Reames 4c9e31a481 [funcattrs] Use early return to clarify code in determinePointerAccessAttrs [NFC]
Instead of having the speculative path be the untaken path in the branch, explicitly have it return.  This does require tail duplicating one call, but the resulting code is shorter and easier to understand.  Also rewrite the condition using appropriate accessors.
2021-12-17 10:00:36 -08:00
Deepak Eachempati d976fb0204 [OpenMP][NFC] update status for 5.1 'fail' atomic extension
Update status for the atomic 'fail' clause to "worked on".

Reviewed By: cchen

Differential Revision: https://reviews.llvm.org/D115901
2021-12-17 11:46:37 -06:00
Kazu Hirata 90bd4873d6 [CodeGen] Fix an unused variable warning
This patch fixes:

  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22617:11: error:
  unused variable 'Ops' [-Werror,-Wunused-variable]
2021-12-17 09:43:42 -08:00
Philip Reames 54ee8bb73a [funcattrs] Use getDataOperandNo where appropriate [NFC]
We'd manually duplicated the same logic and assertions; we can use the utility instead.
2021-12-17 09:35:29 -08:00
Simon Pilgrim 3b5572a18b Fix MSVC shadow variable warning. NFC. 2021-12-17 17:31:39 +00:00
Simon Pilgrim 35c7b1aeae [DAG] SimplifyVBinOp - remove FoldConstantArithmetic call.
Constant folding (scalar/vector) is now consistently handled before the SimplifyVBinOp calls.
2021-12-17 17:22:23 +00:00
Philip Reames 793c0da89e [capturetracking] Explicitly check for callee operand [NFC]
Pull out an explicit check rather than relying on the fact that the callee operand is not a data operand.  The only real value is it gives us a clear place to move the comment, and makes the code slightly more understandable.
2021-12-17 09:21:35 -08:00
Craig Topper be41996f4f [RISCV} Add FSGNJ_H to isAsCheapAsAMove and isCopyInstrImpl.
This matches FSGNJ_S and FSGNJ_D.
2021-12-17 09:14:20 -08:00
Simon Pilgrim f602723bfa [DAG] Constant fold + canonicalize fp binops before SimplifyVBinOp call
Replace custom constant scalar/splat folding with FoldConstantArithmetic call and canonicalize commutative constant ops to the RHS before the SimplifyVBinOp call
2021-12-17 17:02:54 +00:00
Louis Dionne 2722ac65f6 [libc++] Add a bunch of missing inline and _LIBCPP_HIDE_FROM_ABI in __threading_support
The inline keyword is required on those functions because they are defined
in the headers, so we need them to be inline to avoid ODR violations.
While we're at it, slap _LIBCPP_HIDE_FROM_ABI on them because they are
implementation details and we don't want them to be part of our ABI under
any circumstances.

Differential Revision: https://reviews.llvm.org/D115906
2021-12-17 12:02:32 -05:00
Philip Reames 33cbaab141 [funcattrs] Consistently treat calling a function pointer as a non-capturing read
We were being wildly inconsistent about what memory access was implied by an indirect function call. Depending on the call site attributes, you could get anything from a read, to unknown, to none at all. (The last was a miscompile.)

We were also always traversing the uses of a readonly indirect call. This is entirely unneeded as the indirect call does not capture. The callee might capture itself internally, but that has no implications for this caller. (See the nice explanation in the CaptureTracking comments if that case is confusing.)

Note that elsewhere in the same file, we were correctly computing the nocapture attribute for indirect calls. The changed case only resulted in conservatism when computing memory attributes if say the return value was written to.

Differential Revision: https://reviews.llvm.org/D115916
2021-12-17 09:02:03 -08:00