[llvm-profdata] Remove exitWithError and LSan leak workaround
With all subcommands propagating llvm::Error to main, exitWithError,
exitWithErrorCode, and the LSan leak suppression workaround are no
longer needed.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in loadInput and mergeWriterContexts
Propagate Error from loadInput and mergeWriterContexts in mergeInstrProfile,
supplementInstrProfile, and overlapInstrProfile. In mergeInstrProfile's
ThreadPool, catch errors from worker threads, stop scheduling new jobs,
and return the first encountered fatal error.
Ensure ~WriterContext() consumes any pending unhandled errors in
WriterContext::Errors upon destruction.
Not NFC as destructors are run on the stack and ThreadPool workers exit
earlier on error.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in merge subcommand
Change merge_main and its helpers to return Error and handle it
with reportError in main.
Not NFC as destructors are run on the stack.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in show subcommand (#228156)
Change show_main and its helpers to return Error and handle it
with reportError in main.
Not NFC as destructors are run on the stack.
Assisted-by: Gemini
[bazel] Remove unused `rules_android` dependency (#228174)
This dep appears to be unused. Though to note, it is still pulled in
through the `com_google_protobuf` dependency but there is no need to
explicitly pin it as a dependency to `llvm-project`
[Clang][Sema] Create Local Scope for Variable Template
A variable template should create its own LocalScope as its should be
opaque to other instantiation. This can happens when there is any
duplicate instantiation in the same lexical scope. The correct behavior
here is that these instantiation should not be chained together.
Assisted-by: Claude # Test ReleaseNote
[libc++][test] Remove some `XFAIL` for LLVM libc in multi-threaded tests (#228036)
Recently, LLVM libc fixed https://llvm.org/PR194029 in
https://llvm.org/PR226134, so more libc++ tests passes with LLVM libc
now.
Co-authored-by: Aiden Grossman <aidengrossman at google.com>
[clang-repl] Fix TargetMachine leak in CUDA device PTX generation (#228208)
The TargetMachine created per PTU in GeneratePTX was never freed, which
LSan now flags with the addition of DeviceOffloadTest. Make it a
unique_ptr declared before the PassManager, since the codegen passes
hold a reference to it.
[clang-repl] Fix TargetMachine leak in CUDA device PTX generation (#228208)
The TargetMachine created per PTU in GeneratePTX was never freed, which
LSan now flags with the addition of DeviceOffloadTest. Make it a
unique_ptr declared before the PassManager, since the codegen passes
hold a reference to it.
[clang-repl] Fix TargetMachine leak in CUDA device PTX generation (#228208)
The TargetMachine created per PTU in GeneratePTX was never freed, which
LSan now flags with the addition of DeviceOffloadTest. Make it a
unique_ptr declared before the PassManager, since the codegen passes
hold a reference to it.
[compiler-rt][libunwind] Check elf_aux_info return value (#228190)
elf_aux_info() returns an errno value (0 on success) rather than -1
with errno set. Check the result and treat a failure as "no features
reported" instead of silently ignoring the error.
In compiler-rt, hwcap had no initializer, so a failed call left it
uninitialized. The libunwind users already started from zero, so the
change there only makes the error handling explicit.
[InstCombine] Fix profile propagation in xor-and-or.ll (#228246)
c461d3cf5e8b9cd2e930d7a275ecdd485b6fcc29 previously attempted to fix
this, but was partially incorrect (propagation in
xor_logic_and_logic_or2_commuted picked up metadata from the wrong
select), and also partially incomplete. This patch fixes that by making
the conditions where we pull profile metadata simpler (now when the new
condition exactly matches a previous condition).
Build the pool stats config without the namespace lock
The spa_open_common() function built the full config with vdev stats
while it held the namespace lock. Every pool lookup in the system waits
on that lock, so polling stats on a pool with many vdevs slowed down
unrelated pool operations. The config is now built after the lock is
dropped. spa_config_generate() takes the config locks it needs. The
recovery load info is copied while the lock is still held.
A stats caller now holds the pool for as long as the build takes, which
can be hundreds of milliseconds on a pool with many vdevs. Export fails
with "pool is busy" when it sees such a hold, so running zpool iostat or
zpool status in a loop would break zpool export, zpool destroy and
zpool split. To avoid this, stats callers count their hold, and export
waits for that count to drop to zero before it sets spa_export_thread.
New stats callers wait while the pool is being exported, so the wait
always ends. The hold and its count are taken and dropped together
under the namespace lock. As before, export holds the namespace lock
from setting spa_export_thread until it checks the pool references.
[8 lines not shown]
[llvm-profdata] Remove exitWithError and LSan leak workaround
With all subcommands propagating llvm::Error to main, exitWithError,
exitWithErrorCode, and the LSan leak suppression workaround are no
longer needed.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in loadInput and mergeWriterContexts
Propagate Error from loadInput and mergeWriterContexts in mergeInstrProfile,
supplementInstrProfile, and overlapInstrProfile. In mergeInstrProfile's
ThreadPool, catch errors from worker threads, stop scheduling new jobs,
and return the first encountered fatal error.
Ensure ~WriterContext() consumes any pending unhandled errors in
WriterContext::Errors upon destruction.
Not NFC as destructors are run on the stack and ThreadPool workers exit
earlier on error.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in merge subcommand
Change merge_main and its helpers to return Error and handle it
with reportError in main.
Not NFC as destructors are run on the stack.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in show subcommand
Change show_main and its helpers to return Error and handle it
with reportError in main.
Not NFC as destructors are run on the stack.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in overlap subcommand (#228155)
Change overlap_main and its helpers to return Error and handle it
with reportError in main.
Not NFC as destructors are run on the stack.
Assisted-by: Gemini
[CIR] Add structured control flow for coroutine suspend points (#213191)
This PR adds 2 new ops for improving structured control flow in
coroutines, according to the redesign in this discussion:
https://github.com/llvm/llvm-project/pull/203802#discussion_r3464356343
One of the ops is `suspend_point`, which marks the point where a
coroutine should suspend and return control flow to the caller it's also
the point where the coroutine resumes from when it starts again. This op
must be inside the `cir.await` suspend region, and it works in pair with
the `CoroRetPoint` op, which marks the only exit point of the coroutine
so no matter how many awaits/suspend points exist in the body, they all
converge on the same exit path.
This will help the FlattenCFG pass know where to branch when flattening
the `cir.await` op. Previously we didn't have an exact point to branch
to when suspending a coroutine this gives us that.
---------
Co-authored-by: Erich Keane <ekeane at nvidia.com>
[CIR][OpenMP] Add support for combined target parallel directives (#207019)
This patch adds support for handling combined target and parallel
directives. It also refactors the code so that the emission functions
can be easily combined to handle both the single and combine cases for
emitting directives.
Assisted-by: Cursor / claude-opus-4.8-medium