Changes

Summary

  1. [lld][MachO] Add support for LC_DATA_IN_CODE (details)
  2. [libc++][ci] Enable modules in the Runtimes build (details)
  3. Do not merge LocalInstantiationScope for template specialization (details)
  4. [lld][MachO] Fix UB after D103006 (details)
  5. [NFC][hwasan] Fix "implicitly declaring library function" (details)
  6. [X86] Use EVT::getVectorVT instead of changeVectorElementType in reduceVMULWidth. (details)
  7. [NFC] This is a test commit to check commit access. (details)
  8. [AMDGPU][Libomptarget] Drop dead code related to g_atl_machine (details)
  9. Revert "[NFC] This is a test commit to check commit access." (details)
  10. [ORC-RT] Fix void function handling in the WrapperFunction utility. (details)
  11. [Debug-Info][CodeView] Fix GUID string generation for MSVC generated objects. (details)
  12. [gn build] Port d0a5d8611935 (details)
  13. Support buffers in LinalgFoldUnitExtentDims (details)
  14. [libc] Add a set of elementary operations (details)
  15. Revert "[libc] Add a set of elementary operations" (details)
  16. [builtins] Allow compiling the builtins without libc headers (details)
  17. [IR] Remove forward declaration of GraphTraits from Type.h (details)
  18. [mlir][linalg] Fold linalg.pad_tensor if src type == result type (details)
  19. [clang-format] distinguish function type casts after 21c18d5a04316891110cecc2bf37ce51533decba (details)
  20. [analyzer] Refactor StoreSiteFinder and extract DefaultStoreHandler (details)
  21. [analyzer] Extract ControlDependencyHandler (details)
  22. [analyzer] Extract NilReceiverHandler (details)
  23. [analyzer] Extract ArrayIndexHandler (details)
  24. [analyzer] Extract InterestingLValueHandler (details)
  25. [analyzer] Extract InlinedFunctionCallHandler (details)
  26. [analyzer] Simplify the process of producing notes for stores (details)
  27. Fix Windows builders after 244601f4720d9cda6e81ea1908f3ce905a4bcb0e (details)
  28. [MCA][InstrBuilder] Check for the presence of flag VariadicOpsAreDefs. (details)
  29. [analyzer] Decouple NoteTag from its Factory (details)
  30. [X86] Schedule-model second (mask) output of GATHER instruction (details)
  31. [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py (details)
Commit 928394d10918c97880ef36e4e9853888b0d55207 by alexshap
[lld][MachO] Add support for LC_DATA_IN_CODE

Add first bits for emitting LC_DATA_IN_CODE.

Test plan: make check-lld-macho

Differential revision: https://reviews.llvm.org/D103006
The file was modifiedlld/MachO/InputFiles.h (diff)
The file was modifiedlld/MachO/SyntheticSections.h (diff)
The file was addedlld/test/MachO/data-in-code.s
The file was modifiedlld/test/MachO/headerpad.s (diff)
The file was modifiedlld/MachO/InputSection.h (diff)
The file was modifiedlld/MachO/Writer.cpp (diff)
The file was modifiedlld/test/MachO/local-got.s (diff)
The file was modifiedlld/MachO/InputFiles.cpp (diff)
The file was modifiedlld/MachO/SyntheticSections.cpp (diff)
Commit 1b87573aaf8ad6a0e1edaac7ab7b34a28f8f41bb by Louis Dionne
[libc++][ci] Enable modules in the Runtimes build

The runtimes build has assertions enabled, which is necessary to catch
some of the modules-related issues we've been seeing recently. This
patch enables testing with modules in the runtimes build so as to cover
those cases.

In the future, a better solution would be to systematically use versions
of Clang that have assertions enabled. However, the Clangs we release
currently don't have assertions enabled by default, which causes a
challenge for the CI (we could try to build our own Clang from ToT with
assertions in the CI, but that poses some problems).

Differential Revision: https://reviews.llvm.org/D104252
The file was modifiedlibcxx/utils/ci/run-buildbot (diff)
Commit 79f9cfbc21e02555258523ea77c3dd389891cfb3 by Yaxun.Liu
Do not merge LocalInstantiationScope for template specialization

A lambda in a function template may be recursively instantiated. The recursive
lambda will cause a lambda function instantiated multiple times, one inside another.
The inner LocalInstantiationScope should not be marked as MergeWithParentScope
since it already has references to locals properly substituted, otherwise it causes
assertion due to the check for duplicate locals in merged LocalInstantiationScope.

Reviewed by: Richard Smith

Differential Revision: https://reviews.llvm.org/D98068
The file was addedclang/test/SemaCXX/recursive-lambda.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp (diff)
Commit b01bfdfda64b684965cd7f97e99e4b0bce5d67fa by Vitaly Buka
[lld][MachO] Fix UB after D103006

ubsan detected:
lld/MachO/SyntheticSections.cpp:636:15: runtime error: null pointer
passed as argument 2, which is declared to never be null
The file was modifiedlld/MachO/SyntheticSections.cpp (diff)
Commit 51ed1c6ccc7b9d9b0ff3169b9f5e6b798eed599b by Vitaly Buka
[NFC][hwasan] Fix "implicitly declaring library function"
The file was modifiedcompiler-rt/test/hwasan/TestCases/mem-intrinsics.c (diff)
Commit 4017d0335a35334835bfae6fc3e258adcd9ed2dc by craig.topper
[X86] Use EVT::getVectorVT instead of changeVectorElementType in reduceVMULWidth.

Changing vector element type doesn't work for v6i32->v6i16 now
that v6i32 is an MVT and v6i16 is not.

I would like to fix this in changeVectorElementType, but you
need a LLVMContext to call getVectorVT which we can't get from
an MVT.

Fixes PR50709.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp (diff)
The file was addedllvm/test/CodeGen/X86/pr50709.ll
Commit b4d40e19def8c2e1a77ae30b5ac16751d1c461f7 by CarlosAlbertoEnciso
[NFC] This is a test commit to check commit access.

Add full stop at the end of comment.
The file was modifiedllvm/test/DebugInfo/X86/c-type-units.ll (diff)
Commit cadcaf3f46f6ccd3619cb2dd75bf54ed3080f43d by Pushpinder.Singh
[AMDGPU][Libomptarget] Drop dead code related to g_atl_machine

This patch includes some changes which deletes the code accessing
g_atl_machine global. Some accesses related to memory_pools are
still remaining.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D103813
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/system.cpp (diff)
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp (diff)
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/rt.h (diff)
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/machine.h (diff)
The file was modifiedopenmp/libomptarget/plugins/amdgpu/src/rtl.cpp (diff)
Commit 5e92cbddb901453ecd04138460c546b96d29097d by CarlosAlbertoEnciso
Revert "[NFC] This is a test commit to check commit access."

This reverts commit b4d40e19def8c2e1a77ae30b5ac16751d1c461f7.
The file was modifiedllvm/test/DebugInfo/X86/c-type-units.ll (diff)
Commit 68c161090ef6fe83218af6f627170ae56e5800b1 by Lang Hames
[ORC-RT] Fix void function handling in the WrapperFunction utility.

Handlers returning void previously caused compile errors. Fix that by
substituting SPSEmpty placeholder values.
The file was modifiedcompiler-rt/lib/orc/wrapper_function_utils.h (diff)
The file was modifiedcompiler-rt/lib/orc/unittests/wrapper_function_utils_test.cpp (diff)
Commit d0a5d8611935b548e1ec546b49201d47ac0a762c by CarlosAlbertoEnciso
[Debug-Info][CodeView] Fix GUID string generation for MSVC generated objects.

This patch is to address https://bugs.llvm.org/show_bug.cgi?id=50459.
  YAML:455:28: error: GUID strings are 38 characters long

The valid format for a GUID is {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
where X is a hex digit (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F).
The length of the individual components must be: 8, 4, 4, 4, 12.

For some cases, the converted string generated by obj2yaml, does not
comply with those lengths. yaml2obj checks that the GUID string must
be 38 characters including the dashes and braces.

Reviewed By: amccarth

Differential Revision: https://reviews.llvm.org/D103089
The file was modifiedllvm/lib/DebugInfo/CodeView/Formatters.cpp (diff)
The file was addedllvm/test/tools/obj2yaml/COFF/Inputs/test-1.o
The file was addedllvm/test/tools/obj2yaml/COFF/Inputs/test-2.o
The file was addedllvm/test/tools/obj2yaml/COFF/Inputs/test-3.o
The file was addedllvm/test/tools/obj2yaml/COFF/Inputs/test-5.o
The file was modifiedllvm/unittests/DebugInfo/CodeView/CMakeLists.txt (diff)
The file was addedllvm/test/tools/obj2yaml/COFF/Inputs/test-6.o
The file was addedllvm/test/tools/obj2yaml/COFF/test-1.test
The file was addedllvm/test/tools/obj2yaml/COFF/test-5.test
The file was addedllvm/test/tools/obj2yaml/COFF/test-3.test
The file was addedllvm/test/tools/obj2yaml/COFF/test-4.test
The file was addedllvm/test/tools/obj2yaml/COFF/Inputs/test-4.o
The file was addedllvm/test/tools/obj2yaml/COFF/test-2.test
The file was addedllvm/test/tools/obj2yaml/COFF/test-6.test
The file was addedllvm/unittests/DebugInfo/CodeView/GUIDFormatTest.cpp
Commit d8c5a4d6b6efad405c71ead8997276d8d3a7c5ad by llvmgnsyncbot
[gn build] Port d0a5d8611935
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/DebugInfo/CodeView/BUILD.gn (diff)
Commit 6c7be4176703fff69d20acc466a879e080346f30 by tpopp
Support buffers in LinalgFoldUnitExtentDims

This doesn't add any canonicalizations, but executes the same
simplification on bufferSemantic linalg.generic ops by using
linalg::ReshapeOp instead of linalg::TensorReshapeOp.

Differential Revision: https://reviews.llvm.org/D103513
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp (diff)
The file was modifiedmlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir (diff)
Commit 454d92ac3b3b13f5c8b3f57e03b2d93f0cf60738 by gchatelet
[libc] Add a set of elementary operations

Resubmission of D100646 now making sure that we handle cases were `__builtin_memcpy_inline` is not available.

Original commit message:
Each of these elementary operations can be assembled to support higher order constructs (Overlapping access, Loop, Aligned Loop).
The patch does not compile yet as it depends on other ones (D100571, D100631) but it allows to get the conversation started.

A self-contained version of this code is available at https://godbolt.org/z/e1x6xdaxM
The file was addedlibc/test/src/string/memory_utils/elements_test.cpp
The file was modifiedlibc/src/string/aarch64/memcpy.cpp (diff)
The file was modifiedlibc/src/string/CMakeLists.txt (diff)
The file was modifiedlibc/src/string/memory_utils/CMakeLists.txt (diff)
The file was addedlibc/test/src/string/memory_utils/memory_access_test.cpp
The file was modifiedlibc/test/src/string/memory_utils/CMakeLists.txt (diff)
The file was modifiedlibc/src/string/memory_utils/memset_utils.h (diff)
The file was removedlibc/test/src/string/memory_utils/memcpy_utils_test.cpp
The file was addedlibc/src/string/memory_utils/elements.h
The file was modifiedlibc/src/string/x86_64/memcpy.cpp (diff)
The file was modifiedlibc/src/string/memcpy.cpp (diff)
The file was removedlibc/src/string/memory_utils/memcpy_utils.h
The file was addedlibc/src/string/memory_utils/elements_x86.h
Commit c11032ad9a6c4523d0d9d591ebce82c87a9fb3a0 by gchatelet
Revert "[libc] Add a set of elementary operations"

This reverts commit 454d92ac3b3b13f5c8b3f57e03b2d93f0cf60738.
The file was addedlibc/src/string/memory_utils/memcpy_utils.h
The file was removedlibc/src/string/memory_utils/elements.h
The file was addedlibc/test/src/string/memory_utils/memcpy_utils_test.cpp
The file was modifiedlibc/src/string/memcpy.cpp (diff)
The file was modifiedlibc/src/string/memory_utils/memset_utils.h (diff)
The file was modifiedlibc/src/string/aarch64/memcpy.cpp (diff)
The file was removedlibc/src/string/memory_utils/elements_x86.h
The file was modifiedlibc/src/string/memory_utils/CMakeLists.txt (diff)
The file was modifiedlibc/test/src/string/memory_utils/CMakeLists.txt (diff)
The file was removedlibc/test/src/string/memory_utils/elements_test.cpp
The file was modifiedlibc/src/string/x86_64/memcpy.cpp (diff)
The file was removedlibc/test/src/string/memory_utils/memory_access_test.cpp
The file was modifiedlibc/src/string/CMakeLists.txt (diff)
Commit 244601f4720d9cda6e81ea1908f3ce905a4bcb0e by Alexander.Richardson
[builtins] Allow compiling the builtins without libc headers

When compiled with -ffreestanding, we should not assume that headers
declaring functions such as abort() are available. While the compiler may
still emit calls to those functions [1], we should not require the headers
to build compiler-rt since that can result in a cyclic dependency graph:
The compiler-rt functions might be required to build libc.so, but the libc
headers such as stdlib.h might only be available once libc has been built.

[1] From https://gcc.gnu.org/onlinedocs/gcc/Standards.html:
GCC requires the freestanding environment provide memcpy, memmove,
memset and memcmp. Finally, if __builtin_trap is used, and the target
does not implement the trap pattern, then GCC emits a call to abort.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D103876
The file was modifiedcompiler-rt/lib/builtins/atomic.c (diff)
The file was modifiedcompiler-rt/lib/builtins/int_util.c (diff)
The file was modifiedcompiler-rt/lib/builtins/clear_cache.c (diff)
Commit f5dc511c538745df1ef4c5a22b99b56747f32edc by jay.foad
[IR] Remove forward declaration of GraphTraits from Type.h

This has been unnecessary since r352353 removed GraphTraits
specializations for Type, except that a couple of other headers were
accidentally relying on this declaration.

Differential Revision: https://reviews.llvm.org/D104119
The file was modifiedllvm/include/llvm/IR/Type.h (diff)
The file was modifiedllvm/include/llvm/Analysis/LazyCallGraph.h (diff)
The file was modifiedllvm/include/llvm/IR/ModuleSummaryIndex.h (diff)
Commit b6ab4f1a8b6546b67dbcc3612f33c26d9b72a5cc by springerm
[mlir][linalg] Fold linalg.pad_tensor if src type == result type

Fold PadTensorOp to source if source type and result type have static shape and are equal.

Differential Revision: https://reviews.llvm.org/D103778
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp (diff)
The file was modifiedmlir/test/Dialect/Linalg/canonicalize.mlir (diff)
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td (diff)
Commit 54bd95cd96bc7305219b594f95d7d1f447ee4c94 by krasimir
[clang-format] distinguish function type casts after 21c18d5a04316891110cecc2bf37ce51533decba

https://github.com/llvm/llvm-project/commit/21c18d5a04316891110cecc2bf37ce51533decba
improved the detection of multiplication in function call argument lists,
but unintentionally regressed the handling of function type casts (there
were no tests covering those).
This patch improves the detection of function type casts and adds a few tests.

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D104209
The file was modifiedclang/lib/Format/TokenAnnotator.cpp (diff)
The file was modifiedclang/unittests/Format/FormatTest.cpp (diff)
Commit bbebf38b736a12c9582f9ae59c8e245a6ed68cb8 by vsavchenko
[analyzer] Refactor StoreSiteFinder and extract DefaultStoreHandler

After this patch, custom StoreHandlers will also work as expected.

Differential Revision: https://reviews.llvm.org/D103644
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h (diff)
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (diff)
Commit 85f475c979aa49b1b833c9e66af9cb35eafd02c7 by vsavchenko
[analyzer] Extract ControlDependencyHandler

Differential Revision: https://reviews.llvm.org/D103677
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (diff)
Commit 1639dcb2798469c4372e50bcb6b4cf36ecffd9ce by vsavchenko
[analyzer] Extract NilReceiverHandler

Differential Revision: https://reviews.llvm.org/D103902
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (diff)
Commit 40cb73bd20735051eb8f2d43735097d2ff46f0a7 by vsavchenko
[analyzer] Extract ArrayIndexHandler

One interesting problem was discovered here.  When we do interrupt
Tracker's track flow, we want to interrupt only it and not all the
other flows recursively.

Differential Revision: https://reviews.llvm.org/D103914
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (diff)
Commit 2e490676ea2eb419e7b2f54e1e2e537d5244ebbc by vsavchenko
[analyzer] Extract InterestingLValueHandler

Differential Revision: https://reviews.llvm.org/D103917
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (diff)
Commit 6e6a26b8f0ea8300d5a814e4150e225c33ec25de by vsavchenko
[analyzer] Extract InlinedFunctionCallHandler

Differential Revision: https://reviews.llvm.org/D103961
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (diff)
Commit 16f7a952ec3e0f362690c6449951866100c6f76c by vsavchenko
[analyzer] Simplify the process of producing notes for stores

Differential Revision: https://reviews.llvm.org/D104046
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (diff)
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h (diff)
Commit 13f0b85212275fb6f724b14c2c5385385e5e723f by Alexander.Richardson
Fix Windows builders after 244601f4720d9cda6e81ea1908f3ce905a4bcb0e

Apparently __builtin_abort() is not supported when targetting Windows.
This should fix the following builder errors:
clang_rt.builtins-x86_64.lib(int_util.c.obj) : error LNK2019: unresolved
external symbol __builtin_abort referenced in function __compilerrt_abort_impl
The file was modifiedcompiler-rt/lib/builtins/int_util.c (diff)
Commit beb5213a2ee56bbf554ccdd1908c48d10e244dab by andrea.dibiagio
[MCA][InstrBuilder] Check for the presence of flag VariadicOpsAreDefs.

This patch fixes the logic that checks for variadic register definitions,

Before llvm-svn 348114 (commit 4cf35b4ab0b), it was not possible to explicitly
mark variadic operands as definitions. By default, variadic operands of an
MCInst were always assumed to be uses. A number of had-hoc checks were
introduced in the InstrBuilder to fix the processing of variadic register
operands of ARM ldm/stm variants.

This patch simply replaces those old (and buggy) checks with a much simpler (and
correct) check for MCID::Flag::VariadicOpsAreDefs.
The file was modifiedllvm/test/tools/llvm-mca/ARM/cortex-a57-carryover.s (diff)
The file was modifiedllvm/lib/MCA/InstrBuilder.cpp (diff)
Commit eadd54f2741f9dc7307512382a7c8fb49aa840d0 by vsavchenko
[analyzer] Decouple NoteTag from its Factory

This allows us to create other types of tags that carry useful
bits of information alongside.

Differential Revision: https://reviews.llvm.org/D104135
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h (diff)
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h (diff)
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h (diff)
The file was modifiedclang/lib/StaticAnalyzer/Core/CoreEngine.cpp (diff)
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h (diff)
Commit 88da6c1ead3f1b0431e6cfa054d2645612f049ce by lebedev.ri
[X86] Schedule-model second (mask) output of GATHER instruction

Much like `mulx`'s `WriteIMulH`, there are two outputs of
AVX2 GATHER instructions. This was changed back in rL160110,
but the sched model change wasn't present.

So right now, for sched models that are marked as complete
(`znver3` only now), codegen'ning `GATHER` results in a crash:
```
DefIdx 1 exceeds machine model writes for early-clobber renamable $ymm3, dead early-clobber renamable $ymm2 = VPGATHERDDYrm killed renamable $ymm3(tied-def 0), undef renamable $rax, 4, renamable $ymm0, 0, $noreg, killed renamable $ymm2(tied-def 1) :: (load 32, align 1)
```
https://godbolt.org/z/Ks7zW7WGh

I'm guessing we need to deal with this like we deal with `WriteIMulH`.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D104205
The file was modifiedllvm/lib/Target/X86/X86SchedHaswell.td (diff)
The file was modifiedllvm/lib/Target/X86/X86Schedule.td (diff)
The file was modifiedllvm/lib/Target/X86/X86ScheduleBdVer2.td (diff)
The file was modifiedllvm/lib/Target/X86/X86ScheduleSLM.td (diff)
The file was modifiedllvm/lib/Target/X86/X86SchedSkylakeClient.td (diff)
The file was modifiedllvm/lib/Target/X86/X86ScheduleAtom.td (diff)
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver1.td (diff)
The file was modifiedllvm/lib/Target/X86/X86InstrSSE.td (diff)
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td (diff)
The file was modifiedllvm/lib/Target/X86/X86SchedBroadwell.td (diff)
The file was modifiedllvm/lib/Target/X86/X86SchedSkylakeServer.td (diff)
The file was modifiedllvm/lib/Target/X86/X86ScheduleBtVer2.td (diff)
The file was modifiedllvm/lib/Target/X86/X86InstrAVX512.td (diff)
The file was modifiedllvm/lib/Target/X86/X86SchedSandyBridge.td (diff)
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver2.td (diff)
Commit fffb975095119adb5f91be4e3c83ac0cb4b1602c by jan.kratochvil
[lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

libstdc++ since version 11 has a conditional compilation based on
[[no_unique_address]] availability whether one element is either
inherited or put there as a field with [[no_unique_address]].

The code comment is by teemperor.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104283
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp (diff)