LLVM/project 26e1df2llvm/unittests/Support raw_socket_stream_test.cpp

[llvm][SupportTests] Fix a race condition in temporary socket construction (#190404)

createUniquePath doesn't make an exclusive lock on the filename until
the socket is created, and thus the removal step in these tests was
creating a TOCTOU race. Instead, arrange for the file to be cleaned up
*after* we're done with it.

rdar://142847430
DeltaFile
+5-12llvm/unittests/Support/raw_socket_stream_test.cpp
+5-121 files

LLVM/project 7111a81clang/lib/Driver Driver.cpp, clang/test/Driver hip-toolchain-no-rdc.hip

clang: Stop assuming one toolchain covers all GPUArchs

Previously there was a vector of toolchains, but a number of
places assumed there was only a single toolchain. I'm also not
sure how you were supposed to identify which toolchain to use from
this array. Make this parallel to the stored GpuArches. For
the fat binary cases, we still need to pick a toolchain so that
still just picks the first one; it probably should use
the most neutral available triple.

This also doesn't feel like a complete fix. The various Actions
all contain a reference to an OffloadingToolChain, which seems
to frequently be missing and isn't set at construction time.
DeltaFile
+27-23clang/lib/Driver/Driver.cpp
+1-1clang/test/Driver/hip-toolchain-no-rdc.hip
+28-242 files

LLVM/project 36e781cclang/lib/Driver Driver.cpp

clang: Remove dead null toolchain check (#190402)
DeltaFile
+0-2clang/lib/Driver/Driver.cpp
+0-21 files

LLVM/project 64987a9clang-tools-extra/clang-doc Representation.h

[clang-doc] Enforce arena allocated types are trivially destructible (#190049)

We can enforce at compile-time that the types we want to place in the
arenas are always safe to allocate there.
DeltaFile
+26-0clang-tools-extra/clang-doc/Representation.h
+26-01 files

LLVM/project c7824acllvm/lib/CodeGen/SelectionDAG TargetLowering.cpp

[TargetLowering] Remove stale comment. NFC (#190275)

Missed removing in #188653
DeltaFile
+1-2llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+1-21 files

LLVM/project 6f68e58offload/plugins-nextgen/amdgpu/src rtl.cpp

offload: Parse triple using to identify amdgcn-amd-amdhsa (#190319)

Avoid hardcoding the exact triple.
DeltaFile
+15-4offload/plugins-nextgen/amdgpu/src/rtl.cpp
+15-41 files

LLVM/project 77e32a7flang/lib/Semantics check-cuda.cpp, flang/test/Semantics cuf09.cuf

[flang][cuda] Avoid false semantic error on unified array component (#190389)
DeltaFile
+30-0flang/lib/Semantics/check-cuda.cpp
+21-3flang/test/Semantics/cuf09.cuf
+51-32 files

LLVM/project 1cc0aacclang-tools-extra/clang-doc Representation.cpp Representation.h, clang-tools-extra/clang-doc/tool ClangDocMain.cpp

[clang-doc] Merge data into persistent memory

We have a need for persistent memory for the final info. Since each
group processes a single USR at a time, every USR is only ever processed by
a single thread from the thread pool. This means that we can keep per
thread persistent storage for all the info. There is significant
duplicated data between all the serialized records, so we can just merge
the final/unique items into the persistent arena, and clear out the
scratch/transient arena as we process each record in the bitcode.

The patch adds some APIs to help with managing the data, merging, and
allocation of data in the correct arena. It also safely merges and deep
copies data from the transient arenas into persistent storage that is
never reset until the program completes.

This patch reduces memory by another % over the previous patches,
bringing the total savings over the baseline to 57%. Runtime performance
and benchmarks stay mostly flat with modest improvements.


    [31 lines not shown]
DeltaFile
+134-10clang-tools-extra/clang-doc/Representation.cpp
+25-25clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
+7-0clang-tools-extra/clang-doc/Representation.h
+166-353 files

LLVM/project 479a4ccclang-tools-extra/clang-doc BitcodeReader.cpp Serialize.cpp, clang-tools-extra/unittests/clang-doc SerializeTest.cpp MergeTest.cpp

[clang-doc] Move Info types into arenas

Info types used to own significant chunks of data. As we move these into
local arenas, these types must be trivially destructible, to avoid
leaking resources when the arena is reset. Unfortunaly, there isn't a
good way to transition all the data types one at a time, since most of
them are tied together in some way. Further, as they're now allocated in
the arenas, they often cannot be treated the same way, and even the
aliases and interfaces put in pLace to simplify the transition cannot
cover the full range of changes required.

We also use some SFINAE tricks to avoid adding boilerplate for helper
APIs, we'd otherwise ahve to support

Though it introduces some additional churn, we also try to keep tests
from using arena allocation as much as possible, since this is not
required to test the implementation of the library. As much of the test
code needed to be rewritten anyway, we take the opportunity to
transition now.

    [41 lines not shown]
DeltaFile
+419-187clang-tools-extra/clang-doc/BitcodeReader.cpp
+246-189clang-tools-extra/unittests/clang-doc/SerializeTest.cpp
+196-129clang-tools-extra/unittests/clang-doc/MergeTest.cpp
+176-80clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
+137-75clang-tools-extra/clang-doc/Serialize.cpp
+71-41clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
+1,245-70114 files not shown
+1,649-94320 files

LLVM/project 4e7cddfclang-tools-extra/clang-doc Generators.h MDMustacheGenerator.cpp, clang-tools-extra/clang-doc/benchmarks ClangDocBenchmark.cpp

[clang-doc] Move non-arena allocated types off the OwnedPtr alias

Some types should not be using this alias, which was over applied to
APIs that wont participate in arena style allocation. This patch
restores them to their correct spelling.
DeltaFile
+7-7clang-tools-extra/clang-doc/Generators.h
+4-4clang-tools-extra/clang-doc/MDMustacheGenerator.cpp
+4-4clang-tools-extra/clang-doc/ClangDoc.cpp
+3-3clang-tools-extra/clang-doc/HTMLGenerator.cpp
+2-2clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp
+1-1clang-tools-extra/clang-doc/Generators.cpp
+21-211 files not shown
+22-227 files

LLVM/project c5271efclang-tools-extra/clang-doc Representation.h

[clang-doc] Enforce arena allocated types are trivially destructible

We can enforce at compile-time that the types we want to place in the
arenas are always safe to allocate there.
DeltaFile
+26-0clang-tools-extra/clang-doc/Representation.h
+26-01 files

LLVM/project ddf6eebclang-tools-extra/clang-doc BitcodeReader.cpp BitcodeReader.h

[clang-doc] Simplify parsing and reading bitcode blocks

Much of the logic int he readBlock implementation is boilerplate, and is
repeated for each implementation/specialization. This will become much
worse as we introduce new custom block reading logic as we migrate
towards arena allocation. In preparation for that, we're introducing the
change in logic now, which should make later refactoring much more
straightforward.
DeltaFile
+103-120clang-tools-extra/clang-doc/BitcodeReader.cpp
+5-0clang-tools-extra/clang-doc/BitcodeReader.h
+1-1clang-tools-extra/clang-doc/Representation.h
+109-1213 files

LLVM/project c1cfa88clang-tools-extra/clang-doc Representation.cpp

[clang-doc] Consolidate merging logic

As we migrate things in the arena, this logic may get more complex.
Factoring it out now, will give clear extension points to make this
easier to manage.
DeltaFile
+10-9clang-tools-extra/clang-doc/Representation.cpp
+10-91 files

LLVM/project 7805b6cclang-tools-extra/clang-doc BitcodeReader.cpp Serialize.cpp, clang-tools-extra/unittests/clang-doc MDGeneratorTest.cpp BitcodeTest.cpp

[clang-doc] Make CommentInfo arena allocated

This patch move the CommentInfo type into the arena. It updates block
handling to collect child info types and serialize the array in one
shot.

We also clean up the test code to avoid using the arenas in the tests.
This has the upside of making the test more hermetic, and avoids churn
in the related code as the allocation API interfaces evolve.

Performance and memory usage regress slightly. This is somewhat expected
as we do not yet aggressively release short term memory during merge
operations. Future patches will reclaim this overhead.

| Metric | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |
| Time | 920.5s | 998.5s | 1010.5s | +9.8% | +1.2% |
| Memory | 86.0G | 43.8G | 47.8G | -44.4% | +9.2% |


    [26 lines not shown]
DeltaFile
+124-94clang-tools-extra/unittests/clang-doc/MDGeneratorTest.cpp
+70-111clang-tools-extra/unittests/clang-doc/BitcodeTest.cpp
+66-103clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
+15-30clang-tools-extra/unittests/clang-doc/MergeTest.cpp
+17-9clang-tools-extra/clang-doc/BitcodeReader.cpp
+15-5clang-tools-extra/clang-doc/Serialize.cpp
+307-3526 files not shown
+345-37012 files

LLVM/project 9f29f54clang-tools-extra/clang-doc Representation.cpp Representation.h

[clang-doc] Support deep copy between arenas for merging

Upcoming changes to the merge step will necessitate that we clear the
transient arenas and merge new items into the persistent arena. However
there are some challenges with that, as the existing types typically
don't want to be copied. We introduce some new APIs to simplify that
task and ensure we don't accidentally leak memory.

On the performance front, we reclaim about 2% of the overhead, bringing
the cumulative overhead from the series of patches down to about 7% over
the baseline.

| Metric | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |
| Time | 920.5s | 1014.5s | 991.5s | +7.7% | -2.3% |
| Memory | 86.0G | 39.9G | 40.0G | -53.4% | +0.3% |

| Benchmark | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |

    [28 lines not shown]
DeltaFile
+140-21clang-tools-extra/clang-doc/Representation.cpp
+30-0clang-tools-extra/clang-doc/Representation.h
+170-212 files

LLVM/project 9471fabclang/lib/CodeGen CGCall.cpp, clang/test/CodeGen struct-passing.c

[clang] Fix issues with const/pure on varargs function. (#190252)

There are two related issues here. On the declaration/definition side,
we need to make sure the markings are conservative. Then on the caller
side, we need to make sure we don't access parameters that don't exist.

Fixes #187535.
DeltaFile
+34-5clang/test/CodeGen/struct-passing.c
+13-1clang/lib/CodeGen/CGCall.cpp
+47-62 files

LLVM/project c061f33llvm/test/CodeGen/ARM cmp-to-cmn.ll

[ARM] Add new test that will demonstrate the cmn node in the ARM backend (NFC) (#179282)

No code changes yet, but this is going to change once the cmn node lands
in the backend.
DeltaFile
+478-0llvm/test/CodeGen/ARM/cmp-to-cmn.ll
+478-01 files

LLVM/project 88dabccclang/lib/Driver Driver.cpp

clang: Remove dead null toolchain check
DeltaFile
+0-2clang/lib/Driver/Driver.cpp
+0-21 files

LLVM/project 0732841lldb/packages/Python/lldbsuite/test/make Makefile.rules

Revert "[lldb/test] Codesign executables built with custom Makefile rules" (#190398)

Reverts llvm/llvm-project#189902 because this seems to cause hangs.
DeltaFile
+0-7lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+0-71 files

LLVM/project 1bbcc5elldb/source/Plugins/Process/MacOSX-Kernel CommunicationKDP.cpp

[lldb] Fix the macOS builld after address size was removed from Stream (#190399)

This fixes the macOS build after #190375.
DeltaFile
+15-30lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+15-301 files

LLVM/project c34c044libc/src/stdio/printf_core float_dec_converter.h float_dec_converter_limited.h, libc/test/shared shared_rpc_test.cpp shared_str_to_num_test.cpp

[libc] Add str_to_* and rpc_* shared tests. (#190351)

Also fix several things for LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE to
make them build.
DeltaFile
+69-0libc/test/shared/shared_rpc_test.cpp
+56-0libc/test/shared/shared_str_to_num_test.cpp
+26-0libc/test/shared/CMakeLists.txt
+18-3libc/src/stdio/printf_core/float_dec_converter.h
+9-2libc/src/stdio/printf_core/float_dec_converter_limited.h
+10-1libc/src/stdio/printf_core/float_hex_converter.h
+188-66 files not shown
+215-1012 files

LLVM/project 1deab59clang-tools-extra/clang-doc Representation.cpp Representation.h, clang-tools-extra/unittests/clang-doc MergeTest.cpp ClangDocTest.cpp

[clang-doc] Migrate Namespaces to arena allocation (#190048)

This patch allocates the NamespaceInfo types in the local arenas, and
adapts the merging logic for the new list type and its children.
Memory use and performance improve slightly. Micro-benchmarks show a
regression in merge operations due to the more complex list operations.

 ## Build Clang-Doc Documentation
| Metric | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |
| Time | 920.5s | 1009.2s | 1002.4s | +8.9% | -0.7% |
| Memory | 86.0G | 43.2G | 43.9G | -49.0% | +1.6% |

 ## Microbenchmarks (Filtered for >1% Delta)
| Benchmark | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |
| BM_BitcodeReader_Scale/10 | 67.9us | 69.7us | 69.3us | +1.9% | -0.7% |
| BM_BitcodeReader_Scale/10000 | 70.5ms | 22.3ms | 24.8ms | -64.8% |
+11.4% |

    [29 lines not shown]
DeltaFile
+18-1clang-tools-extra/clang-doc/Representation.cpp
+8-8clang-tools-extra/unittests/clang-doc/MergeTest.cpp
+8-2clang-tools-extra/clang-doc/Representation.h
+7-3clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
+6-3clang-tools-extra/clang-doc/JSONGenerator.cpp
+4-4clang-tools-extra/unittests/clang-doc/SerializeTest.cpp
+51-217 files not shown
+75-3713 files

LLVM/project 1003a8dlldb/packages/Python/lldbsuite/test/make Makefile.rules

Revert "[lldb/test] Codesign executables built with custom Makefile rules (#1…"

This reverts commit 478a6abc0ceea812c9486d13fda4afbe876c670f.
DeltaFile
+0-7lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+0-71 files

LLVM/project b4302daclang-tools-extra/clang-doc Representation.cpp Representation.h

[clang-doc] Support deep copy between arenas for merging

Upcoming changes to the merge step will necessitate that we clear the
transient arenas and merge new items into the persistent arena. However
there are some challenges with that, as the existing types typically
don't want to be copied. We introduce some new APIs to simplify that
task and ensure we don't accidentally leak memory.

On the performance front, we reclaim about 2% of the overhead, bringing
the cumulative overhead from the series of patches down to about 7% over
the baseline.

| Metric | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |
| Time | 920.5s | 1014.5s | 991.5s | +7.7% | -2.3% |
| Memory | 86.0G | 39.9G | 40.0G | -53.4% | +0.3% |

| Benchmark | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |

    [28 lines not shown]
DeltaFile
+140-21clang-tools-extra/clang-doc/Representation.cpp
+30-0clang-tools-extra/clang-doc/Representation.h
+170-212 files

LLVM/project 0604f66clang-tools-extra/clang-doc Representation.cpp Representation.h, clang-tools-extra/clang-doc/tool ClangDocMain.cpp

[clang-doc] Merge data into persistent memory

We have a need for persistent memory for the final info. Since each
group processes a single USR at a time, every USR is only ever processed by
a single thread from the thread pool. This means that we can keep per
thread persistent storage for all the info. There is significant
duplicated data between all the serialized records, so we can just merge
the final/unique items into the persistent arena, and clear out the
scratch/transient arena as we process each record in the bitcode.

The patch adds some APIs to help with managing the data, merging, and
allocation of data in the correct arena. It also safely merges and deep
copies data from the transient arenas into persistent storage that is
never reset until the program completes.

This patch reduces memory by another % over the previous patches,
bringing the total savings over the baseline to 57%. Runtime performance
and benchmarks stay mostly flat with modest improvements.


    [31 lines not shown]
DeltaFile
+134-10clang-tools-extra/clang-doc/Representation.cpp
+25-25clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
+7-0clang-tools-extra/clang-doc/Representation.h
+166-353 files

LLVM/project 2a88b20clang-tools-extra/clang-doc BitcodeReader.cpp Serialize.cpp, clang-tools-extra/unittests/clang-doc SerializeTest.cpp MergeTest.cpp

[clang-doc] Move Info types into arenas

Info types used to own significant chunks of data. As we move these into
local arenas, these types must be trivially destructible, to avoid
leaking resources when the arena is reset. Unfortunaly, there isn't a
good way to transition all the data types one at a time, since most of
them are tied together in some way. Further, as they're now allocated in
the arenas, they often cannot be treated the same way, and even the
aliases and interfaces put in pLace to simplify the transition cannot
cover the full range of changes required.

We also use some SFINAE tricks to avoid adding boilerplate for helper
APIs, we'd otherwise ahve to support

Though it introduces some additional churn, we also try to keep tests
from using arena allocation as much as possible, since this is not
required to test the implementation of the library. As much of the test
code needed to be rewritten anyway, we take the opportunity to
transition now.

    [41 lines not shown]
DeltaFile
+419-187clang-tools-extra/clang-doc/BitcodeReader.cpp
+246-189clang-tools-extra/unittests/clang-doc/SerializeTest.cpp
+196-129clang-tools-extra/unittests/clang-doc/MergeTest.cpp
+176-80clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
+137-75clang-tools-extra/clang-doc/Serialize.cpp
+71-41clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
+1,245-70114 files not shown
+1,649-94320 files

LLVM/project 98ced6cbolt/include/bolt/Rewrite RewriteInstance.h, bolt/lib/Rewrite RewriteInstance.cpp

[BOLT] Template patchELFPHDRTable and rewriteNoteSections for ELF32 (#189715)

Template patchELFPHDRTable, rewriteNoteSections, markGnuRelroSections,
and discoverStorage to support both ELF32LE and ELF64LE binaries.
Previously these functions were hardcoded for ELF64LE, causing crashes
when processing 32-bit ELF binaries.

The RewriteInstance constructor now accepts ELF32LE objects in addition
to ELF64LE. The ELF_FUNCTION macro is reused (and moved earlier in the
header) to dispatch to the correct template instantiation.

These changes are preparation for adding support to hexagon architecture
in Bolt.
DeltaFile
+64-53bolt/lib/Rewrite/RewriteInstance.cpp
+20-18bolt/include/bolt/Rewrite/RewriteInstance.h
+12-0bolt/test/elf32-basic.test
+12-0bolt/test/Inputs/elf32-basic.yaml
+108-714 files

LLVM/project 8a8434fllvm/include/llvm/Frontend/OpenMP OMPKinds.def, llvm/lib/Transforms/IPO AttributorAttributes.cpp

[OpenMP] Move alloc / free shared from TLI to alloc tags (#190365)

Summary:
Allocation kinds were added after these were introduced. We only needed
the TLI to identify these in the attributor so we can now just use
attributes. Update the usage in OpenMP and drop the TLI interface.

Fixes: https://github.com/llvm/llvm-project/issues/190072
DeltaFile
+18-20llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+19-17llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
+13-15llvm/test/Transforms/OpenMP/replace_globalization.ll
+15-13llvm/test/Transforms/OpenMP/remove_globalization.ll
+12-12llvm/test/Transforms/OpenMP/spmdization.ll
+13-7llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
+90-849 files not shown
+116-13515 files

LLVM/project 3eb289dllvm/test/CodeGen/AMDGPU integer-mad-patterns.ll fcanonicalize.bf16.ll

[AMDGPU] Specialize gfx1250 codegen tests form fake and real t16. NFC.

This is preparation of turning on real true16, so we can easily
apply it or revert.
DeltaFile
+1,318-117llvm/test/CodeGen/AMDGPU/integer-mad-patterns.ll
+835-387llvm/test/CodeGen/AMDGPU/fcanonicalize.bf16.ll
+610-305llvm/test/CodeGen/AMDGPU/atomics-system-scope.ll
+505-259llvm/test/CodeGen/AMDGPU/insert_vector_elt.v2bf16.ll
+460-214llvm/test/CodeGen/AMDGPU/load-constant-i1.ll
+384-170llvm/test/CodeGen/AMDGPU/flat-saddr-load.ll
+4,112-1,45227 files not shown
+6,175-2,28333 files

LLVM/project 4a72138llvm/include/llvm/Analysis MemoryDependenceAnalysis.h, llvm/lib/Analysis MemoryDependenceAnalysis.cpp

[Analysis] No block map in MemoryDependenceAnalysis (#190367)

Avoid expensive hash map of block to value by using a vector. To avoid
allocating and clearing the entire vector per query, cache the
allocation and use an epoch to identify stale values from previous
queries.
DeltaFile
+65-53llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+8-1llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
+73-542 files