Commit Graph

513090 Commits

Author SHA1 Message Date
Maksim Panchenko
6fb39ac77b [BOLT][merge-fdata] Initialize YAML profile header (#109613)
While merging profiles, some fields in the input header, e.g.
HashFunction, could be uninitialized leading to a UMR. Initialize merged
header with the first input header.

Fixes #109592
2024-09-25 23:18:34 +02:00
LLVM GN Syncbot
924b3904b7 [gn build] Port 7e5df5bcc3 2024-09-25 21:03:28 +00:00
vporpo
7e5df5bcc3 [SandboxIR] Implement Module (#109716)
This patch implements sandboxir::Module.
It provides access to globals.
2024-09-25 14:02:52 -07:00
SJW
7645d9c77d [mlir][scf] Fix loop iteration calculation for negative step in LoopPipelining (#110035)
This fixes loop iteration count calculation if the step is
    a negative value, where we should adjust the added
    delta from `step-1` to `step+1` when doing the ceil div.
2024-09-25 13:32:12 -07:00
Nikita Popov
29b92d0774 Revert "[SLP]Initial support for non-power-of-2 (but still whole register) number of elements in operands."
This reverts commit 6b109a34cc.

This causes a crash when linking lencod in ReleaseThinLTO configuration
2024-09-25 22:05:10 +02:00
Tarun Prabhu
c3201ddaea [flang][NFC] Refactor to remove .inc file containing shared code (#109874)
Remove flang/include/flang/Tools/CLOptions.inc - which was included as
is in - several places. Move the code in it to header and source files
which are used used in the "standard" way. Some minor cleanup such as
removing trailing whitespace and excessive newlines and reordering
entries alphabetically for files that were modified along the way.
Update the documentation that referenced CLOptions.inc.
2024-09-25 14:04:38 -06:00
Joseph Huber
eb48aac7d4 [Clang] Automatically link the compiler-rt for GPUs if present (#109152)
Summary:
This automically links `copmiler-rt` for offloading languages if it
exists in the resource directory.
2024-09-25 12:58:10 -07:00
Nico Weber
8588c6ec54 [gn build] Port eba21accf2 2024-09-25 15:47:42 -04:00
Shourya Goel
b935d312f1 [libc][math] Reapply and fix issignaling macro. (#110011)
reapply #109615
2024-09-25 15:39:55 -04:00
Florian Hahn
2b125e899b [LV] Don't pass loop preheader to getOrCreateVectorTripCount (NFCI).
The vector trip count must already be created when fixupIVUsers is
called. Don't pass the vector preheader there and delay retrieving the
vector loop header. This ensures we are re-using the already computed
trip count. Computing the trip count from scratch would not be correct,
as the IR may not be in a valid state yet.
2024-09-25 20:39:05 +01:00
Kazu Hirata
639a0afa99 Revert "Deprecate the -fbasic-block-sections=labels option. (#107494)"
This reverts commit 1911a50fae.

Several bots are failing:

https://lab.llvm.org/buildbot/#/builders/190/builds/6519
https://lab.llvm.org/buildbot/#/builders/3/builds/5248
https://lab.llvm.org/buildbot/#/builders/18/builds/4463
2024-09-25 12:34:43 -07:00
Rahman Lavaee
1911a50fae Deprecate the -fbasic-block-sections=labels option. (#107494)
This feature is supported via the newer option
`-fbasic-block-address-map`. Using the old option still works by
delegating to the newer option, while a warning is printed to show
deprecation.
2024-09-25 12:03:38 -07:00
Rahul Joshi
6786928c4f [Core] Skip over target name in intrinsic name lookup (#109971)
When searching for an intrinsic name in a target specific slice of the
intrinsic name table, skip over the target prefix. For such cases,
currently the first loop iteration in `lookupLLVMIntrinsicByName` does
nothing (i.e., `Low` and `High` stay unchanged and it does not shrink
down the search window), so we can skip this useless first iteration by
skipping over the target prefix.
2024-09-25 12:01:43 -07:00
Rahul Joshi
2f43e65955 [LLVM][TableGen] Check name conflicts between target dep and independent intrinsics (#109826)
Validate that for target independent intrinsics the second dotted
component of their name (after the `llvm.`) does not match any existing
target names (for which atleast one intrinsic has been defined). Doing
so is invalid as LLVM will search for that intrinsic in that target's
intrinsic table and not find it, and conclude that its an unknown
intrinsic.
2024-09-25 12:01:17 -07:00
Chris Apple
c3334dad73 [rtsan] Add exit statistics (#109885)
adds the flag `print_stats_on_exit` which mirrors nsan's same flag.

# Why?

Not only is this nice for the end users, this gives us a very trivial
way to test deduplication which is next up

Currently the style is something like:

```
RealtimeSanitizer exit stats:
    Total error count: 488
```
2024-09-25 11:59:11 -07:00
gonzalobg
0f521931b8 LLVMContext: add getSyncScopeName() to lookup individual scope name (#109484)
This PR adds a `getSyncScopeString(Id)` API to `LLVMContext` that
returns the `StringRef` for that ID, if any.
2024-09-25 11:13:56 -07:00
Jan Svoboda
c71bfc59ee [clang] Fix FileManagerTest
Compilation failure caused by b1aea98cfa.
2024-09-25 10:54:40 -07:00
Luke Lau
f172c31a57 [RISCV] Lower memory ops and VP splat for zvfhmin and zvfbfmin (#109387)
We can lower f16/bf16 memory ops without promotion through the existing
custom lowering.

Some of the zero strided VP loads get combined to a VP splat, so we need
to also handle the lowering for that for f16/bf16 w/ zvfhmin/zvfbfmin.
This patch copies the lowering from ISD::SPLAT_VECTOR over to
lowerScalarSplat which is used by the VP splat lowering.
2024-09-26 01:47:46 +08:00
vporpo
eba21accf2 [SandboxIR][Utils] Implement getMemoryLocation() (#109724)
This patch implements sandboxir::Utils::memoryLocationGetOrNone() that calls
MemoryLocation::getOrNone() internally.
Ideally this would require a sandboxir::MemoryLocation, but this should
be good enough for now.
2024-09-25 10:43:36 -07:00
Lewis Crawford
394f59c203 [NVPTX] Add Read/Write/SideEffect attributes to atomic instructions (#109665)
Set the mayLoad, mayStore, and hasSideEffects hints for NVPTX atomic
instructions. This prevents any optimizations (e.g. rematerialization)
from illegally duplicating them and generating broken code.
2024-09-25 10:39:03 -07:00
Jan Svoboda
b1aea98cfa [clang] Make deprecations of some FileManager APIs formal (#110014)
Some `FileManager` APIs still return `{File,Directory}Entry` instead of
the preferred `{File,Directory}EntryRef`. These are documented to be
deprecated, but don't have the attribute that warns on their usage. This
PR marks them as such with `LLVM_DEPRECATED()` and replaces their usage
with the recommended counterparts. NFCI.
2024-09-25 10:36:44 -07:00
Fangrui Song
abe0dd195a [llvm-objdump] Print ... even if a data mapping symbol is active
Swap `!DisassembleZeroes` and `if (DumpARMELFData)` conditions so that
in the false DisassembleZeroes case (default), `...` will be printed for
long consecutive zeroes, even when a data mapping symbol is active.

This is especially useful for certain lld tests that insert a huge
padding within a code section. Without `...` the output will be huge.

Pull Request: https://github.com/llvm/llvm-project/pull/109553
2024-09-25 10:32:40 -07:00
Craig Topper
3c348bf543 [RISCV] Fold (fmv_x_h/w (load)) to an integer load. (#109900) 2024-09-25 10:29:44 -07:00
Fangrui Song
72307ba615 [ELF] Pass Ctx & to Driver 2024-09-25 10:22:13 -07:00
Jonas Devlieghere
b3b6141ba1 [lldb] Fix two formatv issues in LDB_LOG (NFC) 2024-09-25 10:17:09 -07:00
David CARLIER
a280275cff [compiler-rt] Fix #83679 for macos sdk < 13.0 (#109946) 2024-09-25 18:11:02 +01:00
Edd Dawson
660ddb3a93 [PS4,PS5][Driver] Pass -L<sdk>/target/lib -L. to linker (#109796)
The proprietary PS4 linker implicitly adds `=/target/lib` and `.` as
library search paths. This behaviour was added to the PS5 linker via a
downstream patch in LLD. This really belongs in the driver, instead.
This change adds the driver behaviour to allow removal of the downstream
patch in LLD.

There are no plans to update the PS4 linker behaviour in the analogous
way, so do not pass the same search paths to the PS4 linker.

SIE tracker: TOOLCHAIN-16704
2024-09-25 18:08:32 +01:00
Louis Dionne
1c1bb77498 [libc++abi] Fix issue when building the demangler in C++11
Captures with an initializer only work in C++14. This broke the C++11
CI but wasn't noticed because our CI was down.
2024-09-25 12:41:09 -04:00
Louis Dionne
78c6506543 [libc++] Disable the clang-tidy checks to get CI back (#109989)
The CI has been a complete mess for the past week, and the only thing
preventing it from being back is the Clang tidy checks. Disable them (as
a total hack) to get CI back.
2024-09-25 12:40:14 -04:00
Thomas Köppe
cebb7c0108 [clang-tidy] modernize-use-nullptr matches "NULL" in templates (#109169)
Make modernize-use-nullptr matcher also match "NULL", but not "0", when
it appears on a substituted type of a template specialization.

Previously, any matches on a substituted type were excluded, but this
meant that a situation like the following is not diagnosed:

```c++
template <typename T>
struct X {
  T val;
  X() { val = NULL; }  // should diagnose
};
```

When the user says `NULL`, we expect that the destination type is always
meant to be a pointer type, so this should be converted to `nullptr`. By
contrast, we do not propose changing a literal `0` in that case, which
appears as initializers of both pointer and integer specializations in
reasonable real code. (If `NULL` is used erroneously in such a
situation, it should be changed to `0` or `{}`.)
2024-09-25 09:25:46 -07:00
Rainer Orth
d01e336336 [Driver] Enable ASan on Solaris/SPARC (#107403)
Once PR #107223 lands, ASan can be enabled on Solaris/SPARC. This patch
does just that. As on Solaris/x86, the dynamic ASan runtime lib needs to
be linked with `-z now` to avoid an `AsanInitInternal` cycle.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
2024-09-25 18:15:45 +02:00
Lukacma
fff03b07c6 Fix "[AArch64] Implement intrinsics for SME2 FSCALE" (#109999)
This patch fixes failure in acle_sme2_fp8_scale.c test
2024-09-25 17:00:40 +01:00
Florian Hahn
aae7ac6685 [VPlan] Remove VPIteration, update to use directly VPLane instead (NFC)
After 8ec406757c (https://github.com/llvm/llvm-project/pull/95842),
only the lane part of VPIteration is used.

Simplify the code by replacing remaining uses of VPIteration with VPLane directly.
2024-09-25 16:44:42 +01:00
Philip Reames
556ec4a726 [SLP] Pass operand info to getCmpSelInstrInfo (#109998)
Depending on the constant, selects with constant arms can have highly
varying cost. This adjusts SLP to use the new API introduced in
d2885743.

Fixes https://github.com/llvm/llvm-project/issues/109466.
2024-09-25 08:17:55 -07:00
lntue
808c498f52 Revert "[libc][math] Implement issignaling macro." (#109992)
Reverts llvm/llvm-project#109615
2024-09-25 10:58:08 -04:00
Juan Manuel Martinez Caamaño
88945db4df [AMDGPU][SIPreEmitPeephole] pre-commit tests: mustRetainExeczBranch: use a cost model (#109816) 2024-09-25 16:57:08 +02:00
Chris Cotter
11c423f9be [clang-tidy] Add support for bsl::optional (#101450) 2024-09-25 10:54:31 -04:00
Sean Perry
97189492a1 The real option name and not the alias used is displayed in msgs when using a config file (#107613)
An example of this is the -mpure-code option. Without a config file
being used, an error message will print `-mpure-code`. But if a config
file is used, the error message will print `-mexecute-only`.
2024-09-25 10:51:55 -04:00
Dmitry Chernenkov
4cb61c20ef Revert "[NVPTX] deprecate nvvm.rotate.* intrinsics, cleanup funnel-shift handling (#107655)"
This reverts commit 9ac00b85e0.
2024-09-25 14:50:26 +00:00
Dmitry Chernenkov
9a0e281e8c Revert "[NVVM] Upgrade nvvm.ptr.* intrinics to addrspace cast (#109710)"
This reverts commit 36757613b7.
2024-09-25 14:50:26 +00:00
Abhina Sree
74dcf0b595 [SystemZ][z/OS] Open text files in text mode (#109972)
This patch continues the work that was started here
https://reviews.llvm.org/D99426 to correctly open text files in text
mode.
2024-09-25 10:49:45 -04:00
Timm Baeder
a024a0ceed [clang][bytecode] Override InConstantContext flag for immediate calls (#109967)
And fix the diagnostics for __builtin_is_constant_evaluated(). We can be
in a non-constant context, but calling an immediate function always
makes the context constant for the duration of that call.
2024-09-25 16:46:46 +02:00
jeanPerier
3be8e3ad0c [flang] translate pure and elemental attribute in FIR (#109954)
Follow-up from a previous patch that turned bind_c into an enum for
procedure attribute.

This patch carries the elemental and pure Fortran attribute into FIR so
that the optimizer can leverage that info in the future (I think debug
info may also need to know these aspects since DWARF has DW_AT_elemental
and DW_AT_pure nodes).

SIMPLE from F2023 will be translated once it is handled in the
front-end.

NON_RECURSIVE is only meaningful on func.func since we are not
guaranteed to know that aspect on the caller side (it is not part of
Fortran characteristics). There is a DW_AT_recursive DWARF node. I will
do it while dealing with func.func attributes.
2024-09-25 16:45:47 +02:00
Chris Apple
6fae8b8a42 [rtsan][NFC] Rename RTSAN_LINK_LIBS to RTSAN_DYNAMIC_LIBS (#109991)
Follow on to #109715 

This better matches this same variable in asan, ubsan, hwasan, and nsan.
Shows the logical coupling, and describes them as "dynamic only" which
is their intent.
2024-09-25 07:44:30 -07:00
Alexey Bataev
6b109a34cc [SLP]Initial support for non-power-of-2 (but still whole register) number of elements in operands.
Patch adds basic support for non-power-of-2 number of elements in
operands. The patch still requires that this number addresses whole
registers.

Reviewers: RKSimon, preames

Reviewed By: preames

Pull Request: https://github.com/llvm/llvm-project/pull/107273
2024-09-25 10:43:27 -04:00
Sean Perry
a514457e62 Mark tests as unsupported when targeting z/OS (#107916)
Set up these tests so these are marked as unsupported when targeting
z/OS. Most would already be unsupported if you ran lit on z/OS. However,
they also need to be unsupported if the default triple is z/OS.
2024-09-25 10:43:02 -04:00
Shourya Goel
ac802a3148 [libc][math] Implement issignaling macro. (#109615)
#109201
2024-09-25 10:35:20 -04:00
David Spickett
26e0b50772 [lldb][lldb-dap] Fix compilation error on 32 bit platforms
https://github.com/llvm/llvm-project/pull/109485 tried to std::min
between size_t and uint64_t. size_t on 32 bit is 32 bits.

https://lab.llvm.org/buildbot/#/builders/18/builds/4430/steps/4/logs/stdio

Explicitly select the size_t template to fix this.

This will truncate one of the arguments but that's the count_requested.
If you're debugging from a 32 bit host and you asked it to read
> 32 bit range of memory from a 64 bit target, you weren't going
to have any success anyway.

The final result needs to be size_t to resize the vector with.
2024-09-25 14:31:57 +00:00
Philip Reames
d288574363 [TTI][RISCV] Model cost of loading constants arms of selects and compares (#109824)
This follows in the spirit of 7d82c99403,
and extends the costing API for compares and selects to provide
information about the operands passed in an analogous manner. This
allows us to model the cost of materializing the vector constant, as
some select-of-constants are significantly more expensive than others
when you account for the cost of materializing the constants involved.

This is a stepping stone towards fixing
https://github.com/llvm/llvm-project/issues/109466. A separate SLP patch
will be required to utilize the new API.
2024-09-25 07:25:57 -07:00
Alexey Bataev
3469db82b5 [SLP]Add subvector vectorization for non-load nodes
Previously SLP vectorize supported clustered vectorization for loads
only. This patch adds support for "clustered" vectorization for other
instructions.
If the buildvector node contains "clusters", which can be vectorized
separately and then inserted into the resulting buildvector result, it
is better to do, since it may reduce the cost of the vector graph and
produce better vector code.
The patch does some analysis, if it is profitable to try to do this kind
of extra vectorization. It checks the scalar instructions and its
operands and tries to vectorize them only if they result in a better
graph.

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: https://github.com/llvm/llvm-project/pull/108430
2024-09-25 10:23:41 -04:00