Commit Graph

432349 Commits

Author SHA1 Message Date
Greg Clayton c012408453 Implement better path matching in FileSpecList::FindCompatibleIndex(...).
Currently a FileSpecList::FindFileIndex(...) will only match the specified FileSpec if:
- it has filename and directory and both match exactly
- if has a filename only and any filename in the list matches

Because of this, we modify our breakpoint resolving so it can handle relative paths by doing some extra code that removes the directory from the FileSpec when searching if the path is relative.

This patch is intended to fix breakpoints so they work as users expect them to by adding the following features:
- allow matches to relative paths in the file list to match as long as the relative path is at the end of the specified path at valid directory delimiters
- allow matches to paths to match if the specified path is relative and shorter than the file paths in the list

This allows us to remove the extra logic from BreakpointResolverFileLine.cpp that added support for setting breakpoints with relative paths.

This means we can still set breakpoints with relative paths when the debug info contains full paths. We add the ability to set breakpoints with full paths when the debug info contains relative paths.

Debug info contains "./a/b/c/main.cpp", the following will set breakpoints successfully:
- /build/a/b/c/main.cpp
- a/b/c/main.cpp
- b/c/main.cpp
- c/main.cpp
- main.cpp
- ./c/main.cpp
- ./a/b/c/main.cpp
- ./b/c/main.cpp
- ./main.cpp

This also ensures that we won't match partial directory names, if a relative path is in the list or is used for the match, things must match at the directory level.

The breakpoint resolving code will now use the new FileSpecList::FindCompatibleIndex(...) function to allow this fuzzy matching to work for breakpoints.

Differential Revision: https://reviews.llvm.org/D130401
2022-08-08 15:20:38 -07:00
Jonas Devlieghere db008af501
[llvm] Repair the modules build with C++17
I'm honestly not sure if this is a legitimate issue or not, but after
switching from C++14 to C++17, the modules build started confusing
arrays and initializer lists. Work around the issue by being explicit.
2022-08-08 15:04:46 -07:00
Michael Kruse 8c0979c8f7 [flang][test] Don't require .exe suffix.
The suffix is only added then the path the (lld-)link.exe is fully
resolved. Otherwise it may stay "link" or "lld-link".

On non-Windows platforms, lld-link also exists as a symbolic link to
lld, such that the full the path to lld-link might also be resolved
without .exe suffix in this case.

Note that CLANG_DEFAULT_LINKER could be set to other linkers such as
mold, in which case the test may still fail. This also applies to the
non-Windows tests that require "ld" in the linker name.

Fixes issue #56955
2022-08-08 16:55:30 -05:00
Craig Topper eec05bfeaf [RISCV] Add {{$}} to some CHECK lines in MC tests.
This adds {{$}} to most of the CHECK lines for errors about what
extension an instruction requires. This ensures we check all the
extensions when there is a list.

Differential Revision: https://reviews.llvm.org/D131436
2022-08-08 14:38:11 -07:00
Alex Brachet dbd04b853b [ELF] Support --package-metadata
This was recently introduced in GNU linkers and it makes sense for
ld.lld to have the same support. This implementation omits checking if
the input string is valid json to reduce size bloat.

Differential Revision: https://reviews.llvm.org/D131439
2022-08-08 21:31:58 +00:00
Xing Xue cc8edbea7a [libunwind][AIX] Save/restore errno before/after system calls dlopen/dlsym/dlclose
Summary:
libunwind on AIX calls dlopen()/dlsym()/dlclose() to dynamically load libc++abi and get the personality for state table EH when it is running against the legacy xlcang++ compiler genereated applications. dlopen() sets errno to 0 when it is successful, which clobbers the value in errno from the user code. This seems to be an AIX bug that it should not set errno to 0 according to POSIX. We will open a bug report to AIX but in the mean time there won't be time line when AIX will have a fix and even AIX does fix it, it won't help earlier AIX releases in the field. This patch saves and restores errno before and after these calls so that user code can work as expected.

Reviewed by: compnerd, libunwind

Differential Revision: https://reviews.llvm.org/D131292
2022-08-08 17:21:30 -04:00
Thomas Raoux 8d7c1c55a4 [mlir][vector] Fix warp distribution test
The test was using a missing prefix. Add the prefix and fix the naming.

Found by @csigg

Reviewed By: csigg

Differential Revision: https://reviews.llvm.org/D131428
2022-08-08 20:57:44 +00:00
Roland Froese d6bd3d373e [DAGCombiner] Add some BE store forwarding tests; NFC
Add tests before D130115. NFC.
2022-08-08 16:33:01 -04:00
Aart Bik 6b3bc7cd3c [mlir][sparse] improve sparse attribute documentation
Moved some parts from comments (not user facing) to the actual description
(user facing). Rephrased a bit as well.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D131418
2022-08-08 13:21:24 -07:00
Martin Storsjö 0c52ab3968 [MC] [Win64EH] Fix the calculation of the end of epilogs
Exclude the terminating end opcode from the epilog - it doesn't
correspond to an actual instruction that is included in the epilog
itself (within the .seh_startepilogue/.seh_endepilogue range).

In most (all?) cases, an epilog is followed by a matching terminating
instruction though (a ret or a branch to a tail call), but it's not
strictly within the .seh_startepilogue/.seh_endepilogue range.

This fixes a number of failed asserts in cases where the codegen
has incorrectly reoredered SEH opcodes so they don't match up
exactly with their instructions.

However this still just avoids failing the assertion; the root cause
of generating unexpected epilogs is still present (and fixing that is
a less obvious issue).

Differential Revision: https://reviews.llvm.org/D131393
2022-08-08 23:03:17 +03:00
Arthur Eubanks f181dff084 Add -misc-const-correctness to .clang-tidy
I keep getting suggestions from clangd to add 'const' to a bunch of local variables, which is not LLVM's style. This suppresses those.

Reviewed By: kadircet, aaron.ballman

Differential Revision: https://reviews.llvm.org/D131414
2022-08-08 13:00:52 -07:00
Walter Erquinigo ddd576ab87 [lldb] Prevent race condition when fetching /proc/cpuinfo
@clayborg found a potential race condition when setting a static
variable. The fix seems simply to use call_once.

All relevant tests pass.

Differential Revision: https://reviews.llvm.org/D131081
2022-08-08 12:31:42 -07:00
Ben Langmuir 33af4b22f8 [clang][deps] Stop sharing FileManager across module builds in scanner
Sharing the FileManager across implicit module builds currently leaks
paths looked up in an importer into the built module itself. This can
cause non-deterministic results across scans. It is especially bad for
modules since the path can be saved into the pcm file itself, leading to
stateful behaviour if the cache is shared.

This should not impact the number of real filesystem accesses in the
scanner, since it is already caching in the
DependencyScanningWorkerFilesystem.

Note: this change does not affect whether or not the FileManager is
shared across TUs in the scanner, which is a separate issue.

Differential Revision: https://reviews.llvm.org/D131412
2022-08-08 12:13:54 -07:00
Joseph Huber b71b22e48d [LinkerWrapper] Use C++17 structured bindings
Summary:
This patch updates the linker wrapper to use C++17 structured bindings
now that they are availible.
2022-08-08 15:07:03 -04:00
Fangrui Song a12c076f60 [compiler-rt] Use -std=c++17 for standalone build
Follow-up to D130689.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D131382
2022-08-08 12:04:42 -07:00
Fangrui Song cdeb50c321 [lldb] Remove include/lldb/lldb-private.h
The header from 62e0681afb does something with
LLVM_FALLTHROUGH. Now that llvm-project has switched to C++17 and
LLVM_FALLTHROUGH uses have been migrated to [[fallthrough]], the header is
unneeded.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D131422
2022-08-08 12:03:53 -07:00
Daniel Thornburgh 0d6cf1e8b5 [Symbolizer] Fix symbolizer-filter-markup-pc.test on Windows 2022-08-08 11:40:12 -07:00
Jeff Bailey 7889c41938 [libc] Website fixes (sidebar and mobile)
Add "using" and "status" sections to the sidebar to make getting these
easier.

Fixed mobile formatting not overflow left and right.

Tested:
Chrome on Desktop, using mobile restrictions in devtools.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D131369
2022-08-08 18:38:01 +00:00
Fangrui Song 59d2495fe2 [lldb] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 11:31:49 -07:00
Lei Zhang d9728a9baa [mlir][spirv] Unify mixed scalar/vector primitive type resources
This further relaxes the requirement to allow aliased resources
to have different primitive types and some are scalars while the
other are vectors.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D131207
2022-08-08 14:30:14 -04:00
Fangrui Song de9d80c1c5 [llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
With C++17 there is no Clang pedantic warning or MSVC C5051.
2022-08-08 11:24:15 -07:00
Nico Weber 09db7f5331 [lld/mac] Remove unusual "Fallthrough" comments
Normally we'd use LLVM_FALLTHROUGH, or now, [[fallthrough]].
But for case labels followed directly by other case labels, we
use neither.

No behavior change.
2022-08-08 14:18:44 -04:00
Nico Weber e4161e88f3 [gn build] port 59bb9e37c6 2022-08-08 14:16:30 -04:00
Ruobing Han f756f06cc4 [SimpleLoopUnswitch] Skip non-trivial unswitching of cold loops
With profile data, non-trivial LoopUnswitch will only apply on non-cold loops, as unswitching cold loops may not gain much benefit but significantly increase the code size.

Reviewed By: aeubanks, asbirlea

Differential Revision: https://reviews.llvm.org/D129599
2022-08-08 18:12:04 +00:00
Filipp Zhinkin 6c52f82d77 [X86][ARM] Add tests for bitwise logic trees of shifts; NFC
Baseline tests for D131189.
2022-08-08 21:09:14 +03:00
Daniel Thornburgh bf48b128b0 [Symbolizer] Implement pc element in symbolizing filter.
Implements the pc element for the symbolizing filter, including it's
"ra" and "pc" modes. Return addresses ("ra") are adjusted by
decrementing one. By default, {{{pc}}} elements are assumed to point to
precise code ("pc") locations. Backtrace elements will adopt the
opposite convention.

Along the way, some minor refactors of value printing and colorization.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D131115
2022-08-08 11:08:48 -07:00
Vang Thao 257251247a [SROA] Try harder to find a vector promotion viable type when rewriting
We are seeing significant performance loss when an alloca fails to get promoted
to register. I have observed that this is due to the common type found when
attempting to rewrite partition users being unviable for promotion. While if we
would have continue looking for a type, we would have found a subtype in the
original allocated type that would have enabled promotion. Thus first check if
the initial common type found is promotion viable and if not then continue
looking instead of stopping with the initial common type found.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D128073
2022-08-08 11:04:01 -07:00
Alex Langford 5fff4b75ca [lldb] Pass TestExternCSymbols.py on Windows
This test previously was expected to fail on windows. As of my previous
patch (1d2a62afaf) this test now passes on
windows consistently. This patch adjusts the expectations of the test
accordingly.
2022-08-08 11:01:16 -07:00
Slava Zakharin be8bacfd93 [flang] Replace more pgmath with libm.
With this change all supported pgmath functions for non-complex
data types are replaced with either libm calls or MLIR operations,
except for MOD and some flavors of POW, which are going to be addressed
by other commits.

At the current stage a few math intrinsics are lowered into libm calls
always. When appropriate MLIR operation are available, the table can be
updated to generate them.
2022-08-08 10:53:08 -07:00
Simon Pilgrim 1b349bdaaa [X86] Add test coverage for ctpop/parity with freeze
These are safe to fold from freeze(unaryop(x)) -> unaryop(freeze(x))
2022-08-08 18:25:01 +01:00
Peiming Liu de907138ec [mlir][sparse] Add new concatente operator to sparse tensor
See https://www.tensorflow.org/xla/operation_semantics#concatenate for the operator semantics

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D131111
2022-08-08 17:23:43 +00:00
Fangrui Song aa17357319 [llvm-ranlib] Support more than one input file
BSD and GNU ranlib support more than one input file. Implement this.

While here, update OVERVIEW (Ranlib => ranlib) since "ranlib" is more common.
Remove "speed access" since the index has nothing to do with performance: it is
mandatory for GNU ld and gold but ignored for ld.lld (D119074).

Close https://github.com/llvm/llvm-project/issues/54565

Differential Revision: https://reviews.llvm.org/D131375
2022-08-08 10:15:39 -07:00
Benjamin Kramer 2cbfa93f42 [mlir][math] Fix pythong bindings after 00f7096d31 2022-08-08 19:14:44 +02:00
Adrian Vogelsgesang 706b3951b3 [libc++] Implement `operator==` for `filesystem::space_info`
Implements part of P1614R2 "The Mothership has Landed"

Differential Revision: https://reviews.llvm.org/D130861
2022-08-08 10:05:47 -07:00
Mehdi Amini 95b3ff08f5 [mlir][doc] Cross link the dependent dialect section to the tablegen field definition 2022-08-08 16:57:33 +00:00
Simon Pilgrim 1f30ebc898 [llvm-tblgen] Fix copy+paste typo in CodeGenSchedModels::collectLoadStoreQueueInfo
Confirmed with @andreadb - repeated PM.LoadQueue->getLoc() should have been PM.StoreQueue->getLoc()

Found by coverity
2022-08-08 17:51:45 +01:00
Rajas Vanjape 333f98b4b6 [mlir][sparse][nfc] Use tensor.generate in sparse integration tests
Currently, dense tensors are initialized in Sparse Integration tests using
"buffer.tensor_alloc and scf.for" . This makes code harder to read and maintain.
This diff uses tensor.generate instead to initialize dense tensors.

Testing: Ran integration tests after building with -DLLVM_USE_SANITIZER=Address flag.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D131404
2022-08-08 16:44:45 +00:00
Tarun Prabhu c1f65df19c [flang] Add an explicit condition for the BITS=0 case in the MASKL and MASKR intrinsics.
This fixes issue #56706.

Differential Revision: https://reviews.llvm.org/D130590
2022-08-08 10:33:49 -06:00
Craig Topper e2bfbed2bb [RISCV] Add ReadFStoreData as a SchedRead.
The floating point stores use a different register class, it
probably makes sense to have a different SchedRead.

Reviewed By: monkchiang

Differential Revision: https://reviews.llvm.org/D131379
2022-08-08 09:33:19 -07:00
Simon Pilgrim 6f2bee667a [DAG] canCreateUndefOrPoison - add freeze(bswap(x)) -> bswap(freeze(x)) and freeze(bitreverse(x)) -> bitreverse(freeze(x)) support
Both are guaranteed not to create undef/poison
2022-08-08 17:27:17 +01:00
lorenzo chelini fb33b406df [MLIR][Linalg] Remove `TiledLoops` from tiling options
TiledLoopOp has been removed in: 1a829d2d06

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D131383
2022-08-08 18:24:58 +02:00
Benjamin Kramer 2960299986 [ADT] Retire llvm::apply_tuple in favor of C++17 std::apply 2022-08-08 18:23:38 +02:00
Lei Zhang 4bd25d0b81 [mlir][spirv] Refresh base definitions to latest spec (v1.6)
This commit updates all SPIR-V enum definitions to match the latest
specification (v1.6 revision 2). Along the way, fixed some issues
in `gen_spirv_dialect.py` and added a new script for refreshing
all op definitions for such cases.

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D131293
2022-08-08 12:22:32 -04:00
Fangrui Song 3f18f7c007 [clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
With C++17 there is no Clang pedantic warning or MSVC C5051.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D131346
2022-08-08 09:12:46 -07:00
Jon Chesterfield 521a5c11ac Rename OPENMP_HAVE_STD_CPP14_FLAG to match c++17 2022-08-08 17:07:45 +01:00
Ron Lieberman af28b27d31 Move openmp from -std=c++14 to -std=c++17 2022-08-08 16:04:57 +00:00
Slava Gurevich 06ff46d2d7 [LLDB][NFC] Fix suspicious bitwise expression in PrintBTEntry()
Current application of bitwise-OR to a binary mask always results in True, which seems
inconsistent with the intent of the statement, a likely typo.

Differential Revision: https://reviews.llvm.org/D131312
2022-08-08 09:04:22 -07:00
Nico Weber aa1abd7684 [lld/win] Use C++17 structured bindings
No behavior change.

Differential Revision: https://reviews.llvm.org/D131403
2022-08-08 11:51:38 -04:00
Nico Weber 7c26641d9d [lld/win] Use C++17 nested namespace syntax in most places
Like D131354, but for COFF.

No behavior change.

Differential Revision: https://reviews.llvm.org/D131405
2022-08-08 11:48:12 -04:00
Simon Pilgrim e4b2c52420 [DAG] canCreateUndefOrPoison - add freeze(sext(x)) -> sext(freeze(x)) and freeze(zext(x)) -> zext(freeze(x)) support
Both are guaranteed not to create undef/poison
2022-08-08 16:43:40 +01:00