Changes

Summary

  1. [ARM] Teach getIntImmCostInst about the cost of saturating fp converts (details)
  2. [openmp][amdgpu] Disable three tests in preparation for new runtime (details)
  3. [NFC][sanitizer] Check &real_pthread_join (details)
  4. [clang-format] Add better support for co-routinues (details)
  5. [GlobalOpt] Add test for PR39751 (NFC) (details)
  6. [llvm-c] Make LLVMAddAlias opaque pointer compatible (details)
  7. [fir] Add fir numeric intrinsic runtime call builder (details)
  8. [clangd] IncludeClenaer: Don't mark forward declarations of a class if it's declared in the main file (details)
  9. [ORC] Fix ambiguous call to overloaded function. (details)
  10. [VE][NFC] Fix use-after-free in PVFMK expansion (details)
  11. [BuildLibCalls] Add additional attrs to memcpy_chk. (details)
  12. [ELF] Discard input .note.gnu.build-id even with default --build-id=none (details)
  13. [InferAttrs] Add memset_pattern{4,8} declarations to test. (details)
  14. Revert "Revert "[VE] Make VE official"" (details)
  15. [Flang] Replace notifyMatchFailure with TODO hard failures (details)
  16. [ARM] Add additional postinc distribute tests and regenerate tests. NFC (details)
  17. Use cc/c++ instead of gcc/g++ on FreeBSD. (details)
  18. [GlobalOpt] Fix assertion failure during instruction deletion (details)
  19. [BuildLibCalls] Add support for memset_pattern{4,8}. (details)
Commit 646c872f9d74f12b46f6a5e7332188dfa7e251b1 by david.green
[ARM] Teach getIntImmCostInst about the cost of saturating fp converts

Given a min(max(fptosi, INT_MIN), INT_MAX) with the correct constants,
we can now generate a fptosi.sat. But in the arm backend, the constant
can be treated as high cost, pulling it out of the basic block in a way
that the DAG combine can no longer see it. This teaches it again that it
is a low cost constant, not worth hoisting out.

Recommitted from 0e98659ea1193c with a fix for APInt comparison.

Differential Revision: https://reviews.llvm.org/D114380
The file was modifiedllvm/test/CodeGen/ARM/fpclamptosat.ll
The file was modifiedllvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
Commit fb9fc3c9512c9664b0228ed9b5f560164080cbcb by jonathanchesterfield
[openmp][amdgpu] Disable three tests in preparation for new runtime
The file was modifiedopenmp/libomptarget/test/mapping/lambda_mapping.cpp
The file was modifiedopenmp/libomptarget/test/unified_shared_memory/close_modifier.c
The file was modifiedopenmp/libomptarget/test/unified_shared_memory/shared_update.c
Commit 8aabde5a4b4872767dbd75e517f1a93adf097bc0 by Vitaly Buka
[NFC][sanitizer] Check &real_pthread_join

It's a weak function which may be undefined.
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Commit 57b95aed2a04f00dc84c4c4926c506528081196d by mydeveloperday
[clang-format] Add better support for co-routinues

Responding to a Discord call to help {D113977} and heavily inspired by the unlanded {D34225} add some support to help coroutinues from not being formatted from

```for co_await(auto elt : seq)```

to

```
for
co_await(auto elt : seq)
```

Because of the dominance of clang-format in the C++ community, I don't think we should make it the blocker that prevents users from embracing the newer parts of the standard because we butcher the layout of some of the new constucts.

Reviewed By: HazardyKnusperkeks, Quuxplusone, ChuanqiXu

Differential Revision: https://reviews.llvm.org/D114859
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
The file was modifiedclang/docs/ReleaseNotes.rst
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit bc61e5e90b8db92aa5464d0565c8993b776df54d by nikita.ppv
[GlobalOpt] Add test for PR39751 (NFC)

This has been fixed by D114889, as noted in the comments.
The file was addedllvm/test/Transforms/GlobalOpt/pr39751.ll
Commit 55d392cc30fb36e6361ba71f4b568c093f8b23f3 by nikita.ppv
[llvm-c] Make LLVMAddAlias opaque pointer compatible

Deprecate LLVMAddAlias in favor of LLVMAddAlias2, which accepts a
value type and an address space. Previously these were extracted
from the pointer type.

Differential Revision: https://reviews.llvm.org/D114860
The file was modifiedllvm/include/llvm-c/Core.h
The file was modifiedllvm/tools/llvm-c-test/echo.cpp
The file was modifiedllvm/unittests/IR/ConstantsTest.cpp
The file was modifiedllvm/lib/IR/Core.cpp
Commit 529d0942daf3ed0766dafadad562dfeacf734c3e by clementval
[fir] Add fir numeric intrinsic runtime call builder

This patch adds the FIR builder to generate the numeric intrinsic
runtime call.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: rovka

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
The file was addedflang/include/flang/Optimizer/Builder/Runtime/Numeric.h
The file was addedflang/unittests/Optimizer/Builder/Runtime/NumericTest.cpp
The file was modifiedflang/unittests/Optimizer/CMakeLists.txt
The file was modifiedflang/lib/Optimizer/Builder/CMakeLists.txt
The file was addedflang/lib/Optimizer/Builder/Runtime/Numeric.cpp
Commit d3a4ef35685c6aaad74294b678e77e1b75af1918 by kbobyrev
[clangd] IncludeClenaer: Don't mark forward declarations of a class if it's declared in the main file

This will mark more headers that are unrelated to used symbol but contain its
forawrd declaration. E.g. the following are examples of headers forward
declaring `llvm::StringRef`:

- clang/include/clang/Basic/Cuda.h
- llvm/include/llvm/Support/SHA256.h
- llvm/include/llvm/Support/TrigramIndex.h
- llvm/include/llvm/Support/RandomNumberGenerator.
- ... and more (~50 in total)

This patch is a reduced version of D112707 which was controversial.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D114864
The file was modifiedclang-tools-extra/clangd/IncludeCleaner.cpp
The file was modifiedclang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
Commit 905381dc108cc8fa0003b26cc1ae689987e73f47 by Lang Hames
[ORC] Fix ambiguous call to overloaded function.

This should fix the build failure at
https://lab.llvm.org/buildbot#builders/110/builds/8359
The file was modifiedllvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
Commit e37000f3bff384e20e0696ab4c9126d50030b144 by simon.moll
[VE][NFC] Fix use-after-free in PVFMK expansion

There is custom expansion code for packed VFMK Pseudos in the VE
backend.  This code erased the Pseudo without telling
ExpandPostRAPseudos about it, causing the generic expansion function to
access the erased Pseudo.  This bug triggered in the
test/CodeGen/VE/VELIntrinsics/vfmk.ll test with asan-enabled builds.

Detected by:
sanitizer-x86_64-linux-fast
(https://lab.llvm.org/buildbot/#/builders/5/builds/15393)
The file was modifiedllvm/lib/Target/VE/VEInstrInfo.cpp
Commit 0496edad49939b655435ad71ffda9e366c7c3dc6 by flo
[BuildLibCalls] Add additional attrs to memcpy_chk.

`memcpy_chk` can be treated like `memcpy`, with the exception that it
may not return (if it aborts the program).

See D114793 for a similar patch for `memset_chk`.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D114863
The file was modifiedllvm/lib/Transforms/Utils/BuildLibCalls.cpp
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/annotate.ll
Commit c5bfffed4831fd8ef3aa1fa3d9d4268d546bf6c5 by i
[ELF] Discard input .note.gnu.build-id even with default --build-id=none

binutils 2.38 will adopt this behavior
https://sourceware.org/bugzilla/show_bug.cgi?id=28639

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D114910
The file was modifiedlld/test/ELF/relocatable-build-id.s
The file was modifiedlld/ELF/InputFiles.cpp
Commit d9bb9bd4bf7a661cbb67f49e2c65f637367393eb by flo
[InferAttrs] Add memset_pattern{4,8} declarations to test.
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/annotate.ll
Commit 6f25e754a0daf7ffa871072d8f2b5304b79096fa by simon.moll
Revert "Revert "[VE] Make VE official""

This reverts commit 27c9e8b45b25614a92539ac6787dbb5670d950b3.

Bugs exposed by AddressSanitizer have been reproduced and fixed locally:
* commit e37000f3bff384
* commit 435d44bf8ab392
The file was modifiedllvm/CMakeLists.txt
Commit 7ce8c6fcf1e3d0f22c11ef827b9e152a00de7eae by kiran.chandramohan
[Flang] Replace notifyMatchFailure with TODO hard failures

For unimplemented patterns we revert to using TODO hard failures instead of
notifyMatchFailure.

For fir.select_type revert to using mlir::emiterror.
For the fir.embox TODO on a type with len params we cannot add a test since the type cannot be converted to llvm.

Adding negative tests using not and checking for the error message.
TODO exits with an error in a build without assertion but aborts in a
build with assertions. Abort requires using not with the --crash
option. The two different usages of not is handled by using a custom
command %not_todo_cmd which is converted to not or not --crash
depending on the presence or absence of assertions. Using llvm-config
to check the presence of assertions.

Reviewed By: clementval, awarzynski

Differential Revision: https://reviews.llvm.org/D114371
The file was addedflang/test/Fir/Todo/unboxproc.fir
The file was addedflang/test/Fir/Todo/emboxproc.fir
The file was addedflang/test/Fir/Todo/gentypedesc.fir
The file was addedflang/test/Fir/Todo/dispatch.fir
The file was modifiedflang/lib/Optimizer/CodeGen/CodeGen.cpp
The file was modifiedflang/test/CMakeLists.txt
The file was modifiedflang/test/lit.cfg.py
The file was addedflang/test/Fir/Todo/global_len.fir
The file was addedflang/test/Fir/Todo/dispatch_table.fir
The file was addedflang/test/Fir/Todo/end.fir
The file was modifiedflang/test/Fir/convert-to-llvm-invalid.fir
The file was addedflang/test/Fir/Todo/select_case_with_character.fir
The file was addedflang/test/Fir/Todo/boxproc_host.fir
The file was addedflang/test/Fir/Todo/len_param_index.fir
Commit 73c50ccf7a6bf82eb6a7d19510e9f7315d471c57 by david.green
[ARM] Add additional postinc distribute tests and regenerate tests. NFC
The file was modifiedllvm/test/CodeGen/Thumb2/store-prepostinc.mir
The file was modifiedllvm/test/CodeGen/Thumb2/postinc-distribute.mir
Commit 69deb1371fd4cd2fbf37a82cbc21df79c6d51c70 by fred
Use cc/c++ instead of gcc/g++ on FreeBSD.

All supported FreeBSD platforms do not have GCC in base anymore.

Differential Revision: https://reviews.llvm.org/D114530
The file was modifiedclang/tools/scan-build/libexec/ccc-analyzer
Commit a0ff26e08c0cca4917a08c8b8383b8338aa8e73e by nikita.ppv
[GlobalOpt] Fix assertion failure during instruction deletion

This fixes the assertion failure reported in https://reviews.llvm.org/D114889#3166417,
by making RecursivelyDeleteTriviallyDeadInstructionsPermissive()
more permissive. As the function accepts a WeakTrackingVH, even if
originally only Instructions were inserted, we may end up with
different Value types after a RAUW operation. As such, we should
not assume that the vector only contains instructions.

Notably this matches the behavior of the
RecursivelyDeleteTriviallyDeadInstructions() function variant which
accepts a single value rather than vector.
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
The file was addedllvm/test/Transforms/GlobalOpt/recursively-delete-dead-inst-assertion.ll
Commit 2de5f39e546d64ed00fd63f47b64c1cafe5d6e35 by flo
[BuildLibCalls] Add support for memset_pattern{4,8}.

Add support for memset_pattern{4,8} similar to the existing
memset_pattern16 handling.

Reviewed By: ab

Differential Revision: https://reviews.llvm.org/D114883
The file was modifiedllvm/lib/Transforms/Utils/BuildLibCalls.cpp
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/annotate.ll