SuccessChanges

Summary

  1. [llvm-objcopy][ELF] Fix removing SHT_GROUP sections. (details)
  2. [llvm-objcopy][ELF] Fix removing a group member. (details)
  3. [DAGCombiner] avoid unnecessary indirection from SDNode/SDValue; NFCI (details)
  4. [llvm-readobj] - Cleanup the DwarfCFIEH::PrinterContext class. NFCI. (details)
  5. [ModuloSchedule] Allow illegal phis to be moved across stages. (details)
  6. [analyzer] ApiModeling: Add buffer size arg constraint (details)
  7. [CodeGen] Fix warnings in LowerToPredicatedOp (details)
  8. [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved (details)
  9. [SVE] Remove getNumElements() calls in visitGetElementPtrInst (details)
  10. Fix build failure when source is read only (details)
  11. [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints (details)
  12. Move unittest helpers to a shared location (details)
  13. [OpenMP][SYCL] Improve diagnosing of unsupported types usage (details)
  14. Remove SVN logic from find_first_existing_vc_file (details)
  15. [AIX][XCOFF] add symbol priority for the llvm-objdump -D -symbol-description (details)
  16. [ARM] Extra MVE VMLAV reduction patterns (details)
  17. unwind: use a more portable endianness check in EHABI (details)
  18. [lldb/test] Fix TestAppleSimulatorOSType when multiple runtimes are installed (details)
  19. [AMDGPU] Remove duplicate test cases (details)
  20. [analyzer] StdLibraryFunctionsChecker: Add support to lookup types (details)
Commit a9313282cd5413ed498dceb763ebba12ea5bdecd by ikudrin
[llvm-objcopy][ELF] Fix removing SHT_GROUP sections.

When a SHT_GROUP section is removed, but other sections of the group are
kept, the SHF_GROUP flag of these sections should be dropped, otherwise
the resulting ELF file will be malformed.

Differential Revision: https://reviews.llvm.org/D80511
The file was addedllvm/test/tools/llvm-objcopy/ELF/remove-section-group.test
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.h
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.cpp
Commit 5b875bf59b068f3db91c750b24030a7b2bd164aa by ikudrin
[llvm-objcopy][ELF] Fix removing a group member.

When a group member is removed, the corresponding record in the
SHT_GROUP section has to be deleted.

This fixes PR46064.

Differential Revision: https://reviews.llvm.org/D80568
The file was addedllvm/test/tools/llvm-objcopy/ELF/remove-section-in-group.test
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.cpp
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.h
Commit 21dadd774f56778ef68c1ce307205dfbdacc793a by spatel
[DAGCombiner] avoid unnecessary indirection from SDNode/SDValue; NFCI
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit 9819976032c5af8d9109f2077e637c8303e4d6df by grimar
[llvm-readobj] - Cleanup the DwarfCFIEH::PrinterContext class. NFCI.

It would be nice to switch to `reportUniqueWarnings` from
`reportError` in this class, but first of all it needs a cleanup.

This patch:
1) Eliminates autos.
2) Removes code duplication.
3) Changes how the code works with `Expected<>`.
4) Introduces 2 new `using`s to make the code a bit shorter.

Differential revision: https://reviews.llvm.org/D80726
The file was modifiedllvm/tools/llvm-readobj/DwarfCFIEHPrinter.h
Commit d8f2814c913847b1d0e9167dce5973eea3600c7e by hgreving
[ModuloSchedule] Allow illegal phis to be moved across stages.

Fixes a trivial but impactful bug where we did not move illegal phis across stages. This
led to incorrect mappings in certain cases.
The file was modifiedllvm/lib/CodeGen/ModuloSchedule.cpp
Commit bd03ef19beb8a3476d5cd9f744c5fba5ca287c51 by gabor.marton
[analyzer] ApiModeling: Add buffer size arg constraint

Summary:
Introducing a new argument constraint to confine buffer sizes. It is typical in
C APIs that a parameter represents a buffer and another param holds the size of
the buffer (or the size of the data we want to handle from the buffer).

Reviewers: NoQ, Szelethus, Charusso, steakhal

Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77066
The file was modifiedclang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h
The file was modifiedclang/lib/StaticAnalyzer/Core/DynamicSize.cpp
The file was modifiedclang/test/Analysis/std-c-library-functions-arg-constraints.c
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
Commit 205085d4ccf9c367ba70de9d8f0dd74d6f567c24 by david.sherwood
[CodeGen] Fix warnings in LowerToPredicatedOp

When creating a new vector type based on another vector type we
should pass in the element count instead of the number of elements
and scalable flag separately.

I encountered this warning whilst compiling this test:

  CodeGen/AArch64/sve-intrinsics-int-compares.ll

Differential revision: https://reviews.llvm.org/D80621
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Commit 41928c97b6a17264938fc765a6a0656d8b6e86ed by gabor.marton
[analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved

Summary:
Further develop the buffer size argumentum constraint so it can handle sizes
that we can get by multiplying two variables.

Reviewers: Szelethus, NoQ, steakhal

Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77148
The file was modifiedclang/test/Analysis/std-c-library-functions-arg-constraints.c
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
Commit 0609704760d0a94cccdbd243d0d750d74ee6c459 by david.sherwood
[SVE] Remove getNumElements() calls in visitGetElementPtrInst

Replace calls to getNumElements() with getElementCount() in order
to avoid warnings for scalable vectors. The warnings were discovered
by this existing test:

  test/CodeGen/AArch64/sve-gep.ll

Differential revision: https://reviews.llvm.org/D80782
The file was modifiedllvm/lib/IR/Verifier.cpp
Commit 16fef6d0b46f0494c502f8fe416fe841f7b000f6 by sameer.sahasrabuddhe
Fix build failure when source is read only

cmake configure fails when it tries to setup target for llvm_vcsrevision_h
This happens only when source is checked out using repo in a read
only filesystem, because cmake tries to create `.git/logs/HEAD` file.

This patch:
  1. Recovers from failure gracefully.
  2. Ensures that VCSRevision.h is successfully created and updated
     in above scenarios.

Differential Revision: https://reviews.llvm.org/D79400
The file was modifiedllvm/include/llvm/Support/CMakeLists.txt
The file was modifiedllvm/cmake/modules/AddLLVM.cmake
Commit 16506d789084fd037fc61d442da43dd5242872b7 by gabor.marton
[analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints

Summary:
Once we found a matching FunctionDecl for the given summary then we
validate the given constraints against that FunctionDecl. E.g. we
validate that a NotNull constraint is applied only on arguments that
have pointer types.

This is needed because when we matched the signature of the summary we
were working with incomplete function types, i.e. some intricate type
could have been marked as `Irrelevant` in the signature.

Reviewers: NoQ, Szelethus, balazske

Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77658
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
Commit 0e265e315784b4e47f984f8ed9fb7586130bacdc by gribozavr
Move unittest helpers to a shared location

Summary:
unittests/AST/Language.h defines some helpers that we would like to
reuse in other tests, for example, in tests for syntax trees.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, martong, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80792
The file was addedclang/lib/Testing/CommandLineArgs.cpp
The file was addedclang/lib/Testing/CMakeLists.txt
The file was removedclang/unittests/AST/Language.cpp
The file was removedclang/unittests/AST/Language.h
The file was modifiedclang/unittests/AST/MatchVerifier.h
The file was modifiedclang/unittests/AST/StructuralEquivalenceTest.cpp
The file was modifiedclang/unittests/AST/ASTImporterFixtures.h
The file was addedclang/include/clang/Testing/CommandLineArgs.h
The file was modifiedclang/unittests/AST/CMakeLists.txt
The file was modifiedclang/include/clang/module.modulemap
The file was modifiedclang/lib/CMakeLists.txt
Commit cf6cc662eeee2b1416430f517850be9032788e39 by alexey.bader
[OpenMP][SYCL] Improve diagnosing of unsupported types usage

Summary:
Diagnostic is emitted if some declaration of unsupported type
declaration is used inside device code.
Memcpy operations for structs containing member with unsupported type
are allowed. Fixed crash on attempt to emit diagnostic outside of the
functions.

The approach is generalized between SYCL and OpenMP.
CUDA/OMP deferred diagnostic interface is going to be used for SYCL device.

Reviewers: rsmith, rjmccall, ABataev, erichkeane, bader, jdoerfert, aaron.ballman

Reviewed By: jdoerfert

Subscribers: guansong, sstefan1, yaxunl, mgorny, bader, ebevhan, Anastasia, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D74387
The file was modifiedclang/test/Headers/nvptx_device_math_sin.cpp
The file was modifiedclang/test/OpenMP/nvptx_unsupported_type_messages.cpp
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
The file was modifiedclang/test/OpenMP/nvptx_unsupported_type_codegen.cpp
The file was modifiedclang/lib/Sema/CMakeLists.txt
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was addedclang/lib/Sema/SemaSYCL.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Sema/SemaType.cpp
The file was modifiedclang/lib/Sema/Sema.cpp
The file was addedclang/test/SemaSYCL/float128.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/test/Headers/nvptx_device_math_sin.c
The file was modifiedclang/include/clang/Sema/Sema.h
Commit 0384446c7c2458b12ce3ef1c2bdf438af1f78ad7 by sameer.sahasrabuddhe
Remove SVN logic from find_first_existing_vc_file

As LLVM has moved from SVN to git, there is no need to
keep SVN related code. Also, this code piece was never used.

Differential Revision: https://reviews.llvm.org/D79400
The file was modifiedllvm/cmake/modules/AddLLVM.cmake
Commit 34cfed24ebd3a2a9f286877d142a68dbf2c42c96 by diggerlin
[AIX][XCOFF] add symbol priority for the llvm-objdump -D -symbol-description

SUMMARY:
when there are two symbol has the same address. llvm-objdump -D -symbol-description will select symbol based on the following rule:

1. using Label first if there is a Label symbol.
2. If there is not Label, using a symbol which has Storage Mapping class.
3. if more than one symbol has storage mapping class, put the TC0 has the low priority, for other storage mapping class , compare based on the value.

Reviewers: James Henderson ,hubert.reinterpretcast,

Differential Revision: https://reviews.llvm.org/D78387
The file was modifiedllvm/lib/MC/MCDisassembler/MCDisassembler.cpp
The file was modifiedllvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
The file was modifiedllvm/unittests/MC/CMakeLists.txt
The file was modifiedllvm/test/tools/llvm-objdump/XCOFF/disassemble-symbol-description.test
The file was addedllvm/unittests/MC/MCDisassemblerTest.cpp
Commit 747c574b94595c6209185c87e79f51bff46fd4d8 by david.green
[ARM] Extra MVE VMLAV reduction patterns

These patterns for i8 and i16 VMLA's were missing. They end up from
legalized vector.reduce.add.v8i16 and vector.reduce.add.v16i8, and
although the instruction works differently (the mul and add are
performed in a higher precision), I believe it is OK because only an
i8/i16 are demanded from them, and so the results will be the same. At
least, they pass any testing I can think to run on them.

There are some tests that end up looking worse, but are quite artificial
due to passing half vector types through a call boundary. I would not
expect the vmull to realistically come up like that, and a vmlava is
likely better a lot of the time.

Differential Revision: https://reviews.llvm.org/D80524
The file was modifiedllvm/lib/Target/ARM/ARMInstrMVE.td
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vecreduce-mla.ll
Commit 68c50708d1f2b9aee3f10ec710df0b1387f701e5 by Saleem Abdulrasool
unwind: use a more portable endianness check in EHABI

The ARM specific code was trying to determine endianness using the
`__LITTLE_ENDIAN__` macro which is not guaranteed to be defined.
When not defined, it makes libunwind to build the big-endian code even
when the compiler builds for a little-endian target.

This change allows building libunwind with the `musl-gcc` toolchain
which does not define `__LITTLE_ENDIAN__`.  Use `__BYTE_ORDER__`
instead.

Patch by Idan Freiberg!
The file was modifiedlibunwind/src/Unwind-EHABI.cpp
Commit 977f00123a6d94c634d22356cae1da2a22f0e3df by Fred Riss
[lldb/test] Fix TestAppleSimulatorOSType when multiple runtimes are installed

One can have multiple simulator runtimes installed, supporting
various generations of OSs. The logic in TestAppleSimulatorOSType
might select a rnutime older than the one targeted by the current
tools, preventing the executable from running. This commit changes
the test to look for the most recent runtime available instead.
The file was modifiedlldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
Commit 9e0b52e2e68412a9a2add18697f4246e5e5ee5e3 by jay.foad
[AMDGPU] Remove duplicate test cases

The two "2sin" test cases were identical to the "sin_2x" test cases just
above.
The file was modifiedllvm/test/CodeGen/AMDGPU/llvm.sin.ll
Commit 634258b80606c4bb8192077239a089ae5842781a by gabor.marton
[analyzer] StdLibraryFunctionsChecker: Add support to lookup types

Summary:
In this patch I am trying to get rid of the `Irrelevant` types from the
signatures of the functions from the standard C library. For that I've
introduced `lookupType()` to be able to lookup arbitrary types in the global
scope. This makes it possible to define the signatures precisely.

Note 1) `fread`'s signature is now fixed to have the proper `FILE *restrict`
type when C99 is the language.
Note 2) There are still existing `Irrelevant` types, but they are all from
POSIX. I am planning to address those together with the missing POSIX functions
(in D79433).

Reviewers: xazax.hun, NoQ, Szelethus, balazske

Subscribers: whisperity, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80016
The file was addedclang/test/Analysis/std-c-library-functions-lookup.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
The file was addedclang/test/Analysis/std-c-library-functions-lookup.c
The file was modifiedclang/test/Analysis/std-c-library-functions-arg-constraints.c
The file was modifiedclang/test/Analysis/std-c-library-functions.c