SuccessChanges

Summary

  1. [MLIR][docs] Fix typos (details)
  2. [clangd] Reorder a little bit of init code. NFC (details)
  3. [asan][test] Disable malloc-no-intercept.c on Solaris (details)
  4. [SCEV] Use loop guard info when computing the max BE taken count in howFarToZero. (details)
  5. [llvm-readobj] - Fix a warning. (details)
  6. [llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects. (details)
  7. Use different name for auto variable (details)
  8. [lld][ELF][test] Add a couple of test cases for LTO behaviour (details)
  9. [NFC][Docs] fix clang-docs compilation (details)
  10. [llvm-objcopy][NFC] refactor error handling. part 1. (details)
  11. [APFloat] add tests for convert of NAN; NFC (details)
  12. [flang][driver] Remove unnecessary includes in the unittest (NFC) (details)
  13. [flang] [OpenMP 4.5] Adding lit test cases for OpenMP Constructs. (details)
  14. Fix a builtbot failure after 3ed04f93e30121867a813a220452b97aebeb1730. (details)
  15. [Support] On Windows, ensure abort() can be catched several times in a row with CrashRecoveryContext (details)
  16. [lit] Support running tests on Windows without GnuWin32 (details)
  17. [Support] On Unix, let the CrashRecoveryContext return the signal code (details)
  18. [ARM] Check for LSTP side-effects. (details)
  19. [ARM] LowoverheadLoops: add an option to disable tail-predication (details)
  20. [AArch64] Regenerate dag-combine-mul-shl.ll checks (details)
  21. Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions" (details)
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/lib/sanitizer_common/sanitizer_platform_interceptors.h
The file was modifiedcompiler-rt/test/asan/TestCases/malloc-no-intercept.c
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/unittests/Analysis/ScalarEvolutionTest.cpp
The file was modifiedllvm/test/Transforms/LoopVectorize/AArch64/pr36032.ll
The file was modifiedllvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
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 modifiedllvm/tools/llvm-readobj/ARMEHABIPrinter.h
The file was addedllvm/test/tools/llvm-readobj/ELF/ARM/unwind-non-relocatable.test
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/include/clang/Basic/AttrDocs.td
The file was modifiedclang/docs/analyzer/checkers.rst
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/MachOObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOReader.cpp
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOReader.h
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-do10.f90
The file was addedflang/test/Semantics/omp-taskloop-simd01.f90
The file was addedflang/test/Semantics/omp-simd03.f90
The file was addedflang/test/Semantics/omp-single01.f90
The file was addedflang/test/Semantics/omp-do06.f90
The file was addedflang/test/Semantics/omp-do01.f90
The file was addedflang/test/Semantics/omp-task01.f90
The file was addedflang/test/Semantics/omp-do04.f90
The file was addedflang/test/Semantics/omp-parallell01.f90
The file was addedflang/test/Semantics/omp-sections01.f90
The file was addedflang/test/Semantics/omp-single02.f90
The file was addedflang/test/Semantics/omp-taskloop01.f90
The file was addedflang/test/Semantics/omp-simd02.f90
The file was addedflang/test/Semantics/omp-workshare02.f90
The file was addedflang/test/Semantics/omp-taskloop03.f90
The file was addedflang/test/Semantics/omp-do08.f90
The file was addedflang/test/Semantics/omp-simd01.f90
The file was addedflang/test/Semantics/omp-taskloop02.f90
The file was addedflang/test/Semantics/omp-do05.f90
The file was addedflang/test/Semantics/omp-do02.f90
The file was addedflang/test/Semantics/omp-do09.f90
The file was addedflang/test/Semantics/omp-workshare01.f90
The file was addedflang/test/Semantics/omp-parallell02.f90
The file was addedflang/test/Semantics/omp-do07.f90
The file was addedflang/test/Semantics/omp-do03.f90
The file was addedflang/test/Semantics/omp-loop-simd01.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/unittests/Support/CrashRecoveryTest.cpp
The file was modifiedllvm/include/llvm/Support/CrashRecoveryContext.h
The file was modifiedllvm/lib/Support/CrashRecoveryContext.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/lib/Support/Unix/Signals.inc
The file was modifiedclang/tools/driver/driver.cpp
The file was modifiedllvm/unittests/Support/CrashRecoveryTest.cpp
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
The file was modifiedllvm/include/llvm/Support/Signals.h
The file was modifiedllvm/lib/Support/Windows/Signals.inc
Commit 9d9a11c7be037cbbfb5239b72dbeb48dd2601bbc by sam.parker
[ARM] Check for LSTP side-effects.

If the LSTP instruction is inserted with an element count low enough
to immediately predicate some lanes as false, this can have some
unintended effects on any proceeding MVE instructions in the
preheader.

Differential Revision: https://reviews.llvm.org/D88209
The file was modifiedllvm/test/CodeGen/Thumb2/mve-gather-scatter-tailpred.ll
The file was modifiedllvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/mov-after-dlstp.mir
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/iv-two-vcmp.mir
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/lstp-insertion-position.mir
Commit 2fc690ac904c657dad9159926074ec62edebcd8e by sjoerd.meijer
[ARM] LowoverheadLoops: add an option to disable tail-predication

This might be useful for testing. We already have an option -tail-predication
but that controls the MVETailPredication pass.  This
-arm-loloops-disable-tail-pred is just for disabling it in the LowoverheadLoops
pass.

Differential Revision: https://reviews.llvm.org/D88212
The file was modifiedllvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
The file was modifiedllvm/lib/Target/ARM/MVETailPredication.cpp
The file was addedllvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-disabled-in-loloops.ll
Commit a815578c31775f3bca57a6ede65787aa152bafbd by llvm-dev
[AArch64] Regenerate dag-combine-mul-shl.ll checks
The file was modifiedllvm/test/CodeGen/AArch64/dag-combine-mul-shl.ll
Commit e39da8ab6a286ac777d5fe7799f1eb782cf99938 by Yaxun.Liu
Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"

This recommits 7f1f89ec8d9944559042bb6d3b1132eabe3409de and
40df06cdafc010002fc9cfe1dda73d689b7d27a6 after fixing memory
sanitizer failure.
The file was modifiedclang/lib/Driver/ToolChains/Cuda.cpp
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was modifiedclang/utils/TableGen/ClangDiagnosticsEmitter.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticDriver.h
The file was modifiedclang/lib/Driver/ToolChains/HIP.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was addedclang/test/SemaCUDA/deferred-oeverload.cu
The file was modifiedclang/include/clang/Basic/DiagnosticLex.h
The file was modifiedclang/lib/Sema/SemaOverload.cpp
The file was modifiedclang/tools/diagtool/DiagnosticNames.cpp
The file was modifiedclang/lib/Sema/AnalysisBasedWarnings.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticCrossTU.h
The file was modifiedclang/include/clang/Basic/DiagnosticAST.h
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/include/clang/Basic/DiagnosticRefactoring.h
The file was addedclang/test/TableGen/deferred-diag.td
The file was modifiedclang/lib/Sema/SemaCUDA.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiate.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticIDs.h
The file was modifiedclang/lib/Sema/SemaExprObjC.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.def
The file was modifiedclang/include/clang/Basic/DiagnosticFrontend.h
The file was modifiedclang/lib/Basic/DiagnosticIDs.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/lib/Sema/SemaTemplateVariadic.cpp
The file was modifiedclang/test/TableGen/DiagnosticBase.inc
The file was modifiedclang/include/clang/Basic/DiagnosticParse.h
The file was modifiedclang/lib/Sema/SemaStmt.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticAnalysis.h
The file was modifiedclang/include/clang/Basic/DiagnosticSema.h
The file was modifiedclang/lib/Sema/SemaAttr.cpp
The file was modifiedclang-tools-extra/clangd/Diagnostics.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSerialization.h
The file was modifiedclang/include/clang/Basic/Diagnostic.td
The file was modifiedclang/lib/Sema/SemaSYCL.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/lib/Sema/SemaStmtAsm.cpp
The file was modifiedclang/lib/Sema/SemaType.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticComment.h
The file was modifiedclang/include/clang/Driver/Options.td