[lldb][test] Remove home dir paths from core files used in tests (#201630)
Most of our core files contain paths to the source files that were used
to generate the core file. LLDB probes the existence of these source
files when it sees them in the core file, which on its own is not
problematic as that's usually quite cheap.
Unfortunately, the paths used in most core file tests are in the form of
/home/XYZ/test.c which does not exist on macOS. On some macOS machines
with network drives, these file accesses cause the kernel to perform
some kind of network request which is extremely slow.
The result is that the tests that inspect these core files run extremely
slow on macOS. For example, the TestNetBSDCore.py and TestLinuxCore.py
tests spend 95% of their runtime just probing these network paths. In
the case of TestLinuxCore.py, this causes the test to run for about 1
minute where only 3.7s are actual test logic.
This patch removes all /home/* paths from our core files and replaces
[2 lines not shown]
[lldb][test] Speed up TestGlobalModuleCache.py (#201561)
This patch reduces the runtime of TestGlobalModuleCache from 27s to
3-4s. There are three reasons for why the old test was slow:
* We did a sleep for 2s to ensure the source code file had a newer time
stamp and Make would rebuild the project. Instead, we now just age all
times on disk by 10s into the past to do the same thing. I'm not sure
how many other tests need to do this, but introducing a utility method
for forced in-place rebuild would be a good follow up.
* We additionally slept even for the first initial build, which wasn't
needed as there is nothing to rebuild.
* I removed some of the system includes in the source files which are
also not needed.
[lldb][test] Don't print LLDB version in every test (#201307)
An empty minimal API test currently runs for 330ms on my macOS system.
Of these 330ms, we spend 70ms (20%) just to print the lldb version
number at the start of each test.
This patch disables this behavior by default and instead prints the LLDB
version number once at the start of the LIT test suite. This saves about
2 minutes of CPU time in an LLDB test suite run.
[lldb] Add size checks for frequently allocated classes (#200939)
Given how frequently we allocate these classes (or classes containing
these classes) on the heap, we should only grow them intentionally.
See also bd1b3d47462acf4f854f593bdd77b3f127adea46
[lldb][test] Don't run simulator tests in parallel to stabilize them (#201870)
TestSimulatorPlatform is a notoriously flaky test on macOS. However, it
seems the test failures only happen when its exectuion overlaps with the
execution of TestAppleSimulatorOSType.py (which also interacts with the
simulator). Somehow one simulator test seems to break the other one, but
it's not exactly clear how they are inteferring with each other.
This patch ensures these two tests never run in parallel to avoid these
kind of issues. It creates a parallelism_group in lit for
apple-simulator and then puts both tests into that group.
TestAppleSimulatorOSType.py had to be moved to its own directory for
this. It shared its directory with a a lot of other unrelated tests and
the lit config applies to the whole directory.
[NFC][OMPT] Use `unique_id` entry point for tests (#202228)
The OMPT tests currently use an incrementing ID for the host_op_id.
However, this value is not incremented for `submit_emi` callbacks, and
uses a global integer that is incremented on callback invocation. This
can lead to race conditions when e.g., `target nowait` is used.
Hence, replace the global integer by the `unique_id` entry point,
properly yielding unique and thread-safe IDs.
Signed-off-by: Jan André Reuter <j.reuter at fz-juelich.de>
[StringMap] Add remove_if and use it for erase-while-iterating (#202272)
Add a `remove_if` member to StringMap (and to HashKeyMap, the base of
SampleProfileMap) as a replacement for the erase-while-iterating idiom,
and convert the two in-tree users: SymbolStringPool::clearDeadEntries
and llvm-profdata's filterFunctions (a template over StringMap and
SampleProfileMap).
Extracted from #202237 - making StringMap's mutation invalidates
iterators
so that we can remove the tombstone state.
Aided by Claude Opus 4.8
[SPIR-V] Lower 1xN/Nx1 matrix transpose to a copy (#201332)
Remove extra `OpVectorShuffle` while lowering trivial matrix transpose that is in fact basically a reshape
[flang][hlfir] Extend InlineHLFIRCopy to inline copy_out with copy-back
Rename `InlineHLFIRCopyIn` to `InlineHLFIRCopy` and extend it to inline
the paired `hlfir.copy_out` operation. The copy_out is inlined at its
original location, after the call, ensuring proper ordering of copy-back
and deallocation.
Only inlines when no copy-back is required (intent(in)); intent(inout/out)
pairs are left untransformed.
Based on https://github.com/llvm/llvm-project/pull/179096.
Co-Authored-By: Kazuaki Matsumura <kmatsumura at nvidia.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
[Flang][CMake] Add missing CMakePushCheckState for standalone build (#202285)
Needed for the functions cmake_push_check_state/cmake_pop_check_state.
The corresponding include command was missing for flang-standalone
builds.
[flang][hlfir] Extend InlineHLFIRCopy to inline copy_out with copy-back
Rename `InlineHLFIRCopyIn` to `InlineHLFIRCopy` and extend it to inline
the paired `hlfir.copy_out` operation. The copy_out is inlined at its
original location, after the call, ensuring proper ordering of copy-back
and deallocation.
Only inlines when no copy-back is required (intent(in)); intent(inout/out)
pairs are left untransformed.
Based on https://github.com/llvm/llvm-project/pull/179096.
Co-Authored-By: Kazuaki Matsumura <kmatsumura at nvidia.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
compiler-rt: Consolidate regex checks for amdgpu targets
In the future the triple naming scheme will change, and this
will help avoid repeating the same longer regex in all of these
places.
Co-Authored-By: Claude Sonnet 4.5 <noreply at anthropic.com>
[llvm-ar] fix inconsistent case sensitivity for path matching on Windows (#196541)
When deleting or extracting with -N, member counting uses case sensitive
member arguments while path matching uses normalized paths.
This causes an issue (on Windows): if you have files: foo.txt and
FOO.txt, you can only extract one of them when using -N 1, and using -N
2 results in error.
[LV] Use index type for base pointer computation in convertToStridedAccesses (#201070)
The base pointer for strided accesses was computed as:
```
offset = canonicalIV * stride
base_ptr = ptradd start, offset
```
On a 64-bit target, if the canonical IV type is i32, the GEP operation
for ptradd will first sign-extend the offset to i64. Once the offset
multiplication has already overflowed in i32, it will ultimately result
in an incorrect base address.
This patch fixes this by extending the canonical IV to the index type
before the offset multiplication.
Based on #199647
Fixes #199640