Commit Graph

466789 Commits

Author SHA1 Message Date
Alexander Yermolovich
66e943b1a9 [BOLT][DWARF] Fix for .debug_line with DWARF5
There was a bug in a code that pre-populated line string for a case where parts
of .debug_line are not processed by BOLT, but copied as raw data. We were not
switching sections. This resulted in parts of the binary being over-written with
debug data.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D154544
2023-07-06 11:37:08 -07:00
LLVM GN Syncbot
ade8db573e [gn build] Port c9b1f06288 2023-07-06 18:30:23 +00:00
LLVM GN Syncbot
d8f14365f0 [gn build] Port 98e2d63027 2023-07-06 18:30:22 +00:00
LLVM GN Syncbot
df40f96a24 [gn build] Port 43dce27c06 2023-07-06 18:30:21 +00:00
LLVM GN Syncbot
de8ad9fcb7 [gn build] Port 38639a8159 2023-07-06 18:30:20 +00:00
Maksim Panchenko
38639a8159 [BOLT][NFCI] Migrate Linux Kernel handling code to MetadataRewriter
Create LinuxKernelRewriter and move kernel-specific code to this class.

Depends on D154023

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D154024
2023-07-06 11:25:50 -07:00
Maksim Panchenko
43dce27c06 [BOLT][NFCI] Migrate pseudo probes to MetadataRewriter interface
Use new MetdataRewriter interface to update pseudo probes and move
ProbeDecoder out of BinaryContext into new PseudoProbeRewriter class.

Depends on D154021

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D154022
Differential Revision: https://reviews.llvm.org/D154023
2023-07-06 11:19:30 -07:00
Maksim Panchenko
98e2d63027 [BOLT][NFCI] Use MetadataRewriter interface to update SDT markers
Migrate SDT markers processing to the new MetadataRewriter interface.

Depends on D154020

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D154021
2023-07-06 11:17:17 -07:00
Maksim Panchenko
c9b1f06288 [BOLT] Introduce MetadataRewriter interface
Introduce the MetadataRewriter interface to handle updates for various
types of auxiliary data stored in a binary file.

To implement metadata processing using this new interface, all metadata
rewriters should derive from the RewriterBase class and implement
one or more of the following methods, depending on the timing of metadata
read and write operations:

  * preCFGInitializer()
  * postCFGInitializer() // TBD
  * preEmitFinalizer()   // TBD
  * postEmitFinalizer()

By adopting this approach, we aim to simplify the RewriteInstance class
and improve its scalability to accommodate new extensions of file formats,
including various metadata types of the Linux Kernel.

Differential Revision: https://reviews.llvm.org/D154020
2023-07-06 11:09:51 -07:00
Arthur Eubanks
c1e2838517 [gn build] Manually port 015dabd7 2023-07-06 11:08:16 -07:00
Liam Fitzpatrick
9739ef67a8 [MLIR][Tosa] Turn reshape(const()) from canonicalization into fold; fix dynamic shape case
1) Turns the canonicalization into a fold, so it can cleanup IR within other passes.

2) When the output of the reshape is a dynamic shaped tensor,
we cannot apply the fold to the constant, because constants are required to have
static shape.

Differential Revision: https://reviews.llvm.org/D154615
2023-07-06 20:07:24 +02:00
Thurston Dang
1da10d25d9 [msan] Fix -Wcast-qual error in msan_dl.cpp
Attempt 2 at fixing a buildbot error https://lab.llvm.org/buildbot#builders/57/builds/28143
that I had introduced in D154272
2023-07-06 18:04:22 +00:00
Paul Robinson
c2bed2a170 [UTC] Add do-not-autogenerate capability
Differential Revision: https://reviews.llvm.org/D154383
2023-07-06 10:56:42 -07:00
Chia-hung Duan
bce8c9e3d7 [scudo] Try to release pages after unlocking the TSDs
This increases the parallelism and the usage of TSDs

Reviewed By: cferris

Differential Revision: https://reviews.llvm.org/D152988
2023-07-06 17:40:26 +00:00
Chia-hung Duan
531f90acc5 [scudo] Verify the size of free blocks in primary allocator
When all the blocks (local caches are included) are freed, the size of
free blocks should be equal to `AllocatedUser`.

Reviewed By: cferris

Differential Revision: https://reviews.llvm.org/D152769
2023-07-06 17:40:25 +00:00
Jonathan Peyton
05e2bc25e8 [OpenMP] Ensure socket layer is not first in CPUID topology detection
* Return 0 length topology if socket layer is detected first
* Fix DEBUG ASSERT
2023-07-06 12:35:34 -05:00
Fangrui Song
b7d36a1a1e [ELF] Use compression::getReasonIfUnsupported for zlib/zstd unavailable error
The error message now matches llvm-objcopy --compress-debug-sections=[zlib|zstd].
2023-07-06 10:31:45 -07:00
Tom Stellard
4b36b2c23c [Support] Use C++11 attribute syntax for visibility attributes
The gnu extension __attribute syntax cannot be mixed with the
C++11 alignas specifier, so in order to use visibility attributes on
classes that also use alignas, we need to use the C++11 standard syntax.

Also fix a few warnings introduced by this change.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D152043
2023-07-06 10:30:56 -07:00
Nicole Rabjohn
92e4d6791f Fixing conflicting macro definitions between curses.h and the standard library.
POSIX allows certain macros to exist with generic names (i.e. refresh(), move(), and erase()) to exist in `curses.h` which conflict with functions found in std::filesystem, among others. This patch undefs the macros in question and adds them to LIBCPP_PUSH_MACROS and LIBCPP_POP_MACROS.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D147356
2023-07-06 17:21:08 +00:00
varconst
e61764c32f [libc++][hardening][NFC] Rename the has-debug-mode feature to has-legacy-debug-mode.
This will allow reusing the `has-debug-mode` feature for the new debug
mode without accidentally reenabling old debug mode tests. The
`has-legacy-debug-mode` feature is deliberately never set -- the old
tests are left checked in to have a point of reference for the level of
checking that was supported by the legacy debug mode, making it easier
to verify we've reached feature parity in the future.
2023-07-06 10:19:27 -07:00
Amir Ayupov
c2aa0616cd [YAML][NFC] Replace if-else with switch in createHNodes
BOLT YAML profile reading time gets marginally faster (14.1572->13.9207 s) for
a large YAML profile (121MB/31K functions). Not claiming stat significance
though.

Reviewed By: hintonda

Differential Revision: https://reviews.llvm.org/D154553
2023-07-06 10:18:13 -07:00
Matt Arsenault
61820f8b5d CodeGen: Optimize lowering of is.fpclass fcZero|fcSubnormal
Combine the two checks into a check if the exponent bits are 0. The
inverted case isn't reachable until a future change, and GlobalISel
currently doesn't attempt the inversion optimization.

https://reviews.llvm.org/D143182
2023-07-06 13:03:57 -04:00
Leonard Grey
5e763d35e4 [gn] Add check-lsan target for Mac
Only supports ASAN mode right now. Standalone requires a some more plumbing so it will be a follow-up.

Mac-only but I suspect this will be fine on Linux also since it's based on the check-asan file, will follow up after testing.

Differential Revision: https://reviews.llvm.org/D153651
2023-07-06 13:03:16 -04:00
Matt Arsenault
1588e18b2d DAG: Check isCondCodeLegal in is_fpclass expansion to fcmp eq 0
Results in some x86 codegen diffs. Some look better, some look worse.

https://reviews.llvm.org/D152094
2023-07-06 13:00:52 -04:00
Aart Bik
03125e6894 [mlir][sparse][gpu] fix missing dealloc
This dealloc was incorrectly removed in
https://reviews.llvm.org/D153173

Reviewed By: K-Wu

Differential Revision: https://reviews.llvm.org/D154564
2023-07-06 09:48:19 -07:00
Jonathan Peyton
2d02988f74 [OpenMP] Remove gcc-12 warnings from libomp 2023-07-06 11:47:45 -05:00
Joseph Huber
b420e0ed27 [Libomptarget] Disable the 'mapping/prelock.cpp' test on AMDGPU
Summary:
This test was not functional on the new plugins, now that the old ones
have been deleted it doesn't work. Disable until we get a fix.
2023-07-06 11:45:18 -05:00
Thurston Dang
015dabd767 Reland '[msan] Intercept dladdr1, and refactor dladdr'
Reland with -Wcast-qual issue fixed

Original commit message:
This patch adds an msan interceptor for dladdr1 (with support for RTLD_DL_LINKMAP and RTLD_DL_SYMENT) and an accompanying test. It also adds a helper file, msan_dl.cpp, that contains UnpoisonDllAddrInfo (refactored out of the dladdr interceptor) and UnpoisonDllAddr1ExtraInfo.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D154272
2023-07-06 16:16:22 +00:00
Matt Arsenault
9df70e4a4d AMDGPU: Fix not applying the correct default memcpy expansion threshold
Fixes 3c848194f2. The TTI hook name got
renamed at some point in the process and the target implementation was
left behind.

Fixes: SWDEV-407329
2023-07-06 12:14:14 -04:00
Yusra Syeda
c2964a597d [SystemZ][z/OS] Address single comment in ADA patch for EmittedBytes unused in -Asserts 2023-07-06 12:01:53 -04:00
Jeremy Furtek
6685fd8239 [mlir] Add support for TF32 as a Builtin FloatType
This diff adds support for TF32 as a Builtin floating point type. This
supplements the recent addition of the TF32 semantic to the LLVM APFloat class
by extending usage to MLIR.

https://reviews.llvm.org/D151923

More information on the TF32 type can be found here:

https://blogs.nvidia.com/blog/2020/05/14/tensorfloat-32-precision-format/

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D153705
2023-07-06 08:56:07 -07:00
Alex Langford
8f7e41d040 [lldb][NFCI] Minor cleanups to StructuredData::GetObjectForDotSeparatedPath
This accomplishes a few minor things:
- Removed unnecessary uses of `this->`
- Removed an unnecessary std::string allocation.
- Removed some nesting to improve readability using early returns where
  it makes sense.
- Replaced `strtoul` with `llvm::to_integer` which avoids another
  std::string allocation.
- Removed braces from single statement conditions, removed
  else-after-returns.

Differential Revision: https://reviews.llvm.org/D154534
2023-07-06 08:51:54 -07:00
Alex Langford
fc55b0b384 [lldb][NFCI] Remove use of ConstString from OptionValue
Summary: No need to create a ConstString, `GetName` already returns a StringRef.

Reviewers: JDevlieghere, mib, jasonmolenda

Subscribers:

Differential Revision: https://reviews.llvm.org/D154386
2023-07-06 08:49:07 -07:00
zhijian
d6d7f7b1d2 [AIX][XCOFF] print out the traceback info
Summary:

  Adding a new option -traceback-table to print out the traceback info of xcoff ojbect file.

Reviewers: James Henderson, Fangrui Song, Stephen Peckham, Xing Xue

Differential Revision: https://reviews.llvm.org/D89049
2023-07-06 11:47:08 -04:00
Joseph Huber
071c8a41cc [Libomptarget] Fix tests after deleting the next-gen plugins
The next-gen plugins didn't correctly configure tests and were never
actually being run. Since deleting the old plugin we stopped getting
`libomptarget` tests. This patch fixes the issue and allows the targets
to be built

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D154619
2023-07-06 10:44:50 -05:00
Doru Bercea
13888870e5 Enable dynamic-sized VLAs for data sharing in OpenMP offloaded target regions.
Review: https://reviews.llvm.org/D153883
2023-07-06 10:57:10 -04:00
Craig Topper
1db5b49ae6 [RISCV] Use ClangBuiltin in IntrinsicsRISCV.td to map some scalar crypto builtins to IR intrinsic.
This is the way most targets do it for a simple mapping.

We can't do this for all builtins due to type overloading of the IR intrinsics.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D154567
2023-07-06 07:53:31 -07:00
Nikita Popov
f3d0613d85 [CaptureTracking] Don't consider comparison of inbounds GEP with nonnull non-capturing
This is required to bring CaptureTracking in line with the new
semantics from D154051, as gep inbounds p, 0 is now always non-poison.

There are many ways in which the inbounds special case could be
preserved: If the index is known non-zero, or there is an inbounds
chain down to an identified object, etc. However, I have opted to
drop the special case entirely, as it appears to be low value:
In cases where we can determine such things (e.g. the affected test
cases) we would end up removing the compare via isGEPKnownNonNull()
logic anyway.

Differential Revision: https://reviews.llvm.org/D154054
2023-07-06 16:48:43 +02:00
David Spickett
36df92dcd9 [libcxx] Only add -GR- option to MSVC or clang-cl builds
Previously we added both `-GR-` and `-fno-rtti` if RTTI was disabled.
When building with clang 16.x, that caused this error in part of the build:
```
clang-16: error: argument unused during compilation: '-G R-' [-Werror,-Wunused-command-line-argument]
```
I think the strange message is because clang is seeing `R-` as the argument
to `-G`, which is a valid clang option.

`-GR-` is an alternate syntax for the `/GR-` option for MSVC
(the dash means disable RTTI):
https://learn.microsoft.com/en-us/cpp/build/reference/gr-enable-run-time-type-information?view=msvc-170

This error is sort of fixed by cd18efb61d
but not intentionally. Also, we'd have to wait for 17.x to benefit from that.

The proper fix here is to only add `-GR-` if we are building with MSVC
or the MSVC-like clang-cl, and add `-fno-rtti` if not.

Reviewed By: #libc, simon_tatham, michaelplatings, ldionne

Differential Revision: https://reviews.llvm.org/D154582
2023-07-06 14:47:02 +00:00
Leandro Lupori
cb0f98e10b [flang] Force the use of intrinsic builtins in type_info
This ensures that the __Fortran_builtins module is always used
as an intrinsic module by __Fortran_type_info, which avoids issues
when, for instance, the intrinsic modules dir is present in the
include paths.

Fixes https://github.com/llvm/llvm-project/issues/63592

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D154452
2023-07-06 11:39:30 -03:00
Simon Pilgrim
a69ffd6c73 [X86] isTargetShuffleEquivalent - ensure the reference operands are vector types
Fixes #63700
2023-07-06 15:38:01 +01:00
Craig Topper
a8a6a49474 [RISCV] Use 'long' in sha512 builtin tests. NFC
This matches the data type of the intrinsics. This case be seen
from the removal of sext and trunc instructions from the IR.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D154577
2023-07-06 07:37:19 -07:00
songruiwang
b22a5d4617 [analyzer] Fix false negative when pass implicit cast nil to nonnull
We should look through implicit casts before determining the type of the arguments, and only allow explicit cast to _Nonnull to suppress warning

```
void foo(NSString *_Nonnull);

foo((NSString * _Nonnull)nil); // no-warning
id obj = nil;
foo(obj); // should warning here (implicit cast id to NSString *_Nonnull)

```

Reviewed By: xazax.hun, steakhal

Differential Revision: https://reviews.llvm.org/D154221
2023-07-06 22:36:51 +08:00
Sergei Barannikov
ab49d30557 [Mips] Replace OperandMatchResultTy with ParseStatus (NFC)
ParseStatus is slightly more convenient to use due to implicit
conversion from bool, which allows to do something like:
```
  return Error(L, "msg");
```
when with MatchOperandResultTy it had to be:
```
  Error(L, "msg");
  return MatchOperand_ParseFail;
```
It also has more appropriate name since parse* methods are not only for
parsing operands.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154319
2023-07-06 17:36:02 +03:00
David Tenty
196c144d0b [clang][CodeGenCXX] Improve handling of itanium ABI member function alignment requirements
The itanium ABI for certain platforms requires a minimum alignments for
member function pointers to reserve certain bits for distinguishing
virtual and non-virtual functions.

Our implementation of this however depends on the alignment of the
function involved, which may however not reflect the true alignment of
function pointers on certain targets for which the alignment is
independent of the function (e.g. AIX). Worse, the 2-byte alignment
we use may be less than the ABI minimum for the target, and in the case
we are using explicit sections will result in invalid codegen.

This patch attempts to correct this situation by considering the target
alignment of function pointers as part of making the decision about
whether we need to adjust the function alignment to conform to the ABI.
Targets which do not provide the function ptr alignment information
will return a value of 1 when queried and will conservatively retain
the old alignment.

Differential Revision: https://reviews.llvm.org/D147184
2023-07-06 10:35:26 -04:00
Konrad Kleine
58fb2c7a6c [lld] respect LLVM_EXTERNAL_LIT
Consider a setup without a system-wide installation of lit.
Instead you pass the path to lit like this:

```
cmake ...
-DLLVM_EXTERNAL_LIT=<PATH_TO_LIT_BINARY> ...
```

Then you will run into this error:

```
ninja: error: unknown target 'check-lld'
```

I have a buildbot builder that fails with this message. Here's the
passage that triggers this error:

d3bfd5ccbc/zorg/buildbot/builders/annotated/standalone-build.sh (L194-L239)

By using `LLVM_EXTERNAL_LIT` instead of `LLVM_LIT` we fix this problem.

See
[here](https://llvm.org/docs/GettingStarted.html#stand-alone-builds) for
a description:

> Both the LLVM_ROOT and LLVM_EXTERNAL_LIT options are required to do stand-alone builds for all sub-projects. Additional required options for each sub-project can be found in the table below.

Differential Revision: https://reviews.llvm.org/D154599
2023-07-06 16:35:01 +02:00
Jens Massberg
8af9a373ad Add missing semantic highlighing for concepts.
Differential Revision: https://reviews.llvm.org/D154580
2023-07-06 16:28:57 +02:00
Matt Arsenault
c70cae6315 AMDGPU: Make SIFixVGPRCopies preserve everything
All this does is add uses of reserved registers, which
aren't tracked by anything. Saves a loop info computation.
2023-07-06 10:26:21 -04:00
Matt Arsenault
8ee1cc82c9 AMDGPU: Fold out sign bit ops on frexp_exp
The sign bit has no impact on the exponent, so strip these away. Saves
on the source modifier encoding cost. I left the GlobalISel handling
until there's a resolution to issue #62628.

We should do this in instcombine too, but legalization should be
introducing more frexps than it currently is where this would occur.
2023-07-06 10:26:21 -04:00
Paul Walker
90b83a6d6c [SVE] Add isel for 32-bit add/sub(cntp()) -> incp/decp.
Patterns already exist for 64-bit that I've simply copied and
converted to include the necessary truncation.

Differential Revision: https://reviews.llvm.org/D154350
2023-07-06 14:25:18 +00:00