FailedChanges

Summary

  1. [clangd] Remove dead variable. NFC (details)
  2. [PDB] Merge types in parallel when using ghashing (details)
  3. Revert "[PDB] Merge types in parallel when using ghashing" (details)
  4. [mlir][Linalg] Add pattern to tile and fuse Linalg operations on buffers. (details)
  5. [Msan] Add ptsname, ptsname_r interceptors (details)
  6. [AMDGPU] Reorganize VOP3P encoding (details)
  7. Re-land "[PDB] Merge types in parallel when using ghashing" (details)
  8. [flang] Semantic analysis for FINAL subroutines (details)
  9. [OpenMP][libomptarget] make omp_get_initial_device 5.1 compliant (details)
  10. [OpenMP][OMPT] Update OMPT tests for newly added GOMP interface patches (details)
  11. Handle unknown OSes in DarwinTargetInfo::getExnObjectAlignment (details)
  12. [PowerPC] Add outer product instructions for MMA (details)
  13. Patch IEEEFloat::isSignificandAllZeros and IEEEFloat::isSignificandAllOnes (bug 34579) (details)
  14. [OpenMP][libarcher] Allow all possible argument separators in TSAN_OPTIONS (details)
Commit 85fc5bf341395171e67490061f6fbc76b297b78d by sam.mccall
[clangd] Remove dead variable. NFC
The file was modifiedclang-tools-extra/clangd/URI.cpp
Commit 49b3459930655d879b2dc190ff8fe11c38a8be5f by rnk
[PDB] Merge types in parallel when using ghashing

This makes type merging much faster (-24% on chrome.dll) when multiple
threads are available, but it slightly increases the time to link (+10%)
when /threads:1 is passed. With only one more thread, the new type
merging is faster (-11%). The output PDB should be identical to what it
was before this change.

To give an idea, here is the /time output placed side by side:
                              BEFORE    | AFTER
  Input File Reading:           956 ms  |  968 ms
  Code Layout:                  258 ms  |  190 ms
  Commit Output File:             6 ms  |    7 ms
  PDB Emission (Cumulative):   6691 ms  | 4253 ms
    Add Objects:               4341 ms  | 2927 ms
      Type Merging:            2814 ms  | 1269 ms  -55%!
      Symbol Merging:          1509 ms  | 1645 ms
    Publics Stream Layout:      111 ms  |  112 ms
    TPI Stream Layout:          764 ms  |   26 ms  trivial
    Commit to Disk:            1322 ms  | 1036 ms  -300ms
----------------------------------------- --------
Total Link Time:               8416 ms    5882 ms  -30% overall

The main source of the additional overhead in the single-threaded case
is the need to iterate all .debug$T sections up front to check which
type records should go in the IPI stream. See fillIsItemIndexFromDebugT.
With changes to the .debug$H section, we could pre-calculate this info
and eliminate the need to do this walk up front. That should restore
single-threaded performance back to what it was before this change.

This change will cause LLD to be much more parallel than it used to, and
for users who do multiple links in parallel, it could regress
performance. However, when the user is only doing one link, it's a huge
improvement. In the future, we can use NT worker threads to avoid
oversaturating the machine with work, but for now, this is such an
improvement for the single-link use case that I think we should land
this as is.

Algorithm
----------

Before this change, we essentially used a
DenseMap<GloballyHashedType, TypeIndex> to check if a type has already
been seen, and if it hasn't been seen, insert it now and use the next
available type index for it in the destination type stream. DenseMap
does not support concurrent insertion, and even if it did, the linker
must be deterministic: it cannot produce different PDBs by using
different numbers of threads. The output type stream must be in the same
order regardless of the order of hash table insertions.

In order to create a hash table that supports concurrent insertion, the
table cells must be small enough that they can be updated atomically.
The algorithm I used for updating the table using linear probing is
described in this paper, "Concurrent Hash Tables: Fast and General(?)!":
https://dl.acm.org/doi/10.1145/3309206

The GHashCell in this change is essentially a pair of 32-bit integer
indices: <sourceIndex, typeIndex>. The sourceIndex is the index of the
TpiSource object, and it represents an input type stream. The typeIndex
is the index of the type in the stream. Together, we have something like
a ragged 2D array of ghashes, which can be looked up as:
  tpiSources[tpiSrcIndex]->ghashes[typeIndex]

By using these side tables, we can omit the key data from the hash
table, and keep the table cell small. There is a cost to this: resolving
hash table collisions requires many more loads than simply looking at
the key in the same cache line as the insertion position. However, most
supported platforms should have a 64-bit CAS operation to update the
cell atomically.

To make the result of concurrent insertion deterministic, the cell
payloads must have a priority function. Defining one is pretty
straightforward: compare the two 32-bit numbers as a combined 64-bit
number. This means that types coming from inputs earlier on the command
line have a higher priority and are more likely to appear earlier in the
final PDB type stream than types from an input appearing later on the
link line.

After table insertion, the non-empty cells in the table can be copied
out of the main table and sorted by priority to determine the ordering
of the final type index stream. At this point, item and type records
must be separated, either by sorting or by splitting into two arrays,
and I chose sorting. This is why the GHashCell must contain the isItem
bit.

Once the final PDB TPI stream ordering is known, we need to compute a
mapping from source type index to PDB type index. To avoid starting over
from scratch and looking up every type again by its ghash, we save the
insertion position of every hash table insertion during the first
insertion phase. Because the table does not support rehashing, the
insertion position is stable. Using the array of insertion positions
indexed by source type index, we can replace the source type indices in
the ghash table cells with the PDB type indices.

Once the table cells have been updated to contain PDB type indices, the
mapping for each type source can be computed in parallel. Simply iterate
the list of cell positions and replace them with the PDB type index,
since the insertion positions are no longer needed.

Once we have a source to destination type index mapping for every type
source, there are no more data dependencies. We know which type records
are "unique" (not duplicates), and what their final type indices will
be. We can do the remapping in parallel, and accumulate type sizes and
type hashes in parallel by type source.

Lastly, TPI stream layout must be done serially. Accumulate all the type
records, sizes, and hashes, and add them to the PDB.

Differential Revision: https://reviews.llvm.org/D87805
The file was modifiedlld/test/COFF/pdb-global-hashes.test
The file was modifiedlld/COFF/DebugTypes.cpp
The file was modifiedlld/COFF/TypeMerger.h
The file was modifiedllvm/lib/DebugInfo/CodeView/RecordName.cpp
The file was modifiedllvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
The file was modifiedlld/test/COFF/s_udt.s
The file was modifiedllvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedlld/test/COFF/pdb-type-server-missing.yaml
The file was modifiedlld/test/COFF/precomp-link.test
The file was modifiedllvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
The file was modifiedlld/COFF/DebugTypes.h
The file was modifiedllvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
The file was modifiedlld/test/COFF/pdb-procid-remapping.test
The file was modifiedlld/COFF/PDB.h
The file was modifiedlld/include/lld/Common/ErrorHandler.h
The file was modifiedlld/COFF/Driver.cpp
The file was modifiedlld/test/COFF/pdb-type-server-simple.test
Commit 8d250ac3cd48d0f17f9314685a85e77895c05351 by rnk
Revert "[PDB] Merge types in parallel when using ghashing"

This reverts commit 49b3459930655d879b2dc190ff8fe11c38a8be5f.
The file was modifiedllvm/lib/DebugInfo/CodeView/RecordName.cpp
The file was modifiedlld/test/COFF/pdb-type-server-simple.test
The file was modifiedlld/test/COFF/pdb-global-hashes.test
The file was modifiedlld/test/COFF/precomp-link.test
The file was modifiedlld/test/COFF/pdb-type-server-missing.yaml
The file was modifiedllvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
The file was modifiedlld/COFF/PDB.h
The file was modifiedlld/test/COFF/pdb-procid-remapping.test
The file was modifiedlld/COFF/Driver.cpp
The file was modifiedlld/COFF/DebugTypes.h
The file was modifiedllvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
The file was modifiedlld/include/lld/Common/ErrorHandler.h
The file was modifiedllvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
The file was modifiedllvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
The file was modifiedlld/COFF/DebugTypes.cpp
The file was modifiedlld/test/COFF/s_udt.s
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedlld/COFF/TypeMerger.h
Commit c694588fc52a8845174fee06ad0bcfa338e87816 by ravishankarm
[mlir][Linalg] Add pattern to tile and fuse Linalg operations on buffers.

The pattern is structured similar to other patterns like
LinalgTilingPattern. The fusion patterns takes options that allows you
to fuse with producers of multiple operands at once.
- The pattern fuses only at the level that is known to be legal, i.e
  if a reduction loop in the consumer is tiled, then fusion should
  happen "before" this loop. Some refactoring of the fusion code is
  needed to fuse only where it is legal.
- Since the fusion on buffers uses the LinalgDependenceGraph that is
  not mutable in place the fusion pattern keeps the original
  operations in the IR, but are tagged with a marker that can be later
  used to find the original operations.

This change also fixes an issue with tiling and
distribution/interchange where if the tile size of a loop were 0 it
wasnt account for in these.

Differential Revision: https://reviews.llvm.org/D88435
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td
The file was modifiedmlir/test/lib/Transforms/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/Linalg/Utils/Utils.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
The file was addedmlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/tools/mlir-opt/mlir-opt.cpp
The file was addedmlir/test/Dialect/Linalg/fusion-pattern.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
Commit 7475bd5411a3f62a7860db09a5bcf1fc147c43d6 by Vitaly Buka
[Msan] Add ptsname, ptsname_r interceptors

Reviewed By: eugenis, MaskRay

Differential Revision: https://reviews.llvm.org/D88547
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
The file was addedcompiler-rt/test/sanitizer_common/TestCases/Linux/ptsname.c
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
Commit 722d792499a4b60dd582f870cbdfb572897906b4 by Stanislav.Mekhanoshin
[AMDGPU] Reorganize VOP3P encoding

This changes width of encoding and opcode fields to match the
documentation.

Differential Revision: https://reviews.llvm.org/D88619
The file was modifiedllvm/lib/Target/AMDGPU/VOPInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/VOP3PInstructions.td
Commit 5519e4da83d1abc66620334692394749eceb0e50 by rnk
Re-land "[PDB] Merge types in parallel when using ghashing"

Stored Error objects have to be checked, even if they are success
values.

This reverts commit 8d250ac3cd48d0f17f9314685a85e77895c05351.
Relands commit 49b3459930655d879b2dc190ff8fe11c38a8be5f..

Original commit message:
-----------------------------------------

This makes type merging much faster (-24% on chrome.dll) when multiple
threads are available, but it slightly increases the time to link (+10%)
when /threads:1 is passed. With only one more thread, the new type
merging is faster (-11%). The output PDB should be identical to what it
was before this change.

To give an idea, here is the /time output placed side by side:
                              BEFORE    | AFTER
  Input File Reading:           956 ms  |  968 ms
  Code Layout:                  258 ms  |  190 ms
  Commit Output File:             6 ms  |    7 ms
  PDB Emission (Cumulative):   6691 ms  | 4253 ms
    Add Objects:               4341 ms  | 2927 ms
      Type Merging:            2814 ms  | 1269 ms  -55%!
      Symbol Merging:          1509 ms  | 1645 ms
    Publics Stream Layout:      111 ms  |  112 ms
    TPI Stream Layout:          764 ms  |   26 ms  trivial
    Commit to Disk:            1322 ms  | 1036 ms  -300ms
----------------------------------------- --------
Total Link Time:               8416 ms    5882 ms  -30% overall

The main source of the additional overhead in the single-threaded case
is the need to iterate all .debug$T sections up front to check which
type records should go in the IPI stream. See fillIsItemIndexFromDebugT.
With changes to the .debug$H section, we could pre-calculate this info
and eliminate the need to do this walk up front. That should restore
single-threaded performance back to what it was before this change.

This change will cause LLD to be much more parallel than it used to, and
for users who do multiple links in parallel, it could regress
performance. However, when the user is only doing one link, it's a huge
improvement. In the future, we can use NT worker threads to avoid
oversaturating the machine with work, but for now, this is such an
improvement for the single-link use case that I think we should land
this as is.

Algorithm
----------

Before this change, we essentially used a
DenseMap<GloballyHashedType, TypeIndex> to check if a type has already
been seen, and if it hasn't been seen, insert it now and use the next
available type index for it in the destination type stream. DenseMap
does not support concurrent insertion, and even if it did, the linker
must be deterministic: it cannot produce different PDBs by using
different numbers of threads. The output type stream must be in the same
order regardless of the order of hash table insertions.

In order to create a hash table that supports concurrent insertion, the
table cells must be small enough that they can be updated atomically.
The algorithm I used for updating the table using linear probing is
described in this paper, "Concurrent Hash Tables: Fast and General(?)!":
https://dl.acm.org/doi/10.1145/3309206

The GHashCell in this change is essentially a pair of 32-bit integer
indices: <sourceIndex, typeIndex>. The sourceIndex is the index of the
TpiSource object, and it represents an input type stream. The typeIndex
is the index of the type in the stream. Together, we have something like
a ragged 2D array of ghashes, which can be looked up as:
  tpiSources[tpiSrcIndex]->ghashes[typeIndex]

By using these side tables, we can omit the key data from the hash
table, and keep the table cell small. There is a cost to this: resolving
hash table collisions requires many more loads than simply looking at
the key in the same cache line as the insertion position. However, most
supported platforms should have a 64-bit CAS operation to update the
cell atomically.

To make the result of concurrent insertion deterministic, the cell
payloads must have a priority function. Defining one is pretty
straightforward: compare the two 32-bit numbers as a combined 64-bit
number. This means that types coming from inputs earlier on the command
line have a higher priority and are more likely to appear earlier in the
final PDB type stream than types from an input appearing later on the
link line.

After table insertion, the non-empty cells in the table can be copied
out of the main table and sorted by priority to determine the ordering
of the final type index stream. At this point, item and type records
must be separated, either by sorting or by splitting into two arrays,
and I chose sorting. This is why the GHashCell must contain the isItem
bit.

Once the final PDB TPI stream ordering is known, we need to compute a
mapping from source type index to PDB type index. To avoid starting over
from scratch and looking up every type again by its ghash, we save the
insertion position of every hash table insertion during the first
insertion phase. Because the table does not support rehashing, the
insertion position is stable. Using the array of insertion positions
indexed by source type index, we can replace the source type indices in
the ghash table cells with the PDB type indices.

Once the table cells have been updated to contain PDB type indices, the
mapping for each type source can be computed in parallel. Simply iterate
the list of cell positions and replace them with the PDB type index,
since the insertion positions are no longer needed.

Once we have a source to destination type index mapping for every type
source, there are no more data dependencies. We know which type records
are "unique" (not duplicates), and what their final type indices will
be. We can do the remapping in parallel, and accumulate type sizes and
type hashes in parallel by type source.

Lastly, TPI stream layout must be done serially. Accumulate all the type
records, sizes, and hashes, and add them to the PDB.

Differential Revision: https://reviews.llvm.org/D87805
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedllvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
The file was modifiedlld/include/lld/Common/ErrorHandler.h
The file was modifiedlld/test/COFF/pdb-type-server-missing.yaml
The file was modifiedlld/test/COFF/s_udt.s
The file was modifiedlld/test/COFF/pdb-global-hashes.test
The file was modifiedlld/COFF/DebugTypes.h
The file was modifiedllvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
The file was modifiedlld/COFF/TypeMerger.h
The file was modifiedlld/COFF/DebugTypes.cpp
The file was modifiedlld/test/COFF/pdb-procid-remapping.test
The file was modifiedlld/test/COFF/pdb-type-server-simple.test
The file was modifiedlld/test/COFF/precomp-link.test
The file was modifiedllvm/lib/DebugInfo/CodeView/RecordName.cpp
The file was modifiedlld/COFF/PDB.h
The file was modifiedllvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
The file was modifiedlld/COFF/Driver.cpp
The file was modifiedllvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
Commit 37b2e2b04cf434b368b1edf29609be21952316f9 by pklausler
[flang] Semantic analysis for FINAL subroutines

Represent FINAL subroutines in the symbol table entries of
derived types.  Enforce constraints.  Update tests that have
inadvertent violations or modified messages.  Added a test.

The specific procedure distinguishability checking code for generics
was used to enforce distinguishability of FINAL procedures.
(Also cleaned up some confusion and redundancy noticed in the
type compatibility infrastructure while digging into that area.)

Differential revision: https://reviews.llvm.org/D88613
The file was modifiedflang/test/Semantics/resolve32.f90
The file was modifiedflang/lib/Semantics/mod-file.h
The file was modifiedflang/lib/Evaluate/type.cpp
The file was modifiedflang/lib/Semantics/check-call.cpp
The file was modifiedflang/test/Semantics/call03.f90
The file was modifiedflang/lib/Semantics/tools.cpp
The file was addedflang/test/Semantics/final01.f90
The file was modifiedflang/lib/Semantics/symbol.cpp
The file was modifiedflang/include/flang/Evaluate/characteristics.h
The file was modifiedflang/include/flang/Semantics/symbol.h
The file was modifiedflang/lib/Semantics/resolve-names.cpp
The file was modifiedflang/test/Semantics/call05.f90
The file was modifiedflang/lib/Semantics/pointer-assignment.cpp
The file was modifiedflang/lib/Evaluate/characteristics.cpp
The file was modifiedflang/include/flang/Semantics/tools.h
The file was modifiedflang/test/Semantics/resolve55.f90
The file was modifiedflang/test/Semantics/modfile10.f90
The file was modifiedflang/lib/Evaluate/tools.cpp
The file was modifiedflang/lib/Semantics/check-declarations.cpp
The file was modifiedflang/include/flang/Evaluate/type.h
The file was modifiedflang/lib/Semantics/mod-file.cpp
Commit 55cff5b288650f0ce814c3c85041852bbed554b8 by protze
[OpenMP][libomptarget] make omp_get_initial_device 5.1 compliant

OpenMP 5.1 defines omp_get_initial_device to return the same value as omp_get_num_devices.
Since this change is also 5.0 compliant, no versioning is needed.

Differential Revision: https://reviews.llvm.org/D88149
The file was modifiedopenmp/runtime/src/kmp.h
The file was modifiedopenmp/libomptarget/src/api.cpp
The file was modifiedopenmp/libomptarget/include/omptarget.h
The file was modifiedopenmp/runtime/src/kmp_ftn_entry.h
Commit 6104b30446aa976006fd322af4a57a8f0124f94f by protze
[OpenMP][OMPT] Update OMPT tests for newly added GOMP interface patches

This patch updates the expected results for the GOMP interface patches: D87267, D87269, and D87271.
The taskwait-depend test is changed to really use taskwait-depend and copied to an task_if0-depend test.

To pass the tests, the handling of the return address was fixed.

Differential Revision: https://reviews.llvm.org/D87680
The file was modifiedopenmp/runtime/src/kmp_taskdeps.cpp
The file was modifiedopenmp/runtime/src/ompt-specific.h
The file was modifiedopenmp/runtime/src/kmp_gsupport.cpp
The file was addedopenmp/runtime/test/ompt/tasks/task_if0-depend.c
The file was modifiedopenmp/runtime/test/ompt/tasks/taskwait-depend.c
The file was modifiedopenmp/runtime/test/ompt/tasks/dependences_mutexinoutset.c
Commit 21cf2e6c263d7a50654653bce4e83ab463fae580 by Akira
Handle unknown OSes in DarwinTargetInfo::getExnObjectAlignment

rdar://problem/69727650
The file was modifiedclang/lib/Basic/Targets/OSTargets.h
The file was modifiedclang/test/SemaCXX/warn-overaligned-type-thrown.cpp
Commit 66d2e3f495948412602db4507359b4612639e523 by saghir
[PowerPC] Add outer product instructions for MMA

This patch adds outer product instructions for MMA, including related infrastructure, and their tests.

Depends on D84968.

Reviewed By: #powerpc, bsaleil, amyk

Differential Revision: https://reviews.llvm.org/D88043
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrPrefix.td
The file was modifiedllvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
The file was modifiedllvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.h
The file was modifiedllvm/test/MC/PowerPC/ppc64-encoding-ISA31.s
The file was modifiedllvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
The file was modifiedllvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp
The file was modifiedllvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ISA31.txt
Commit b23916504a1a9f29c7519ed83813774eecce1789 by craig.topper
Patch IEEEFloat::isSignificandAllZeros and IEEEFloat::isSignificandAllOnes (bug 34579)

Patch IEEEFloat::isSignificandAllZeros and IEEEFloat::isSignificandAllOnes to behave correctly in the case that the size of the significand is a multiple of the width of the integerParts making up the significand.

The patch to IEEEFloat::isSignificandAllOnes fixes bug 34579, and the patch to IEEE:Float:isSignificandAllZeros fixes the unit test "APFloatTest.x87Next" I added here. I have included both in this diff since the changes are very similar.

Patch by Andrew Briand
The file was modifiedllvm/lib/Support/APFloat.cpp
The file was modifiedllvm/unittests/ADT/APFloatTest.cpp
Commit 23419bfd1c8f26617bda47e6d4732dcbfe0c09a3 by protze
[OpenMP][libarcher] Allow all possible argument separators in TSAN_OPTIONS

Currently, the parser used to tokenize the TSAN_OPTIONS in libomp uses
only spaces as separators, even though TSAN in compiler-rt supports
other separators like ':' or ','.
CTest uses ':' to separate sanitizer options by default.
The documentation for other sanitizers mentions ':' as separator,
but TSAN only lists spaces, which is probably where this mismatch originated.

Patch provided by  upsj

Differential Revision: https://reviews.llvm.org/D87144
The file was modifiedopenmp/tools/archer/tests/parallel/parallel-simple.c
The file was modifiedopenmp/tools/archer/ompt-tsan.cpp
The file was addedopenmp/tools/archer/tests/parallel/parallel-nosuppression.c
The file was modifiedopenmp/tools/archer/tests/lit.cfg