Commit Graph

493504 Commits

Author SHA1 Message Date
Jonas Devlieghere
556fe5f290 [lldb] Reland: Store SupportFile in FileEntry (NFC) (#85892)
This is another step towards supporting DWARF5 checksums and inline
source code in LLDB. This is a reland of #85468 but without the
functional change of storing the support file from the line table (yet).
2024-03-21 08:40:08 -07:00
Nick Desaulniers
0c8dfc85c3 [libc][stdio][test] fixup rename test (#86136)
Link: #84980
Link: #85068
2024-03-21 08:36:47 -07:00
timoh-ba
7650a01927 [DWARF5][COFF] Emit section-relative .debug_line_str relocations (#83773)
Dwarf 5 allows separating filenames from .debug_line into a separate
.debug_line_str section. The strings are referenced relative to the
start of the .debug_line_str section. Previously, on COFF, the
relocation information instead caused offsets to be relocated to the
base address of the COFF-File. This lead  to wrong offsets in linked
COFF (PE) files which caused the debugger to be unable to find the
correct source files.

This patch fixes this problem by making the offsets relative to the
start of the .debug_line_str section instead. There should be no
changes for ELF-Files as everything seems to be working there.

A test is also added to ensure that the correct relocation entries are
emitted.
2024-03-21 17:30:10 +02:00
Martin Storsjö
50801f1095 Reapply [libcxx] [modules] Fix relative paths with absolute LIBCXX_INSTALL_MODULES_DIR (#86020)
This reapplies 272d1b44ef (from #85756),
which was reverted in
407937036f.

In the previous attempt, empty CMAKE_INSTALL_PREFIX was handled by
quoting them, in d209d1340b. That made the
calls to cmake_path(ABSOLUTE_PATH) succeed, but the output paths of that
weren't actually absolute, which was required by file(RELATIVE_PATH).

Avoid this issue by constructing a non-empty base directory variable
to use for calculating the relative path.
2024-03-21 17:29:15 +02:00
aniplcc
c04807c84e [libc][c11] Add stdio.h's rename() function (#85068)
Adds stdio.h's rename() function as defined in n3096. Fixes  #84980.
2024-03-21 08:21:06 -07:00
Craig Topper
7678e6e562 [RISCV] Lower the alignment requirement for a GPR pair spill for Zdinx on RV32. (#85871)
I believe we can use XLen alignment as long as eliminateFrameIndex
limits the maximum folded offset to 2043. This way when we split
the load/store into two 2 instructions we'll be able to add 4
without overflowing simm12.
2024-03-21 08:14:48 -07:00
Simon Pilgrim
e4fa2e3562 [DAG] isGuaranteedNotToBeUndefOrPoisonForTargetNode - add fallback implementation (#86125)
Allow targets to rely on TargetLowering::isGuaranteedNotToBeUndefOrPoisonForTargetNode to test nodes for canCreateUndefOrPoisonForTargetNode + all arguments are isGuaranteedNotToBeUndefOrPoison.

Targets can still perform this themselves for specific special case nodes (e.g. target shuffles).

Matches the fallback in SelectionDAG::isGuaranteedNotToBeUndefOrPoison
2024-03-21 15:11:59 +00:00
Alexey Bataev
8d7a6e2fd8 [SLP]Fix a crash for gather node with instructions from different bbs,
if cost threshold is very low.
2024-03-21 08:03:06 -07:00
Nikita Popov
6898147b9f [InstCombine] Add contributor guide (#79007)
Document expectations for contributions to InstCombine, especially
regarding test coverage and alive2 proofs.
2024-03-21 16:00:53 +01:00
Jonas Paulsson
b4b5e8277a Check for all frame instructions in finalize isel. (#85945)
Check for all frame instructions in finalize isel, not just for the
frame setup opcode. This was proven necessary, see #78001 
for discussion.
2024-03-21 11:00:08 -04:00
Joe Nash
44278f2326 [AMDGPU][MC] Fix GFX12 check line typo and move test
NFC.
Fix CHECK lines that seem to have a copy paste error.
Move the test that was formerly in gfx12_dasm_vinterp.txt (see #85949).
2024-03-21 10:46:07 -04:00
Joe Nash
d1f182c895 [AMDGPU][MC][True16] Rename and combine VINTERP MC tests (#85949)
NFC.
gfx11_asm_vinterp.s already contained GFX12 run lines. Rename the
assembler and disassembler tests to be sorted based on real16 or fake16
instead of gfxip. Note, both GFX11 and GFX12 currently only have fake16
(fake16 in encoding, but not by name) upstream, so that is why the test
files have a -fake16 suffix.

One test input is changed, and that is the disassembler test for
unsupported bits in the instruction. It is now an input that is valid on
both GFX11 and GFX12. This was necessary because the size of the opcode
field changed.
2024-03-21 10:42:39 -04:00
Benjamin Maxwell
2861856baf [mlir][Vector] Add utility for computing scalable value bounds (#83876)
This adds a new API built with the `ValueBoundsConstraintSet` to compute
the bounds of possibly scalable quantities. It uses knowledge of the
range of vscale (which is defined by the target architecture), to solve
for the bound as either a constant or an expression in terms of vscale.

The result is an `AffineMap` that will always take at most one
parameter, vscale, and returns a single result, which is the bound of
`value`.

The API is defined as follows:

```c++
FailureOr<ConstantOrScalableBound>
vector::ScalableValueBoundsConstraintSet::computeScalableBound(
  Value value, std::optional<int64_t> dim,
  unsigned vscaleMin, unsigned vscaleMax,
  presburger::BoundType boundType, 
  bool closedUB = true,
  StopConditionFn stopCondition = nullptr);
```

Note: `ConstantOrScalableBound` is a thin wrapper over the `AffineMap`
with a utility for converting the bound to a single quantity (i.e. a
size and scalable flag).

We believe this API could prove useful downstream in IREE (which uses a
similar analysis to hoist allocas, which currently fails for scalable
vectors).
2024-03-21 14:18:56 +00:00
Mark de Wever
2152094a45 [clang] Improves -print-library-module-manifest-path. (#85943)
This adds a libc++ to modules.json as is currently used by libc++. When
libc++.so is not found the function will search for libc++.a as
fallback.
2024-03-21 15:11:45 +01:00
Akira Hatanaka
a11d9b4639 Disable driver tests on macosx that are currently disabled on darwin (#85990)
macosx and darwin in triples are equivalent.

rdar://124246653
2024-03-21 07:10:42 -07:00
LLVM GN Syncbot
26c3d018b1 [gn build] Port 857161c367 2024-03-21 13:57:14 +00:00
Janek van Oirschot
857161c367 [AMDGPU] MCExpr-ify MC layer kernel descriptor (#80855)
Kernel descriptor attributes, with their respective emit and asm parse functionality, converted to MCExpr.
2024-03-21 13:57:10 +00:00
Yingwei Zheng
2bfa7d0e16 [InstCombine] Fold fmul X, -0.0 into copysign(0.0, -X) (#85772)
`fneg + copysign` is better than fmul for analysis/codegen.
godbolt: https://godbolt.org/z/eEs6dGd1G
Alive2: https://alive2.llvm.org/ce/z/K3M5BA
2024-03-21 21:48:10 +08:00
David Green
686f4599cf [ARM] Regenerate some check lines. NFC 2024-03-21 13:45:44 +00:00
Simon Pilgrim
15eba9c12a [VectorCombine] Add DataLayout to VectorCombine class instead of repeated calls to getDataLayout(). NFC. 2024-03-21 13:36:23 +00:00
Kirill Chibisov
5344a370fe [mlir][emitc] Fix form-expressions inside expression (#86081)
Make form-expressions not create `emitc.expression`s for operations
inside the `emitc.expression`s, since they are invalid.
2024-03-21 14:35:00 +01:00
chrulski-intel
276283d864 [LLD] [MinGW] Implement the -lto-sample-profile option (#85841)
This has been a supported option for ELF and is added to the COFF Linker
in #85701
2024-03-21 21:34:01 +08:00
Matthias Gehre
0aa6d57e57 [MLIR] Add initial convert-memref-to-emitc pass (#85389)
This converts `memref.alloca`, `memref.load` & `memref.store` to
`emitc.variable`, `emitc.subscript` and `emitc.assign`.
2024-03-21 14:27:37 +01:00
Christian Sigg
538257bf00 [mlir][bazel] Update BUILD after 61b24c61a9 2024-03-21 14:24:55 +01:00
Alexey Bataev
aa4cbaba1d [SLP][NFC]Add a test with @llvm.abs nodes, which can be analyzed for
better bitwidth.
2024-03-21 06:16:18 -07:00
Paul T Robinson
49b5208569 [X86][Headers] Specify result of NaN comparisons (#85862)
Make sure all float/double comparison intrinsics specify what happens
with a NaN input. Update some existing descriptions of comparison
results to make them all consistent.

Also replace "yields" with "returns" throughout.
2024-03-21 09:09:34 -04:00
Spenser Bauman
fa6e433836 [mlir][tosa] Fix assertion failure in tosa-layerwise-constant-fold (#85670)
The existing implementation of tosa-layerwise-constant-fold only works
for constant values backed by DenseElementsAttr. For constants which
hold DenseResourceAttrs, the folder will end up asserting at runtime, as
it assumes that the backing data can always be accessed through
ElementsAttr::getValues.

This change reworks the logic so that types types used to perform
folding are based on whether the ElementsAttr can be converted to a
range of that particular type.

---------

Co-authored-by: Spenser Bauman <sabauma@mathworks.com>
Co-authored-by: Tina Jung <tinamaria.jung@amd.com>
2024-03-21 09:02:21 -04:00
Sergio Afonso
734026347c Reapply "[Flang][OpenMP][Lower] NFC: Move clause processing helpers into the ClauseProcessor (#85258)" (#85807)
This patch contains slight modifications to the reverted PR #85258 to
avoid issues with constructs containing multiple reduction clauses,
uncovered by a test on the gfortran testsuite.

This reverts commit 9f80444c2e.
2024-03-21 12:25:48 +00:00
paperchalice
02cb89b36a [NewPM] Handle error in TargetPassRegistry.inc (#86112)
Mistakenly believing that checking Expected is sufficient.
2024-03-21 20:09:49 +08:00
Ilia Kuklin
4946cc37f4 [llvm-objcopy] Add --skip-symbol and --skip-symbols options (#80873)
Add --skip-symbol and --skip-symbols options that allow to skip symbols
when executing other options that can change the symbol's name, binding
or visibility, similar to an existing option --keep-symbol that keeps a
symbol from being removed by other options.
2024-03-21 17:05:35 +05:00
Nikolas Klauser
2699072b4b [clang] Accept lambdas in C++03 as an extensions (#73376)
Implements
https://discourse.llvm.org/t/rfc-allow-c-11-lambdas-in-c-03-as-an-extension/75262
2024-03-21 12:57:24 +01:00
Christian Sigg
df6a1d4409 [mlir][tensor] NFC: fully qualify verifyEncoding arguments. 2024-03-21 12:32:12 +01:00
Alexey Bataev
34f0a8aaba [SLP]Fix comparison in bitwidth check.
Projected bitwidth should be less than the original, not greater.
2024-03-21 04:24:34 -07:00
SahilPatidar
3ac243bc0d Update amdgpu_gfx functions to use s0-s3 for inreg SGPR arguments on targets using scratch instructions for stack #78226 (#81394)
Resolve #78226
2024-03-21 16:52:08 +05:30
Christian Sigg
83e5a12392 [mlir][bazel] Don't expose interface headers from //mlir:IR. (#85867)
Move 3 interface headers in `//mlir:IR` from `hdrs` to `srcs`.

Header files should not be added to multiple targets, but this is hard
to avoid because CMake is less strict with headers. But we should at
least avoid exposing them as headers by multiple targets because it
confuses tooling.
2024-03-21 12:21:44 +01:00
AtariDreams
7e72cafd68 [SelectionDAG] Add MaskedValueIsZero check to allow folding of zero extended variables we know are safe to extend (#85573)
Add ones for every high bit that will cleared.

This will allow us to evaluate variables that have their bits known to
see if they have no risk of overflow despite the shift amount being
greater than the difference between the two types.
2024-03-21 16:45:17 +05:30
Mark de Wever
8779edb8b3 [libc++] Deprecates std::errc constants. (#80542)
Implements:
- LWG3869 Deprecate std::errc constants related to UNIX STREAMS
2024-03-21 12:14:24 +01:00
Ulrich Weigand
e8cf175498 [runtimes] Fix OpenMP dependencies (#85977)
When building the OpenMP runtime with libomptarget support, the runtimes
configure step needs to have a dependency on various tools, in
particular opt, so that cmake configure checks yield the correct
results.

This did not work correctly, as the dependencies were only added if the
OPENMP_ENABLE_LIBOMPTARGET was set - but that variable is only set by
the openmp/CMakeLists.txt file, which isn't even parsed during the
initial cmake run (in fact, it is only parsed when executing the
runtimes configure step itself, but then it is too late).

Fixed by just adding those dependencies always.

In addition, the list of dependencies collected in ${extra_deps},
including those required for OpenMP, was only actually used when
configuring runtimes for the default set of targets - when the user
specifies a non-default LLVM_RUNTIME_TARGETS, those extra dependencies
were ignored (with the exception of ${hdrgen_deps}).

Fixed by passing the full ${extra_deps} in this case as well.

Fixes: https://github.com/llvm/llvm-project/issues/85933
2024-03-21 12:05:11 +01:00
Ulrich Weigand
cb071942f8 [OpenMP] Fix SystemZ build failure
Commit a7d5f73a03 introduced an
error in a target_compile_definitions on the SystemZ, causing
the build to break.  Fixed by adding the missing "PRIVATE".
2024-03-21 12:02:50 +01:00
Nikolas Klauser
2096f37d7a [libc++][NFC] Use __constexpr_memmove instead of copy_n in <__string/char_traits.h> (#85920)
`copy_n` has been used to allow constant evaluation of `char_traits`. We
now have `__constexpr_memmove`, which `copy_n` just forwards to. We can
call `__constexpr_memmove` directly, avoiding a bunch of instantiations.
This reduces the time it takes to include `<string>` from 321ms to
285ms.
2024-03-21 11:57:07 +01:00
Pierre van Houtryve
95a834a16c (Reland) [AMDGPU] Run LowerLDS at the end of the fullLTO pipeline (#85626)
Reland of #75333
2024-03-21 11:44:47 +01:00
Jacek Caban
0124e0821d [Object][COFF][NFC] Introduce Arm64ECThunkType enum. (#85936)
And use it in EC lowering code. It will be useful for LLD too.
2024-03-21 11:43:48 +01:00
Jacek Caban
8ecc377c88 [llvm-lib] Use ARM64EC machine type for import libraries when -machine:arm64x is used. (#85972)
This is compatible with MSVC, `-machine:arm64x` is essentially an alias
to `-machine:arm64ec`. To make a type library that exposes both native
and EC symbols, an additional `-defArm64Native` argument is needed in
both cases.
2024-03-21 11:40:46 +01:00
Pierre van Houtryve
ccb3a8feaa [AMDGPU][LowerModuleLDS] Refactor partially lowered module detection (#85793)
Refactor the logic that checks if a module contains mixed
absolute/non-lowered LDS GVs.

The check now happens latter when the "worklists" are formed. This is
because in some cases (OpenMP) we can have non-lowered GVs in a lowered
module, and this is normal because those GVs are just unused and removed
from the list at some point before the end of `getUsesOfLDSByFunction`.

Doing the check later ensures that if a mixed module is spotted, then
it's a _real_ mixed module that needs rejection, not a module containing
an intentionally ignored GV.
2024-03-21 11:28:35 +01:00
Simon Pilgrim
23de3862dc [DAG] visitSUB - use sd_match to match SUB(MAX,MIN) -> ABD pattern. NFC.
Seriously simplifies the commutation matching logic.
2024-03-21 09:55:50 +00:00
Simon Pilgrim
11aa95f83b [DAG] visitSUB - pull out repeated getScalarSizeInBits() calls. NFC. 2024-03-21 09:55:50 +00:00
Johannes Reifferscheid
a6a9215b93 Lower shuffle to single-result form if possible. (#84321)
We currently always lower shuffle to the struct-returning variant. I saw
some cases where this survived all the way through ptx, resulting in
increased register usage. The easiest fix is to simply lower to the
single-result version when the predicate is unused.
2024-03-21 10:33:49 +01:00
Simon Pilgrim
ee5e027cc6 [X86] getShuffleCost - recognise concat_vector(X,Y) shuffle as InsertSubvector instead of PermuteTwoSrc
We don't have a concat_vector shuffle kind and improveShuffleKindFromMask won't alter the base type to match it as InsertSubvector.

But since this is how X86 will lower concat_vector anyhow, just recognise it explicitly.

Another step for #67803
2024-03-21 09:29:39 +00:00
Simon Pilgrim
7b5a5be2a7 [DAG] visitSUB/visitSUBO - move getAsNonOpaqueConstant into the if() where its used. NFC.
Noticed while beginning some cleanup for moving to pattern matchers
2024-03-21 09:19:12 +00:00
Christian Sigg
9fb85b0994 [mlir][bazel] Update BUILD after 29bf32efbb. 2024-03-21 10:08:03 +01:00