SuccessChanges

Summary

  1. [clangd] Disable suffix matching fallback for C during include insertion (details)
  2. [clangd] Fix comment. NFC (details)
  3. [llvm-objcopy][MachO] Fix --add-section (details)
  4. [mlir] Stop allowing LLVMType Int arguments for GPULaunchFuncOp. (details)
  5. [SVE] Add new isKnownXX comparison functions to TypeSize (details)
  6. [clang][Sema] Use enumerator instead of hard-coded constant (details)
  7. [unittests] Use std::make_tuple to make some toolchains happy again (details)
  8. [llvm] Use instead of  in IRSimilarityIdentifierTest.cpp. (details)
  9. [MLIR][docs] Fix typos (details)
  10. [clangd] Reorder a little bit of init code. NFC (details)
  11. [asan][test] Disable malloc-no-intercept.c on Solaris (details)
  12. [SCEV] Use loop guard info when computing the max BE taken count in howFarToZero. (details)
  13. [llvm-readobj] - Fix a warning. (details)
  14. [llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects. (details)
  15. Use different name for auto variable (details)
  16. [lld][ELF][test] Add a couple of test cases for LTO behaviour (details)
  17. [NFC][Docs] fix clang-docs compilation (details)
  18. [llvm-objcopy][NFC] refactor error handling. part 1. (details)
  19. [APFloat] add tests for convert of NAN; NFC (details)
  20. [flang][driver] Remove unnecessary includes in the unittest (NFC) (details)
  21. [flang] [OpenMP 4.5] Adding lit test cases for OpenMP Constructs. (details)
  22. Fix a builtbot failure after 3ed04f93e30121867a813a220452b97aebeb1730. (details)
  23. [Support] On Windows, ensure abort() can be catched several times in a row with CrashRecoveryContext (details)
  24. [lit] Support running tests on Windows without GnuWin32 (details)
  25. [Support] On Unix, let the CrashRecoveryContext return the signal code (details)
Commit 64168c6d996b6fdd017488785e0e9ce5ce05be54 by kadircet
[clangd] Disable suffix matching fallback for C during include insertion

Clangd currently doesn't respect language and breaks the builds with
include insertion for C. This patch aims to stop the bleeding by not mapping
back to CPP standard library headers.

Improves https://github.com/clangd/clangd/issues/376.

Differential Revision: https://reviews.llvm.org/D88144
The file was modifiedclang-tools-extra/clangd/unittests/CanonicalIncludesTests.cpp
The file was modifiedclang-tools-extra/clangd/index/CanonicalIncludes.cpp
Commit 98756d865b696bece858ff0832ed3687b6b8ba4b by sam.mccall
[clangd] Fix comment. NFC
The file was modifiedclang-tools-extra/clangd/XRefs.cpp
Commit e60a760b7da970b6eeabc26faa9e065ec7cec1a8 by alexshap
[llvm-objcopy][MachO] Fix --add-section

This diff fixes --add-section functionality and simplifies the tests organization.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D87497
The file was addedllvm/test/tools/llvm-objcopy/MachO/add-section-error.test
The file was removedllvm/test/tools/llvm-objcopy/MachO/add-section.test
The file was modifiedllvm/tools/llvm-objcopy/MachO/Object.cpp
The file was addedllvm/test/tools/llvm-objcopy/MachO/add-section-32.test
The file was modifiedllvm/tools/llvm-objcopy/MachO/Object.h
The file was addedllvm/test/tools/llvm-objcopy/MachO/add-section-64.test
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
Commit 56ffb8d1697932c1097fba3315dba6d9e55b7bb8 by pifon
[mlir] Stop allowing LLVMType Int arguments for GPULaunchFuncOp.

Conversion to LLVM becomes confusing and incorrect if someone tries to lower
STD -> LLVM and only then GPULaunchFuncOp to LLVM separately. Although it is
technically allowed now, it works incorrectly because of the argument
promotion. The correct way to use this conversion pattern is to add to the
STD->LLVM patterns before running the pass.

Differential Revision: https://reviews.llvm.org/D88147
The file was modifiedmlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUOps.td
Commit 4035cb7ac5755357222b6a83d76bdc4c2d718c54 by david.sherwood
[SVE] Add new isKnownXX comparison functions to TypeSize

This patch introduces four new comparison functions:

  isKnownLT, isKnownLE, isKnownGT, isKnownGE

that return true if we know at compile time that a particular
condition is met, i.e. that one size is definitely greater than
another. The existing operators <,>,<=,>= remain in the code for
now, but over time we would like to remove them and change the
code to use the isKnownXY routines instead. These functions do
not assert like the existing operators because the caller is
expected to properly deal with cases where we return false by
analysing the scalable properties. I've made more of an effort
to deal with cases where there are mixed comparisons, i.e. between
fixed width and scalable types.

I've also added some knownBitsXY routines to the EVT and MVT
classes that call the equivalent TypeSize::isKnownXY routines.
I've changed the existing bitsXY functions to call their knownBitsXY
equivalents and added asserts that the scalable properties match.
Again, over time we expect to migrate callers to use knownBitsXY
and make the code more aware of the scalable nature of the sizes.

Differential revision: https://reviews.llvm.org/D88098
The file was modifiedllvm/include/llvm/CodeGen/ValueTypes.h
The file was modifiedllvm/include/llvm/Support/MachineValueType.h
The file was modifiedllvm/include/llvm/Support/TypeSize.h
Commit 8cc842a95072aaa87b5067a12aa9ef5b3ac8e592 by mikhail.maltsev
[clang][Sema] Use enumerator instead of hard-coded constant

Sema::DiagnoseSwiftName uses the constant 12 instead of the
corresponding enumerator ExpectedFunctionWithProtoType. This is
fragile and will fail if a new value gets added in the middle of the
enum.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D88164
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
Commit a1217620a87f66616c15e869d56783ba18e51b12 by mikael.holmen
[unittests] Use std::make_tuple to make some toolchains happy again

My toolchain stopped working (LLVM 8.0, libstdc++ 5.4.0) after 577adda:

06:25:37 ../unittests/Support/Path.cpp:91:7: error: chosen constructor is explicit in copy-initialization
06:25:37       {"", false, false},  {"/", true, true},      {"/foo", true, true},
06:25:37       ^~~~~~~~~~~~~~~~~~
06:25:37 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
06:25:37         constexpr tuple(_UElements&&... __elements)
06:25:37                   ^

This commit adds explicit calls to std::make_tuple to work around
the problem.
The file was modifiedllvm/unittests/Support/Path.cpp
Commit a90d72127a814ea242227456be711aca07cc83a6 by pifon
[llvm] Use instead of  in IRSimilarityIdentifierTest.cpp.
The file was modifiedllvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp
Commit 5ad06e43992a766fe048a1b964fd6fd1f10ade71 by georgemitenk0v
[MLIR][docs] Fix typos

Fixed typos in SPIR-V to LLVM manual.

Reviewed By: georgemitenkov

Differential Revision: https://reviews.llvm.org/D88202
The file was modifiedmlir/docs/SPIRVToLLVMDialectConversion.md
Commit 00e05b12c76c396688cd8d4caac09a2e96851fd9 by sam.mccall
[clangd] Reorder a little bit of init code. NFC

This makes it possible to do something else (run checks) instead of
starting the server, with all config applied.
The file was modifiedclang-tools-extra/clangd/tool/ClangdMain.cpp
Commit 15c9af5618c8c4a810994df53543af9060086a8e by ro
[asan][test] Disable malloc-no-intercept.c on Solaris

`TestCases/malloc-no-intercept.c` `FAIL`s on Solaris/x86, e.g. with
`-Dtestfunc=mallinfo`:

  /usr/bin/ld: /tmp/malloc-no-intercept-586529.o: in function `main':
  /vol/llvm/src/llvm-project/dist/compiler-rt/test/asan/TestCases/malloc-no-intercept.c:30: undefined reference to `nonexistent_function'
  clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

This is not surprising, actually:

- `mallinfo` and `mallopt` only exist in `libmalloc`
- `pvalloc` doesn't exist all all
- `cfree` does exist in `libc`, but isn't declared in any public header and
  the OpenSolaris sources reveal that it has a different signature than on
  Linux
- only `memalign` is a public interface

To avoid this, this patch disables the interceptors for all but `meminfo`.
Additionally, the test is marked `UNSUPPORTED` on Solaris since the
`memalign` and `cfree` variants **do** link on Solaris.

Tested on `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D87898
The file was modifiedcompiler-rt/test/asan/TestCases/malloc-no-intercept.c
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
Commit d4ddf63fc40cfbbc348adcc45cdc6f6d78268c5c by flo
[SCEV] Use loop guard info when computing the max BE taken count in howFarToZero.

For some expressions, we can use information from loop guards when
we are looking for a maximum. This patch applies information from
loop guards to the expression used to compute the maximum backedge
taken count in howFarToZero. It currently replaces an unknown
expression X with UMin(X, Y), if the loop is guarded by
X ult Y.

This patch is minimal in what conditions it applies, and there
are a few TODOs to generalize.

This partly addresses PR40961. We will also need an update to
LV to address it completely.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D67178
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
The file was modifiedllvm/test/Transforms/LoopVectorize/AArch64/pr36032.ll
The file was modifiedllvm/unittests/Analysis/ScalarEvolutionTest.cpp
The file was modifiedllvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
Commit 5bddaf6dbf77085863346d3171023e30972b7323 by grimar
[llvm-readobj] - Fix a warning.

In a post review comments for D88097 it was mentioned that code
triggers bunch of warnings of the form:

llvm/tools/llvm-readobj/ELFDumper.cpp:5299:28: warning: loop variable 'Note' is always a copy because
the range of type 'iterator_range<llvm::object::ELFFile<llvm::object::ELFType<llvm::support::big, true> >::Elf_Note_Iterator>'
(aka 'iterator_range<Elf_Note_Iterator_Impl<ELFType<(llvm::support::endianness)0U, true> > >') does not return a reference [-Wrange-loop-analysis]
      for (const Elf_Note &Note : this->Obj.notes(P, Err))

It happens because Elf_Note is always copied here:

Elf_Note_Impl<ELFT> operator*() const {
  assert(Nhdr && "dereferenced ELF note end iterator");
  return Elf_Note_Impl<ELFT>(*Nhdr);
}

This patch fixes the issue by removing a reference.
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit bb0597067d1e7410e67d8c7d8a4c0ec9e6b26cd0 by grimar
[llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects.

This is the first patch for https://bugs.llvm.org/show_bug.cgi?id=47581.

Currently -u does not compute function addresses correctly and
dumps broken addresses for non-relocatable objects.

ARM spec says:
"An index table entry consists of 2 words.
The first word contains a prel31 offset (see Relocations) to the start of a function, with bit 31 clear."
...
"The relocated 31 bits form a place-relative signed offset to the referenced entity.
For brevity, this document will refer to the results of these relocations as "prel31 offsets"."

(https://developer.arm.com/documentation/ihi0038/c/?lang=en#index-table-entries)
(https://developer.arm.com/documentation/ihi0038/c/?lang=en#relocations)

Currently we use an address of the SHT_ARM_EXIDX section instead of an address of an entry
in computations. As a result we compute an offset that is not really "place-relative",
but section relative, what is wrong.

The patch fixes this issue.

Differential revision: https://reviews.llvm.org/D88076
The file was addedllvm/test/tools/llvm-readobj/ELF/ARM/unwind-non-relocatable.test
The file was modifiedllvm/tools/llvm-readobj/ARMEHABIPrinter.h
Commit 590cc068c160f3b623d47fb34fd1d26848cb0e0a by sepavloff
Use different name for auto variable

Without this change GCC 5.4.0 failed to compile JSON.cpp with the error:

    .../llvm-project/llvm/lib/Support/JSON.cpp: In lambda function:
    .../llvm-project/llvm/lib/Support/JSON.cpp:291:29: error: use of 'V' before deduction of 'auto'
           for (const auto &V : *V.getAsArray())
The file was modifiedllvm/lib/Support/JSON.cpp
Commit a4e42601d44b39fb0b2782344f5ed4ea53de5f20 by james.henderson
[lld][ELF][test] Add a couple of test cases for LTO behaviour

This patch expands two LTO test cases to check other aspects.

1) weak.ll has been expanded to show that it doesn't matter whether the
   first appearance of a weak symbol appears in a bitcode file or native
   object - that one is picked.
2) reproduce-lto.ll has been expanded to show that the bitcode files are
   stored in the reproduce package and that intermediate files (such as
   the LTO-compiled object) are not.

Differential Revision: https://reviews.llvm.org/D88094

Reviewed by: grimar, MaskRay
The file was modifiedlld/test/ELF/reproduce-lto.s
The file was modifiedlld/test/ELF/lto/weak.ll
Commit 4e534900476d2a5c620e74ddb9c9e7d321e6d443 by development
[NFC][Docs] fix clang-docs compilation
The file was modifiedclang/docs/analyzer/checkers.rst
The file was modifiedclang/include/clang/Basic/AttrDocs.td
Commit 3ed04f93e30121867a813a220452b97aebeb1730 by a.v.lapshin
[llvm-objcopy][NFC] refactor error handling. part 1.

Remove usages of special error reporting functions(error(),
reportError()). This patch is extracted from D87987.
Errors are reported as Expected<>/Error returning values.
This part is for MachO subfolder of llvm-objcopy.

Testing: check-all.

Reviewed By: jhenderson, alexshap

Differential Revision: https://reviews.llvm.org/D88113
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOReader.h
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOReader.cpp
Commit b2c46633d1296a9080098abc4e6c6214d19005c0 by spatel
[APFloat] add tests for convert of NAN; NFC

More coverage for the bug fix proposed in D87835.
The file was modifiedllvm/unittests/ADT/APFloatTest.cpp
Commit 10c94d8cf876952edb0dee20219259166c27c21d by andrzej.warzynski
[flang][driver] Remove unnecessary includes in the unittest (NFC)

Differential Revision: https://reviews.llvm.org/D88219
The file was modifiedflang/unittests/Frontend/CompilerInstanceTest.cpp
Commit 956a84da0616eb761297b46aa65750d738fb1544 by david.truby
    [flang] [OpenMP 4.5] Adding lit test cases for OpenMP Constructs.

1. Section 2.5   : Parallel Construct
2. Section 2.7.1 : Loop Construct
3. Section 2.7.2 : Sections Construct
4. Section 2.7.3 : Single Construct
5. Section 2.7.4 : Workshare Construct
6. Section 2.8.1 : Simd Construct
7. Section 2.8.3 : Loop Simd Construct
8. Section 2.9.1 : Task Construct
9. Section 2.9.2 : Taskloop Construct
10. Section 2.9.3 : Taskloop Simd Construct

Most of the test cases added as part of this change contains semantic errors except few cases which are semantically correct but thrown a semantic error.

Currently flang is not throwing the errors for these cases and throwing semantic errors for the following correct test cases

{omp-do03.f90 , omp-loop-simd01.f90 , omp-simd02.f90 , omp-taskloop01.f90}

Hence, all the test cases are marked as XFAIL.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D87908
The file was addedflang/test/Semantics/omp-do05.f90
The file was addedflang/test/Semantics/omp-do09.f90
The file was addedflang/test/Semantics/omp-do02.f90
The file was addedflang/test/Semantics/omp-do07.f90
The file was addedflang/test/Semantics/omp-simd03.f90
The file was addedflang/test/Semantics/omp-taskloop-simd01.f90
The file was addedflang/test/Semantics/omp-do03.f90
The file was addedflang/test/Semantics/omp-workshare02.f90
The file was addedflang/test/Semantics/omp-parallell02.f90
The file was addedflang/test/Semantics/omp-do08.f90
The file was addedflang/test/Semantics/omp-loop-simd01.f90
The file was addedflang/test/Semantics/omp-parallell01.f90
The file was addedflang/test/Semantics/omp-taskloop03.f90
The file was addedflang/test/Semantics/omp-do01.f90
The file was addedflang/test/Semantics/omp-sections01.f90
The file was addedflang/test/Semantics/omp-simd02.f90
The file was addedflang/test/Semantics/omp-simd01.f90
The file was addedflang/test/Semantics/omp-single01.f90
The file was addedflang/test/Semantics/omp-single02.f90
The file was addedflang/test/Semantics/omp-do04.f90
The file was addedflang/test/Semantics/omp-workshare01.f90
The file was addedflang/test/Semantics/omp-taskloop02.f90
The file was addedflang/test/Semantics/omp-task01.f90
The file was addedflang/test/Semantics/omp-taskloop01.f90
The file was addedflang/test/Semantics/omp-do06.f90
The file was addedflang/test/Semantics/omp-do10.f90
Commit 4da6927de47074f56531c2e7e2eecc4d6a1f09ec by a.v.lapshin
Fix a builtbot failure after 3ed04f93e30121867a813a220452b97aebeb1730.
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOReader.cpp
Commit 24f510570fedf2ac6ea421478c7500d777c8c3c6 by alexandre.ganea
[Support] On Windows, ensure abort() can be catched several times in a row with CrashRecoveryContext

Before this patch, the CrashRecoveryContext would only catch the first abort(). Any further calls to abort() inside subsquent CrashRecoveryContexts would not be catched. This is because the Windows CRT removes the abort() handler before calling it.

This is part of https://reviews.llvm.org/D70378
The file was modifiedllvm/include/llvm/Support/CrashRecoveryContext.h
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
The file was modifiedllvm/unittests/Support/CrashRecoveryTest.cpp
Commit b3418cb4eb1456c41606f4621dcfa362fe54183c by alexandre.ganea
[lit] Support running tests on Windows without GnuWin32

Historically, we have told contributors that GnuWin32 is a pre-requisite
because our tests depend on utilities such as sed, grep, diff, and more.
However, Git on Windows includes versions of these utilities in its
installation.  Furthermore, GnuWin32 has not been updated in many years.
For these reasons, it makes sense to have the ability to run llvm tests
in a way that is both:
  a) Easier on the user (less stuff to install)
  b) More up-to-date (The verions that ship with git are at least as
     new, if not newer, than the versions in GnuWin32.

We add support for this here by attempting to detect where Git is
installed using the Windows registry, confirming the existence of
several common Unix tools, and then adding this location to lit's PATH
environment.

Differential Revision: https://reviews.llvm.org/D84380
The file was modifiedllvm/utils/lit/lit/llvm/config.py
Commit f5314d15af4f4514103ea12c74cb208538b8bef5 by alexandre.ganea
[Support] On Unix, let the CrashRecoveryContext return the signal code

Before this patch, the CrashRecoveryContext was returning -2 upon a signal, like ExecuteAndWait does. This didn't match the behavior on Windows, where the the exception code was returned.

We now return the signal's code, which optionally allows for re-throwing the signal later. Doing so requires all custom handlers to be removed first, through llvm::sys::unregisterHandlers() which we made a public API.

This is part of https://reviews.llvm.org/D70378
The file was modifiedllvm/include/llvm/Support/Signals.h
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
The file was modifiedllvm/lib/Support/Unix/Signals.inc
The file was modifiedclang/tools/driver/driver.cpp
The file was modifiedllvm/lib/Support/Windows/Signals.inc
The file was modifiedllvm/unittests/Support/CrashRecoveryTest.cpp