Changes

Summary

  1. [analyzer][NFC] Introduce CallDescriptionSets (details)
  2. [analyzer][NFC] Introduce CallDescription::matches() in addition to isCalled() (details)
  3. [analyzer][NFC] Switch to using CallDescription::matches() instead of isCalled() (details)
  4. [analyzer][NFC] Demonstrate the use of CallDescriptionSet (details)
  5. [analyzer][NFC] CallDescription should own the qualified name parts (details)
  6. [analyzer][NFC] Consolidate the inner representation of CallDescriptions (details)
  7. [analyzer][NFC] Use enum for CallDescription flags (details)
  8. [analyzer][NFC] MaybeUInt -> MaybeCount (details)
  9. [DSE] Improve handling of `strncpy` in Dead Store Elimination (details)
  10. [SROA] Add new test cases to cover existing SROA behavior that structs will be scalarized. (details)
  11. [mlir][vector] Remove usage of shapecast to remove unit dim (details)
  12. [mlir][vector] NFC, move some vector patterns in a separate file (details)
  13. [openmp][amdgpu][nfc] Inline interop_hsa_get_kernel_info into only caller (details)
  14. [ELF] Support discarding .got.plt (details)
  15. [AMDGPU] Add an implicit use of M0 to all V_MOV_B32_indirect_read/write (details)
  16. [mlir][gpu] Extend shuffle op modes and add nvvm lowering (details)
  17. [MLIR][GPU] Run generic LLVM optimizations when serializing (on AMD) (details)
  18. [libc++] Avoid potential truncation warnings in std::abs test (details)
  19. [libc++] Fix some tests that were broken in the single-threaded configuration (details)
  20. [libc++] Fix feature test macro for __cpp_lib_to_chars (details)
  21. [clang][NFC] Inclusive terms: replace some uses of sanity in clang (details)
  22. [libc++] Test that our algorithms never copy a user-provided comparator. (details)
  23. [openmp][amdgpu][nfc] Simplify implicit args handling (details)
  24. DWARFVerifier: Simplify name lookups (details)
  25. NFC: Callout restriction on folding 0-result ops in documentation. (details)
  26. [MLIR][GPU] Make the path to ROCm a runtime option (details)
  27. Allow __attribute__((swift_attr)) in attribute push pragmas (details)
  28. [libc++][NFC] Add missing include in test (details)
  29. [PowerPC][NFC] Add a series of codegen tests for vector reductions. (details)
  30. [InstCombine] add/adjust tests for mask of sext i1; NFC (details)
  31. [Sema] fix nondeterminism in ASTContext::getDeducedTemplateSpecializationType (details)
  32. [mlir] Bug fix. Stream must outlive the pass manager. (details)
  33. [NFC][llvm] Inclusive language: remove instance of master from Thumb2SizeReduction.cpp (details)
  34. [MLIR][GPU] Link in device libraries during HSA compilation if needed (details)
  35. [InstrProf] Use i32 for GEP index from lowering llvm.instrprof.increment (details)
  36. [clangd] Avoid possible crash: apply configuration after binding methods (details)
  37. [NFC] Test commit, add whitespace to end-of-line (details)
  38. [hmaptool] Port to python3 (details)
Commit d448fcd9b2238377dd8832ce9e35a37b59ef5aeb by balazs.benics
[analyzer][NFC] Introduce CallDescriptionSets

Sometimes we only want to decide if some function is called, and we
don't care which of the set.
This `CallDescriptionSet` will have the same behavior, except
instead of `lookup()` returning a pointer to the mapped value,
the `contains()` returns `bool`.
Internally, it uses the `CallDescriptionMap<bool>` for implementing the
behavior. It is preferred, to reuse the generic
`CallDescriptionMap::lookup()` logic, instead of duplicating it.
The generic version might be improved by implementing a hash lookup or
something along those lines.

Reviewed By: martong, Szelethus

Differential Revision: https://reviews.llvm.org/D113589
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
The file was modifiedclang/lib/StaticAnalyzer/Core/CallDescription.cpp
Commit 6c512703a9e6e495afa0f44528821c27f28db795 by balazs.benics
[analyzer][NFC] Introduce CallDescription::matches() in addition to isCalled()

This patch introduces `CallDescription::matches()` member function,
accepting a `CallEvent`.
Semantically, `Call.isCalled(CD)` is the same as `CD.matches(Call)`.

The patch also introduces the `matchesAny()` variadic free function template.
It accepts a `CallEvent` and at least one `CallDescription` to match
against.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D113590
The file was modifiedclang/lib/StaticAnalyzer/Core/CallDescription.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
The file was modifiedclang/lib/StaticAnalyzer/Core/CallEvent.cpp
Commit f18da190b0dba817d33ccd7727537f12304d8125 by balazs.benics
[analyzer][NFC] Switch to using CallDescription::matches() instead of isCalled()

This patch replaces each use of the previous API with the new one.
In variadic cases, it will use the ADL `matchesAny(Call, CDs...)`
variadic function.
Also simplifies some code involving such operations.

Reviewed By: martong, xazax.hun

Differential Revision: https://reviews.llvm.org/D113591
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp
The file was modifiedclang/unittests/StaticAnalyzer/ConflictingEvalCallsTest.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
The file was modifiedclang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/CallEvent.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StringChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp
Commit 9ad0a90baa8ca8067fe65086056fffd083c86796 by balazs.benics
[analyzer][NFC] Demonstrate the use of CallDescriptionSet

Reviewed By: martong, xazax.hun

Differential Revision: https://reviews.llvm.org/D113592
The file was modifiedclang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
Commit de9d7e42aca29920e9918ecaed4ad9c45fa673f1 by balazs.benics
[analyzer][NFC] CallDescription should own the qualified name parts

Previously, CallDescription simply referred to the qualified name parts
by `const char*` pointers.
In the future we might want to dynamically load and populate
`CallDescriptionMaps`, hence we will need the `CallDescriptions` to
actually **own** their qualified name parts.

Reviewed By: martong, xazax.hun

Differential Revision: https://reviews.llvm.org/D113593
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
The file was modifiedclang/lib/StaticAnalyzer/Core/CallDescription.cpp
Commit 97f1bf15b154ef32608fe17b82f2f312401d150c by balazs.benics
[analyzer][NFC] Consolidate the inner representation of CallDescriptions

`CallDescriptions` have a `RequiredArgs` and `RequiredParams` members,
but they are of different types, `unsigned` and `size_t` respectively.
In the patch I use only `unsigned` for both, that should be large enough
anyway.
I also introduce the `MaybeUInt` type alias for `Optional<unsigned>`.

Additionally, I also avoid the use of the //smart// less-than operator.

  template <typename T>
  constexpr bool operator<=(const Optional<T> &X, const T &Y);

Which would check if the optional **has** a value and compare the data
only after. I found it surprising, thus I think we are better off
without it.

Reviewed By: martong, xazax.hun

Differential Revision: https://reviews.llvm.org/D113594
The file was modifiedclang/lib/StaticAnalyzer/Core/CallDescription.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
Commit e6ef134f3c77005438f9fb7c1d17d3c30747844e by balazs.benics
[analyzer][NFC] Use enum for CallDescription flags

Yeah, let's prefer a slightly stronger type representing this.

Reviewed By: martong, xazax.hun

Differential Revision: https://reviews.llvm.org/D113595
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/DebugContainerModeling.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/CallDescription.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp
Commit d5de568cc7375281b14bd2632576bff7f4afabc3 by balazs.benics
[analyzer][NFC] MaybeUInt -> MaybeCount

I forgot to include this in D113594

Differential Revision: https://reviews.llvm.org/D113594
The file was modifiedclang/lib/StaticAnalyzer/Core/CallDescription.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
Commit 7eec832def5717b1bddb72c3b99c3df4f7a2f6da by flo
[DSE] Improve handling of `strncpy` in Dead Store Elimination

Fixes PR#52062 and one of the remaining cases of PR#47644.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D114035
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
The file was modifiedllvm/test/Transforms/DeadStoreElimination/libcalls.ll
Commit ffdace4892bd1f43121d365c22eb9c3fe79aeb6c by mingmingl
[SROA] Add new test cases to cover existing SROA behavior that structs will be scalarized.

Add an IR in unit test directory, which demonstrate the scalarization for struct allocations.
This is added to pave the way for an SROA change to skip scalarization for some cases.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D114128
The file was addedllvm/test/Transforms/SROA/alloca-struct.ll
Commit 06dbb2856967a5497c6ddfad3d3fdfea20849f7e by thomasraoux
[mlir][vector] Remove usage of shapecast to remove unit dim

Instead of using shape_cast op in the pattern removing leading unit
dimensions we use extract/broadcast ops. This is part of the effort to
restrict ShapeCastOp fuirther in the future and only allow them to
convert to or from 1D vector.

This also adds extra canonicalization to fill the gaps in simplifying
broadcast/extract ops.

Differential Revision: https://reviews.llvm.org/D114205
The file was modifiedmlir/test/Dialect/Vector/canonicalize.mlir
The file was removedmlir/test/Dialect/Vector/vector-dim-one-shape-cast.mlir
The file was modifiedmlir/lib/Dialect/Vector/VectorOps.cpp
The file was modifiedmlir/test/Dialect/Vector/vector-transforms.mlir
The file was modifiedmlir/lib/Dialect/Vector/VectorTransforms.cpp
Commit 7cde5165131f1268a8506066275ef7938c58d156 by thomasraoux
[mlir][vector] NFC, move some vector patterns in a separate file

Move patterns related to dropping lead unit dim into their own file.

Differential Revision: https://reviews.llvm.org/D114265
The file was modifiedmlir/lib/Dialect/Vector/CMakeLists.txt
The file was addedmlir/lib/Dialect/Vector/VectorDropLeadUnitDim.cpp
The file was modifiedmlir/lib/Dialect/Vector/VectorTransforms.cpp
Commit 9cdaf0b01b298dc05a213fca5943e23a2aec51a2 by jonathanchesterfield
[openmp][amdgpu][nfc] Inline interop_hsa_get_kernel_info into only caller
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/interop_hsa.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/interop_hsa.h
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/system.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/src/rtl.cpp
Commit 2997441b85c0ec94425e83316d7e63c32d8c5770 by i
[ELF] Support discarding .got.plt

Fix a null pointer dereference when .got.plt is discarded.

This also adds a test for discarding `.plt`.

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D114180
The file was addedlld/test/ELF/linkerscript/discard-plt.s
The file was modifiedlld/ELF/SyntheticSections.cpp
Commit ff7f2cfa959bbc2effefb6f11f225b525e9029c8 by jay.foad
[AMDGPU] Add an implicit use of M0 to all V_MOV_B32_indirect_read/write

NFCI. Previously the implicit use was added to V_MOV_B32_indirect_read
when building the instruction. V_MOV_B32_indirect_write didn't have an
implicit use of M0 at all, but apparently it did not cause any problems.

Differential Revision: https://reviews.llvm.org/D114239
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/set-gpr-idx-peephole.mir
The file was modifiedllvm/lib/Target/AMDGPU/VOP1Instructions.td
Commit 47555d73f6538cf2c092a7314e3c82c631ce4ccb by thomasraoux
[mlir][gpu] Extend shuffle op modes and add nvvm lowering

Add up, down and idx modes to gpu shuffle ops, also change the mode from
string to enum

Differential Revision: https://reviews.llvm.org/D114188
The file was modifiedmlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
The file was modifiedmlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
The file was modifiedmlir/test/Dialect/LLVMIR/nvvm.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/test/Target/LLVMIR/nvvmir.mlir
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUOps.td
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/test/Dialect/LLVMIR/invalid.mlir
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/test/Dialect/GPU/ops.mlir
Commit bd22554af06e1f16dc9ff12eac8987f0ceebe8c1 by Krzysztof.Drewniak
[MLIR][GPU] Run generic LLVM optimizations when serializing (on AMD)

- Adds hooks that allow SerializeTo* passes to arbitrarily transform
the produced LLVM Module before it is passed to the code generation
passes.

- Uses these hooks within the SerializeToHsaco pass in order to run
LLVM optimizations and to set the optimization level on the
TargetMachine.

- Adds an optLevel parameter to SerializeToHsaco

Future work may include moving much of what's been added to
SerializeToHsaco to SerializeToBlob, but that would require
confirmation from the NVVM backend maintainers that it would be
appropriate to do so.

Depends on D114107

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D114113
The file was modifiedmlir/include/mlir/Dialect/GPU/Passes.h
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
The file was modifiedmlir/lib/Dialect/GPU/CMakeLists.txt
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToBlob.cpp
Commit 1b4c0cb3918a9f2d12f8259407fc8bce053e78bf by Louis Dionne
[libc++] Avoid potential truncation warnings in std::abs test

One some platforms, -Wimplicit-int-conversion is enabled by default,
which can lead to additional warnings being triggered in this test.
Since we're only trying to test errors related to calling abs(), the
assignment is superfluous.

As a fly-by fix, correct one instance of ::abs to std::abs and made
the test a .verify.cpp test instead.

Differential Revision: https://reviews.llvm.org/D114244
The file was removedlibcxx/test/std/numerics/c.math/abs.fail.cpp
The file was addedlibcxx/test/std/numerics/c.math/abs.verify.cpp
Commit e1ce3dabf0c70d30a24f0586ddf2a965d730d30a by Louis Dionne
[libc++] Fix some tests that were broken in the single-threaded configuration

We never noticed it because our CI doesn't actually build against a C
library that doesn't have threading functionality, however building
against a truly thread-free platform surfaces these issues.

Differential Revision: https://reviews.llvm.org/D114242
The file was modifiedlibcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.pass.cpp
The file was modifiedlibcxx/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/assign.compile.fail.cpp
The file was modifiedlibcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
The file was modifiedlibcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
The file was modifiedlibcxx/utils/generate_feature_test_macro_components.py
The file was modifiedlibcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/race.pass.cpp
The file was modifiedlibcxx/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/copy.compile.fail.cpp
The file was modifiedlibcxx/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp
The file was modifiedlibcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
The file was modifiedlibcxx/test/std/concepts/concepts.lang/concept.assignable/assignable_from.compile.pass.cpp
The file was modifiedlibcxx/utils/generate_header_inclusion_tests.py
The file was modifiedlibcxx/test/libcxx/thread/thread.mutex/version.pass.cpp
The file was modifiedlibcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
Commit e0f58444e126e80a0d43eb5b88622799910195e6 by Louis Dionne
[libc++] Fix feature test macro for __cpp_lib_to_chars

We would have been defining it in <utility> instead of <charconv>. For
the time being, this doesn't change anything since we don't implement
the feature test macro anyways.

Also, as a fly-by, this removes obsolete feature test macro tests. There
was a brief time back in the days when we wrote feature test macro tests
manually. In particular, we had test files for __cpp_lib_to_chars and
__cpp_lib_memory_resource. Since we now have a principled way of generating
these tests with scripts, this commit removes the obsolete (and empty)
tests for these two feature test macros.

Differential Revision: https://reviews.llvm.org/D114243
The file was removedlibcxx/test/std/language.support/support.limits/support.limits.general/charconv.pass.cpp
The file was modifiedlibcxx/utils/generate_feature_test_macro_components.py
The file was removedlibcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp
The file was modifiedlibcxx/test/std/language.support/support.limits/support.limits.general/utility.version.pass.cpp
The file was addedlibcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.pass.cpp
The file was modifiedlibcxx/include/version
Commit d8e5a0c42bd8796cce9caa53aacab88c7cb2a3eb by zarko
[clang][NFC] Inclusive terms: replace some uses of sanity in clang

Rewording of comments to avoid using `sanity test, sanity check`.

Reviewed By: aaron.ballman, Quuxplusone

Differential Revision: https://reviews.llvm.org/D114025
The file was modifiedclang/lib/Analysis/BodyFarm.cpp
The file was modifiedclang/lib/Basic/SourceManager.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/ExprEngine.cpp
The file was modifiedclang/lib/Tooling/Syntax/Tree.cpp
The file was modifiedclang/lib/Analysis/RetainSummaryManager.cpp
The file was modifiedclang/lib/Format/Format.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/Store.cpp
The file was modifiedclang/include/clang/CodeGen/CGFunctionInfo.h
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
The file was modifiedclang/include/clang/AST/Redeclarable.h
The file was modifiedclang/lib/Basic/DiagnosticIDs.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
The file was modifiedclang/lib/Frontend/FrontendActions.cpp
The file was modifiedclang/lib/Sema/SemaLookup.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/include/clang/Sema/Lookup.h
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/include/clang/Analysis/CFG.h
Commit b07b5bd72716625e0976a84d23652d94d8d0165a by arthur.j.odwyer
[libc++] Test that our algorithms never copy a user-provided comparator.

This is not mandated by the standard, so it goes in libcxx/test/libcxx/.
It's certainly arguable that the algorithms changed here
(`is_heap`, `is_sorted`, `min`, `max`) are harmless and we should
just let them copy their comparators once. But at the same time,
it's nice to have all our algorithms be 100% consistent and never
copy a comparator, not even once.

Differential Revision: https://reviews.llvm.org/D114136
The file was modifiedlibcxx/include/__algorithm/max.h
The file was modifiedlibcxx/test/std/algorithms/robust_re_difference_type.compile.pass.cpp
The file was modifiedlibcxx/include/__algorithm/min_element.h
The file was addedlibcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
The file was modifiedlibcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
The file was modifiedlibcxx/include/__algorithm/is_heap.h
The file was modifiedlibcxx/include/__algorithm/is_sorted.h
The file was modifiedlibcxx/include/__algorithm/is_sorted_until.h
The file was modifiedlibcxx/include/__algorithm/max_element.h
The file was modifiedlibcxx/include/__algorithm/min.h
The file was modifiedlibcxx/include/__algorithm/binary_search.h
The file was modifiedlibcxx/include/__algorithm/is_heap_until.h
Commit 04954824ee158fffe6653c7eb51c07347b36ff21 by jonathanchesterfield
[openmp][amdgpu][nfc] Simplify implicit args handling

Removes a +x/-x pair on the only store/load of a variable
and deletes some nearby dead code. Also reduces the size of the implicit
struct to reflect the code currently emitted by clang.

Differential Revision: https://reviews.llvm.org/D114270
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/system.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/src/rtl.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/internal.h
Commit 3f3680dff3e72881bd89241fe512ec8138edbc70 by dblaikie
DWARFVerifier: Simplify name lookups

No need to use the dynamic fallback query when the name type is known
statically at the call site.
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
Commit 3fcdd182e9784cb9c2d7ff54b44ec00bd6c91a87 by stellaraccident
NFC: Callout restriction on folding 0-result ops in documentation.

Differential Revision: https://reviews.llvm.org/D114271
The file was modifiedmlir/docs/Canonicalization.md
Commit 20f79f8caa3a333a34021f0028e828f97d79c2a1 by Krzysztof.Drewniak
[MLIR][GPU] Make the path to ROCm a runtime option

Our current build assumes that the path to ROCm we find at build time
will be the path at which ROCm is located when the built code is
executed. This commit adds a --rocm-path option to SerializeToHsaco,
and removes the HIP dependency that the SerializeToHsaco previously had.

Depends on D114113

(though the dependency is to ensure the diffs apply cleanly and to capture the dependency on D114107)

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D114114
The file was modifiedmlir/lib/Dialect/GPU/CMakeLists.txt
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
Commit 290cddcd139d668251821f11426f37481faf6d7f by Alex Lorenz
Allow __attribute__((swift_attr)) in attribute push pragmas

This change allows SwiftAttr to be used with #pragma clang attribute push
to add Swift attributes to large regions of header files.
We plan to use this to annotate headers with concurrency information.

Patch by: Becca Royal-Gordon

Differential Revision: https://reviews.llvm.org/D112773
The file was modifiedclang/test/Misc/pragma-attribute-supported-attributes-list.test
The file was modifiedclang/test/AST/attr-swift_attr.m
The file was modifiedclang/include/clang/Basic/Attr.td
Commit e059329b835aac1b93d764811b23c3cfd8b856c7 by Louis Dionne
[libc++][NFC] Add missing include in test
The file was modifiedlibcxx/test/support/uses_alloc_types.h
Commit e9d12c248013b2d2b9880436727857e0ec8a7085 by stefanp
[PowerPC][NFC] Add a series of codegen tests for vector reductions.

This patch only adds tests for PowerPC. The purpose of these tests
is to track what code is generated for various vector reductions.

Reviewed By: nemanjai, #powerpc

Differential Revision: https://reviews.llvm.org/D113801
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-add.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-mul.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-umax.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-umin.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-and.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-smin.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-or.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-fmax.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-fmin.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-fmul.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-fadd.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-xor.ll
The file was addedllvm/test/CodeGen/PowerPC/vector-reduce-smax.ll
Commit 491efa7f31cbc39fe0aaad261a840cc5311346fb by spatel
[InstCombine] add/adjust tests for mask of sext i1; NFC

These are sibling transforms, but the test coverage was
uneven and incomplete.
The file was modifiedllvm/test/Transforms/InstCombine/and.ll
The file was modifiedllvm/test/Transforms/InstCombine/or.ll
Commit a075d67222832c234296ffd605f19e33023e6060 by apollo.mobility
[Sema] fix nondeterminism in ASTContext::getDeducedTemplateSpecializationType

`DeducedTemplateSpecializationTypes` is a `llvm::FoldingSet<DeducedTemplateSpecializationType>` [1],
where `FoldingSetNodeID` is based on the values: {`TemplateName`, `QualType`, `IsDeducedAsDependent`},
those values are also used as `DeducedTemplateSpecializationType` constructor arguments.

A `FoldingSetNodeID` created by the static `DeducedTemplateSpecializationType::Profile` may not be equal
to`FoldingSetNodeID` created by a member `DeducedTemplateSpecializationType::Profile` of an instance
created with the same {`TemplateName`, `QualType`, `IsDeducedAsDependent`}, which makes
`DeducedTemplateSpecializationTypes` lookups nondeterministic.

Specifically, while `IsDeducedAsDependent` value is passes to the constructor, `IsDependent()` method on
the created instance may return a different value, because `IsDependent` is not saved as is:
```name=clang/include/clang/AST/Type.h
  DeducedTemplateSpecializationType(TemplateName Template,  QualType DeducedAsType, bool IsDeducedAsDependent)
      : DeducedType(DeducedTemplateSpecialization, DeducedAsType,
                    toTypeDependence(Template.getDependence()) | // <~  also considers `TemplateName` parameter
                        (IsDeducedAsDependent ? TypeDependence::DependentInstantiation : TypeDependence::None)),
```
For example, if an instance A with key `FoldingSetNodeID {A, B, false}` is inserted. Then a key
`FoldingSetNodeID {A, B, true}` is probed:
If it happens to correspond to the same bucket in `FoldingSet` as the first key, and `A.Profile()` returns
`FoldingSetNodeID {A, B, true}`, then it's a hit.
If the bucket for the second key is different from the first key, instance A is not considered at all, and it's
a no hit, even if `A.Profile()` returns  `FoldingSetNodeID {A, B, true}`.

Since `TemplateName`, `QualType` parameter values involve memory pointers, the lookup result depend on allocator,
and may differ from run to run. When this is used as part of modules compilation, it may result in "module out of date"
errors, if imported modules are built on different machines.

This makes `ASTContext::getDeducedTemplateSpecializationType` consider `Template.isDependent()` similar
`DeducedTemplateSpecializationType` constructor.

Tested on a very big codebase, by running modules compilations from directories with varied path length
(seem to affect allocator seed).

1. https://llvm.org/docs/ProgrammersManual.html#llvm-adt-foldingset-h

Patch by Wei Wang and Igor Sugak!

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D112481
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/include/clang/AST/Type.h
Commit d729f4c38fca91736ef1008660baccbd9d3552f6 by rdzhabarov
[mlir] Bug fix. Stream must outlive the pass manager.

Bug fix. Stream must outlive the pass manager.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D114277
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToBlob.cpp
Commit 3f3bee42d22988d018834c58af244dee08a52d9c by quinn.pham
[NFC][llvm] Inclusive language: remove instance of master from Thumb2SizeReduction.cpp

[NFC] As part of using inclusive language within the llvm project, this patch
replaces master with main in `Thumb2SizeReduction.cpp`.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D114196
The file was modifiedllvm/lib/Target/ARM/Thumb2SizeReduction.cpp
Commit a6f53afbcb4d995139064276b5ad971ad7ced5e2 by Krzysztof.Drewniak
[MLIR][GPU] Link in device libraries during HSA compilation if needed

To perform some operations, such as sin() or printf(), code compiled
for AMD GPUs must be linked to a series of device libraries. This
commit adds support for linking in these libraries.

However, since these device libraries are delivered as LLVM bitcode,
raising the possibility of version incompatibilities, this commit only
links in libraries when the functions from those libraries are called
by the code being compiled.

This code also sets the math flags to their most conservative values,
as MLIR doesn't have a `-ffast-math` equivalent.

Depends on D114114

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D114117
The file was modifiedmlir/lib/Dialect/GPU/CMakeLists.txt
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
Commit de11de308b6480fc35d901c7104f46918674418c by kyulee
[InstrProf] Use i32 for GEP index from lowering llvm.instrprof.increment

The `llvm.instrprof.increment` intrinsic uses `i32` for the index. We should use this same type for the index into the GEP instructions.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D114268
The file was modifiedclang/test/Profile/branch-logical-mixed.cpp
The file was modifiedclang/test/Profile/cxx-stmt-initializers.cpp
The file was modifiedclang/test/Profile/cxx-throws.cpp
The file was modifiedllvm/test/Instrumentation/InstrProfiling/atomic-updates.ll
The file was modifiedclang/test/Profile/c-ternary.c
The file was modifiedclang/test/Profile/cxx-class.cpp
The file was modifiedllvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll
The file was modifiedclang/test/Profile/c-general.c
The file was modifiedclang/test/Profile/objc-general.m
The file was modifiedllvm/test/Transforms/PGOProfile/instr_entry_bb.ll
The file was modifiedclang/test/Profile/cxx-templates.cpp
The file was modifiedclang/test/Profile/c-captured.c
The file was modifiedllvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
The file was modifiedclang/test/CodeGen/profile-filter.c
The file was modifiedclang/test/Profile/cxx-rangefor.cpp
The file was modifiedclang/test/Profile/cxx-lambda.cpp
Commit f764a1a5bd7c281d3d7cc3c6d7f1430711176762 by sam.mccall
[clangd] Avoid possible crash: apply configuration after binding methods

The configuration may kick off indexing, which may involve sending LSP
messages.
The crash is fiddly to reproduce in a hermetic test (we need background
indexing on without disk storage, and to handle server->client messages
in LSPClient...)

Fixes https://github.com/clangd/clangd/issues/926
The file was modifiedclang-tools-extra/clangd/ClangdLSPServer.cpp
Commit 241df03ce5f0949501454b9ac796ccc90d52ddfb by j-nagurne
[NFC] Test commit, add whitespace to end-of-line
The file was modifiedllvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
Commit 1bd4dc4f2854edf3035732416ec7e4adbddaf982 by nathan
[hmaptool] Port to python3

This is just a few trivial changes -- change the interpreter and fix a
few byte-vs-string issues.

Differential Revision: https://reviews.llvm.org/D107944
The file was modifiedclang/utils/hmaptool/hmaptool