Changes

Summary

  1. [SLP][NFC] Pre-commit test showing vectorization preventing FMA (details)
  2. Add an option to fill container for ref (details)
  3. [AArch64][SVE] Convert SRSHL to LSL when the fed from an ABS intrinsic (details)
  4. [libc++] Enable move semantics for vector in C++03 (details)
  5. [flang][NFC] Allow whitespaces before `ERROR` (details)
  6. [libc++] Granularize algorithm benchmarks (details)
  7. [AMDGPU] gfx11 LDSDIR instructions MC support (details)
  8. [flang][OpenMP] Support for Collapse (details)
  9. [flang][driver] Add support for generating executables on MacOSX/Darwin (details)
  10. [runtimes] Fix the build of merged ABI/unwinder libraries (details)
  11. [AMDGPU] gfx11 scalar memory instructions (details)
  12. [libunwind] Remove unused _LIBUNWIND_HAS_NO_THREADS macro in tests (details)
  13. [NFC] Fix typos in X86CmovConversion (details)
  14. [libc++] Override the value of LIBCXX_CXX_ABI in the cache (details)
  15. [VPlan] Update VPWidenMemoryInstruction to not inherit from VPValue. (details)
  16. [LoopVectorize] Precommit a test for D122126 (details)
  17. [LoopVectorize] Don't interleave when the number of runtime checks exceeds the threshold (details)
  18. [clang] Fix __has_builtin (details)
  19. [lldb] Add non-address bit improvements to release notes (details)
  20. [AMDGPU] Allow multiple uses of the same literal in SOP2/SOPC (details)
  21. [SimpleLoopUnswitch] Skip trivial selects during trivial unswitching. (details)
  22. [AMDGPU] emit macro __GFX9__ etc (details)
  23. [PowerPC] Implement XL compat __fnabs and __fnabss builtins. (details)
  24. [NVVM] Update intrinsic defintions to include the `nocallback` attribute (details)
  25. [SelectOpti][1/5] Setup new select-optimize pass (details)
  26. [gn build] Port ca7c307d1816 (details)
  27. [DeadArgElim] Use poison instead of undef as placeholder for dead arguments (details)
  28. Drop qualifiers from return types in C (DR423) (details)
  29. [NFC] Fix a couple of whitespace issues. (details)
  30. [mlir][tensor] Add canonicalization for tensor.cast from extract_slice (details)
  31. [mlir][vector] Fix crash in DropInnerMostUnitDims pattern (details)
  32. [llvm-jitlink] Print session report even if entry-point lookup errors out. (details)
  33. [ORC] Add missing std::moves, pass SymbolLookupSet by value. (details)
  34. [ORC] Add a FIXME. (details)
  35. [ORC] Avoid more SymbolStringPtr copies. (details)
  36. [Object] Fix updating darwin archives (details)
  37. [docs][tools] Remove old llvm-bcanalyzer options (details)
  38. [llvm-dis] Improve missing file error message (details)
  39. [WebAssembly] Use CHECK-NEXT for irreducible-cfg.mir (details)
  40. [WebAssembly] Fix register use-def in FixIrreducibleControlFlow (details)
  41. [Libomptarget] Add `leaf` attribute to `vprintf` declaration (details)
  42. [ValueTracking] Baseline tests for Power-of-2 value tracking on PHI nodes (details)
  43. [llvm-dis][test] Fix error case on Windows (details)
  44. [ValueTracking] Added support to deduce PHI Nodes values being a power of 2 (details)
  45. [Office Hours] add initial guidance for hosts (details)
  46. [InstCombine] NEW Baseline tests for InstCombine optimization to merge GEP instructions with constant indices (details)
  47. [ARM] Cost modelling for scalar fptoi_sat (details)
  48. [OpenMP][libomp] Fix accidental removal of else for core attributes (details)
  49. Revert "[ValueTracking] Added support to deduce PHI Nodes values being a power of 2" (details)
Commit d633dbd195732fe2e343297c37afcb2c3be71d14 by william.schmidt
[SLP][NFC] Pre-commit test showing vectorization preventing FMA

When we generate a horizontal reduction of floating adds fed by a vectorized
tree rooted at floating multiplies, we should account for the cost of no
longer being able to generate scalar FMAs.  Similarly, if we vectorize a
list of floating multiplies that each feeds a single floating add, we should
again account for this cost.

The first test was reduced from a case where the vectorizable tree looked
barely profitable (cost -1) with a horizontal reduction, but produced
substantially worse code than allowing the FMAs to be generated.  The second
test was derived from the first: we again generate a horizontal reduction
here, but even if the horizontal reduction is forced to be unprofitable, we
try to vectorize the multiplies.  I have follow-up patches to address these
issues.

Differential Revision: https://reviews.llvm.org/D124867
The file was addedllvm/test/Transforms/SLPVectorizer/X86/slp-fma-loss.ll
Commit 5bbf6ad5b64c2b3cc669ce7698e1bbf5a7f09539 by usx
Add an option to fill container for ref

This allows index implementations to fill container details when required specially when computing containerID is expensive.

Differential Revision: https://reviews.llvm.org/D125925
The file was modifiedclang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
The file was modifiedclang-tools-extra/clangd/XRefs.cpp
The file was modifiedclang-tools-extra/clangd/index/Index.h
The file was modifiedclang-tools-extra/clangd/index/remote/Index.proto
Commit 5f4541fefbfc3ea0ccfb5c19fba100ab6024d57b by bradley.smith
[AArch64][SVE] Convert SRSHL to LSL when the fed from an ABS intrinsic

Differential Revision: https://reviews.llvm.org/D125233
The file was addedllvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-abs-srshl.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Commit 06cf0ce90a8f5862e9a7560a422ddea171ac3ca9 by nikolasklauser
[libc++] Enable move semantics for vector in C++03

We require move semantics in C++03 anyways, so let's enable them for the containers.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D123802
The file was modifiedlibcxx/test/support/MoveOnly.h
The file was modifiedlibcxx/include/__utility/move.h
The file was modifiedlibcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.addressof.compile.pass.cpp
The file was modifiedlibcxx/include/__iterator/move_iterator.h
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
The file was modifiedlibcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
The file was modifiedlibcxx/test/support/test_allocator.h
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp
The file was modifiedlibcxx/include/vector
The file was modifiedlibcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.addressof.compile.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
Commit b2f9bde2e0e0fb9a26c2809aed17213e0920cf0f by d.dudkin
[flang][NFC] Allow whitespaces before `ERROR`

This change allows to write whitespaces before the `ERROR` keyword
in semantic tests for consistency with other testing infrastructure.

Also, one test is changed in order to test if the change works
correctly.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D125884
The file was modifiedflang/test/Semantics/test_errors.py
The file was modifiedflang/test/Semantics/altreturn04.f90
Commit f94a4476791873a4af1986abcd13c18991a599ee by nikolasklauser
[libc++] Granularize algorithm benchmarks

Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny, mgrang

Differential Revision: https://reviews.llvm.org/D124740
The file was addedlibcxx/benchmarks/algorithms/make_heap_then_sort_heap.bench.cpp
The file was addedlibcxx/benchmarks/algorithms/make_heap.bench.cpp
The file was modifiedlibcxx/benchmarks/CMakeLists.txt
The file was addedlibcxx/benchmarks/algorithms/common.h
The file was addedlibcxx/benchmarks/algorithms/sort_heap.bench.cpp
The file was removedlibcxx/benchmarks/algorithms.bench.cpp
The file was addedlibcxx/benchmarks/algorithms/sort.bench.cpp
The file was addedlibcxx/benchmarks/algorithms/stable_sort.bench.cpp
The file was addedlibcxx/benchmarks/algorithms/min_max_element.bench.cpp
The file was addedlibcxx/benchmarks/algorithms/push_heap.bench.cpp
The file was addedlibcxx/benchmarks/algorithms/pop_heap.bench.cpp
Commit 729467aceff8b5e47821f35697448b08c5379af8 by Joseph.Nash
[AMDGPU] gfx11 LDSDIR instructions MC support

Contributors:
Carl Ritson <carl.ritson@amd.com>

Patch 8/N for upstreaming of AMDGPU gfx11 architecture.

Depends on D125498

Reviewed By: critson, rampitec, #amdgpu

Differential Revision: https://reviews.llvm.org/D125820
The file was addedllvm/lib/Target/AMDGPU/LDSDIRInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrFormats.td
The file was modifiedllvm/test/MC/AMDGPU/gfx11_err.s
The file was modifiedllvm/lib/Target/AMDGPU/SIDefines.h
The file was modifiedllvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
The file was modifiedllvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.td
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.h
The file was addedllvm/test/MC/AMDGPU/ldsdir.s
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_all.txt
Commit 3b390a1682232a0d6921692f72fac65ec4374597 by mats.petersson
[flang][OpenMP] Support for Collapse

Convert Fortran parse-tree into MLIR for collapse-clause.

Includes simple Fortran to LLVM-IR test, with auto-generated
check-lines (some of which have been edited by hand).

Reviewed By: kiranchandramohan, shraiysh, peixin

Differential Revision: https://reviews.llvm.org/D125302
The file was addedflang/test/Lower/OpenMP/omp-wsloop-collapse.f90
The file was modifiedflang/include/flang/Lower/OpenMP.h
The file was modifiedflang/lib/Lower/OpenMP.cpp
The file was modifiedflang/lib/Lower/Bridge.cpp
Commit e601b2a1542710789395ab1121b1ccc7076e39d1 by andrzej.warzynski
[flang][driver] Add support for generating executables on MacOSX/Darwin

This patch basically extends https://reviews.llvm.org/D122008 with
support for MacOSX/Darwin.

To facilitate this, I've added `MacOSX` to the list of supported OSes in
Target.cpp. Flang already supports `Darwin` and it doesn't really do
anything OS-specific there (it could probably safely skip checking the
OS for now).

Note that generating executables remains hidden behind the
`-flang-experimental-exec` flag. Also, we don't need to add `-lm` on
MacOSX as `libm` is effectively included in `libSystem` (which is linked
in unconditionally).

Differential Revision: https://reviews.llvm.org/D125628
The file was modifiedclang/lib/Driver/ToolChains/CommonArgs.h
The file was modifiedclang/lib/Driver/ToolChains/Darwin.cpp
The file was modifiedflang/test/Driver/linker-flags.f90
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
The file was modifiedclang/lib/Driver/ToolChains/CommonArgs.cpp
The file was modifiedflang/lib/Optimizer/CodeGen/Target.cpp
Commit fa7ce8e685faa63f7ad1d0c7a640217286ec291b by Louis Dionne
[runtimes] Fix the build of merged ABI/unwinder libraries

Also, add a CI job that tests this configuration. The exact configuration
is that we build a shared libc++ and merge objects for the ABI library
and the unwinder library into it.

Differential Revision: https://reviews.llvm.org/D125903
The file was modifiedlibcxx/CMakeLists.txt
The file was modifiedlibcxxabi/src/CMakeLists.txt
The file was addedlibcxx/cmake/caches/Generic-merged.cmake
The file was modifiedlibcxx/utils/ci/buildkite-pipeline.yml
The file was modifiedlibcxx/src/CMakeLists.txt
The file was addedlibunwind/test/configs/llvm-libunwind-merged.cfg.in
The file was modifiedlibcxx/utils/ci/run-buildbot
The file was addedlibcxxabi/test/configs/llvm-libc++abi-merged.cfg.in
The file was modifiedlibcxxabi/CMakeLists.txt
Commit ac2ff258d69bfc70d92391c26be2b38a0a72ab74 by Joseph.Nash
[AMDGPU] gfx11 scalar memory instructions

Contributors:
Mirko Brkusanin <Mirko.Brkusanin@amd.com>

Patch 9/N for upstreaming of AMDGPU gfx11 architecture.

Depends on D125820

Reviewed By: kosarev, #amdgpu, arsenm

Differential Revision: https://reviews.llvm.org/D125822
The file was modifiedllvm/lib/Target/AMDGPU/SMInstructions.td
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_all.txt
The file was addedllvm/test/MC/AMDGPU/gfx11_asm_smem_alias.s
The file was addedllvm/test/MC/AMDGPU/gfx11_asm_smem.s
Commit a5f36259a20533d9c970ab6a5faab7cf341ca1c9 by Louis Dionne
[libunwind] Remove unused _LIBUNWIND_HAS_NO_THREADS macro in tests

The _LIBUNWIND_HAS_NO_THREADS macro is only picked up by libunwind
inside its sources, so it is only required when it builds. It doesn't
need to be defined when running the tests.
The file was modifiedlibunwind/test/configs/llvm-libunwind-merged.cfg.in
The file was modifiedlibunwind/test/configs/llvm-libunwind-shared.cfg.in
The file was modifiedlibunwind/test/configs/llvm-libunwind-static.cfg.in
Commit a094ad03f341427af6578661fbe19181f032795a by apostolakis
[NFC] Fix typos in X86CmovConversion
The file was modifiedllvm/lib/Target/X86/X86CmovConversion.cpp
Commit 4431e8c84e6290b6b6f28d471f7584f0d9ccbb7b by Louis Dionne
[libc++] Override the value of LIBCXX_CXX_ABI in the cache

This will allow us to remove this entirely once the commit has propagated
through all CI and hence changed the value in the cache.
The file was modifiedlibcxx/CMakeLists.txt
Commit df56fb44f5495a660ffd369355f1b7d9c5144232 by flo
[VPlan] Update VPWidenMemoryInstruction to not inherit from VPValue.

VPWidenMemoryInstruction also models stores which may not produce a value.
This can trip over analyses. Improve the modeling by only adding
VPValues for VPWidenMemoryInstructionRecipes modeling loads.
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.h
Commit 94a2bd5a270bca1c539a71d0e1ca88c02a023ebd by chenmindong1
[LoopVectorize] Precommit a test for D122126
The file was addedllvm/test/Transforms/LoopVectorize/PowerPC/interleaved-pointer-runtime-check-unprofitable.ll
Commit 3ed9f603fd59cafe3ab864d8bb77349ed418d384 by chenmindong1
[LoopVectorize] Don't interleave when the number of runtime checks exceeds the threshold

The runtime check threshold should also restrict interleave count.
Otherwise, too many runtime checks will be generated for some cases.

Reviewed By: fhahn, dmgreen

Differential Revision: https://reviews.llvm.org/D122126
The file was modifiedllvm/test/Transforms/LoopVectorize/PowerPC/interleaved-pointer-runtime-check-unprofitable.ll
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
Commit cefe472c51fbcd1aed4d4a090709f25a12a8bc2c by Yaxun.Liu
[clang] Fix __has_builtin

Fix __has_builtin to return 1 only if the requested target features
of a builtin are enabled by refactoring the code for checking
required target features of a builtin and use it in evaluation
of __has_builtin.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D125829
The file was addedclang/lib/Basic/BuiltinTargetFeatures.h
The file was addedclang/test/Preprocessor/hash_builtin.cpp
The file was modifiedclang/test/Preprocessor/feature_tests.c
The file was modifiedclang/lib/Basic/Builtins.cpp
The file was modifiedclang/include/clang/Basic/Builtins.h
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
The file was modifiedclang/lib/Lex/PPMacroExpansion.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.cpp
The file was modifiedclang/unittests/CodeGen/CheckTargetFeaturesTest.cpp
Commit a136a00eae065d48cc4872d848d452ac31768c72 by david.spickett
[lldb] Add non-address bit improvements to release notes

This summarises the changes made by d9398a91e2a6b8837a47a5fda2164c9160e86199.
Which forms the bulk of the fixes needed for non-address bit handling.

Note that in the previous releases we noted memory tagging support,
which is a subset of non-address bits. The recent changes enable
debugging of programs using memory tagging, pointer authentication
and top byte ignore (all at once) on AArch64.
The file was modifiedllvm/docs/ReleaseNotes.rst
Commit d14f2a6359483730657b275d40822d1098e3ff51 by jay.foad
[AMDGPU] Allow multiple uses of the same literal in SOP2/SOPC

AMDGPUAsmParser::validateSOPLiteral already knew about this but
SIInstrInfo::verifyInstruction did not.

Differential Revision: https://reviews.llvm.org/D125976
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/verify-duplicate-literal.mir
Commit 32d6ef36d6c0da2d0b2165531cf9fcdc4dedc95a by flo
[SimpleLoopUnswitch] Skip trivial selects during trivial unswitching.

Update the remaining places in unswitchTrivialBranch to properly skip
trivial selects.

Fixes #55526.
The file was modifiedllvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
The file was modifiedllvm/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-logical-and-or.ll
Commit 559b8fc17ef6f5a65ccf9a11fce5f91c0a011b00 by Yaxun.Liu
[AMDGPU] emit macro __GFX9__ etc

Emit predefined macros for GPU family. e.g.
for GPU gfx9xx emit __GFX9__, etc.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D125909
The file was modifiedclang/lib/Basic/Targets/AMDGPU.cpp
The file was modifiedclang/test/Driver/amdgpu-macros.cl
Commit c35ca3a1c78f693b749ad11742350b7fc6c5cd89 by amy.kwan1
[PowerPC] Implement XL compat __fnabs and __fnabss builtins.

This patch implements the following floating point negative absolute value
builtins that required for compatibility with the XL compiler:
```
double __fnabs(double);
float __fnabss(float);
```

These builtins will emit :
- fnabs on PWR6 and below, or if VSX is disabled.
- xsnabsdp on PWR7 and above, if VSX is enabled.

Differential Revision: https://reviews.llvm.org/D125506
The file was addedclang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fnabs.c
The file was modifiedllvm/lib/Target/PowerPC/P9InstrResources.td
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.td
The file was modifiedllvm/lib/Target/PowerPC/P10InstrResources.td
The file was modifiedclang/include/clang/Basic/BuiltinsPPC.def
The file was addedllvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fnabs.ll
The file was modifiedllvm/include/llvm/IR/IntrinsicsPowerPC.td
The file was modifiedclang/lib/Basic/Targets/PPC.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCBack2BackFusion.def
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrVSX.td
Commit dbffa4073cf8cf278d72ad1bc3defdf7ae4f8949 by jhuber6
[NVVM] Update intrinsic defintions to include the `nocallback` attribute

This patch adds the `nocallback` attribute to the NVVM intrinsics that
did not use the `DefaultAttrsIntrinsic` method that includes it already.
The `nocallback` attribute states that the intrinsic function cannot
enter back into the caller's translation-unit. This allows as to
determine that a function calling a `nocallback` function can have the
`norecurse` attribute.  This should be safe for all the NVVM intrinsics
because they do not call other functions within the translation unit.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D125937
The file was modifiedllvm/test/Transforms/OpenMP/replace_globalization.ll
The file was modifiedllvm/include/llvm/IR/IntrinsicsNVVM.td
The file was modifiedllvm/test/Transforms/OpenMP/barrier_removal.ll
Commit ca7c307d18160485ab30289dc1b14bd16ac35c52 by apostolakis
[SelectOpti][1/5] Setup new select-optimize pass

This is the first commit for the cmov-vs-branch optimization pass.
The goal is to develop a new profile-guided and target-independent cost/benefit analysis
for selecting conditional moves over branches when optimizing for performance.

Initially, this new pass is expected to be enabled only for instrumentation-based PGO.

RFC: https://discourse.llvm.org/t/rfc-cmov-vs-branch-optimization/6040

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D120230
The file was addedllvm/lib/CodeGen/SelectOptimize.cpp
The file was modifiedllvm/include/llvm/CodeGen/Passes.h
The file was modifiedllvm/include/llvm/InitializePasses.h
The file was modifiedllvm/include/llvm/Target/CGPassBuilderOption.h
The file was modifiedllvm/include/llvm/CodeGen/CodeGenPassBuilder.h
The file was modifiedllvm/include/llvm/LinkAllPasses.h
The file was modifiedllvm/lib/CodeGen/CodeGen.cpp
The file was modifiedllvm/lib/CodeGen/TargetPassConfig.cpp
The file was modifiedllvm/tools/opt/opt.cpp
The file was modifiedllvm/include/llvm/CodeGen/MachinePassRegistry.def
The file was modifiedllvm/lib/CodeGen/CMakeLists.txt
Commit a49d3055c7459ad998578cc76f34722eb0871142 by llvmgnsyncbot
[gn build] Port ca7c307d1816
The file was modifiedllvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn
Commit 5fc9449c962a0703a658aa8e29162e00dc2fecf1 by nuno.lopes
[DeadArgElim] Use poison instead of undef as placeholder for dead arguments

It doesn't matter which value we use for dead args, so let's switch
to poison, so we can eventually kill undef.

Reviewed By: aeubanks, fhahn

Differential Revision: https://reviews.llvm.org/D125983
The file was modifiedllvm/test/Transforms/DeadArgElim/opaque-ptr.ll
The file was modifiedclang/test/CodeGen/debug-info-block-vars.c
The file was modifiedllvm/test/Transforms/DeadArgElim/variadic_safety.ll
The file was modifiedllvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
The file was modifiedllvm/test/DebugInfo/X86/dbgloc-insert-extract-val-instrs.ll
The file was modifiedllvm/test/Transforms/DeadArgElim/dbginfo-update-dbgval-local.ll
The file was modifiedllvm/test/Transforms/DeadArgElim/dbginfo-update-dbgval.ll
The file was modifiedllvm/test/Transforms/DeadArgElim/fct_ptr.ll
The file was modifiedllvm/test/Transforms/DeadArgElim/byref.ll
The file was modifiedllvm/test/Transforms/DeadArgElim/aggregates.ll
The file was modifiedllvm/test/Transforms/DeadArgElim/deadexternal.ll
The file was modifiedclang/test/CodeGen/mips-unsigned-ext-var.c
The file was modifiedllvm/test/Transforms/DeadArgElim/NoundefAttrs.ll
Commit d374b65f2da1bdd3d9a7e9ac8ed4ad5467c882f9 by aaron
Drop qualifiers from return types in C (DR423)

WG14 DR423 (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2148.htm#dr_423),
resolved during the C11 time frame, changed the way qualifiers are
handled on function return types and in cast expressions after it was
noted that these types are now directly observable via generic
selection expressions. In C, the function declarator is adjusted to
ignore all qualifiers (including _Atomic qualifiers).

Clang already handles the cast expression case correctly (by performing
the lvalue conversion, which drops the qualifiers as well), but with
these changes it will now also handle function declarations
appropriately.

Fixes #39595

Differential Revision: https://reviews.llvm.org/D125919
The file was modifiedclang/test/Sema/warn-missing-prototypes.c
The file was modifiedclang/docs/ReleaseNotes.rst
The file was modifiedclang/test/SemaObjC/block-omitted-return-type.m
The file was modifiedclang/test/CodeGen/xcore-stringtype.c
The file was addedclang/test/Sema/wg14-dr423.c
The file was modifiedclang/test/Sema/c89.c
The file was modifiedclang/test/Sema/function.c
The file was modifiedclang/test/Sema/block-call.c
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Sema/SemaType.cpp
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersTest.h
Commit d640442518d5b095cbf10d4c8eae569425f0506e by paul.walker
[NFC] Fix a couple of whitespace issues.
The file was modifiedllvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
The file was modifiedllvm/include/llvm/IR/Intrinsics.td
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
Commit f2676b151d6feb16d6f259ea8bac8ef16cc08f99 by thomasraoux
[mlir][tensor] Add canonicalization for tensor.cast from extract_slice

Propagate static size information into extract_slice producer if
possible.

Differential Revision: https://reviews.llvm.org/D125972
The file was modifiedmlir/test/Dialect/Linalg/tile-and-fuse-tensors.mlir
The file was modifiedmlir/lib/Dialect/Tensor/IR/TensorOps.cpp
The file was modifiedmlir/test/Dialect/Tensor/canonicalize.mlir
Commit 4c1b65e7bc923b1ed0473cad51b5070471a201a5 by thomasraoux
[mlir][vector] Fix crash in DropInnerMostUnitDims pattern

Fix number of dimensions when incrementally replacing dimensions in
affine map.

Differential Revision: https://reviews.llvm.org/D125984
The file was modifiedmlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
The file was modifiedmlir/test/Dialect/Vector/vector-transfer-collapse-inner-most-dims.mlir
Commit e8e7581fb10d974c6e5cf475f40164035288442f by Lang Hames
[llvm-jitlink] Print session report even if entry-point lookup errors out.
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.cpp
Commit 4bb18a89c418082c3b1e9d16fde40fbc915d17e5 by Lang Hames
[ORC] Add missing std::moves, pass SymbolLookupSet by value.

Avoids some unnecessary SymbolStringPtr copies.
The file was modifiedllvm/lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/Core.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Core.h
Commit d27e4bcebdb275a169b859f2df7890f0813ef2f8 by Lang Hames
[ORC] Add a FIXME.
The file was modifiedllvm/lib/ExecutionEngine/Orc/Core.cpp
Commit 2ca81cd91486280b232a6be45858f757a8ea0870 by Lang Hames
[ORC] Avoid more SymbolStringPtr copies.
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
Commit 066243057fc2ae45ae6bbc2f4874ca1f84c3a3ff by keithbsmiley
[Object] Fix updating darwin archives

When creating an archive, llvm-ar looks at the host to determine the
archive format to use, on Apple platforms this means it uses the
K_DARWIN format. K_DARWIN is _virtually_ equivalent to K_BSD, expect for
some very slight differences around padding, timestamps in deterministic
mode, and 64 bit formats. When updating an archive using llvm-ar, or
llvm-objcopy, Archive would try to determine the kind, but it was not
possible to get K_DARWIN in the initialization of the archive, because
they're virtually inciting usable from K_BSD, especially since the
slight differences only apply in very specific cases. This leads to
linker failures when the alignment workaround is not applied to an
archive copied with llvm-objcopy. This change teaches Archive to infer
the K_DARWIN type in the cases where it's possible and the first object
in the archive is a macho object. This avoids using the host triple to
determine this to not affect cross compiling.

Ideally we would eliminate the separate K_DARWIN type entirely since
it's not a truly separate archive type, but then we'd have to force the
macho workarounds on the BSD format generally. This might be acceptable
but then it would be unclear how to handle this case without forcing the
K_DARWIN64 format on all BSD users:

```
if (LastOffset >= Sym64Threshold) {
  if (Kind == object::Archive::K_DARWIN)
    Kind = object::Archive::K_DARWIN64;
  else
    Kind = object::Archive::K_GNU64;
}
```

The logic used to determine if the object is macho is derived from the
logic llvm-ar uses.

Previous context:

- 111cd669e90e5b2132187d36f8b141b11a671a8b
- 23a76be5adcaa768ba538f8a4514a7afccf61988

Differential Revision: https://reviews.llvm.org/D124895
The file was modifiedllvm/include/llvm/Object/Archive.h
The file was addedllvm/test/tools/llvm-ar/macho-edit.test
The file was modifiedllvm/lib/Object/ArchiveWriter.cpp
The file was modifiedllvm/include/llvm/Object/ArchiveWriter.h
The file was modifiedllvm/lib/Object/Archive.cpp
The file was modifiedllvm/tools/llvm-ar/llvm-ar.cpp
The file was addedllvm/test/tools/llvm-objcopy/MachO/archive-format.test
The file was modifiedllvm/lib/ObjCopy/Archive.cpp
The file was modifiedllvm/lib/ObjCopy/MachO/MachOObjcopy.cpp
The file was modifiedllvm/test/tools/llvm-objcopy/MachO/universal-object.test
Commit 6746e6a37284e6d9aa83f1f2d0b76013898256cb by keithbsmiley
[docs][tools] Remove old llvm-bcanalyzer options

These no longer exist. A few have been added since but I'm not enough of
an expert to provide a useful blurb on them outside of what you see with
`--help`.

Differential Revision: https://reviews.llvm.org/D122361
The file was modifiedllvm/docs/CommandGuide/llvm-bcanalyzer.rst
Commit 2569f79a4fe404da9d905188333484d5d66caf7e by keithbsmiley
[llvm-dis] Improve missing file error message

Previously the error message didn't include the failing path, which made
it hard to tell what went wrong.

Differential Revision: https://reviews.llvm.org/D121665
The file was addedllvm/test/tools/llvm-dis/errors.test
The file was modifiedllvm/tools/llvm-dis/llvm-dis.cpp
Commit 44718c5ef2c557a035793fff6aec96452fba4cc8 by aheejin
[WebAssembly] Use CHECK-NEXT for irreducible-cfg.mir

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D125514
The file was modifiedllvm/test/CodeGen/WebAssembly/irreducible-cfg.mir
Commit cde083e010952722babb3e08b457e473e86f412d by aheejin
[WebAssembly] Fix register use-def in FixIrreducibleControlFlow

FixIrreducibleControlFlow pass adds dispatch blocks with a `br_table`
that has multiple predecessors and successors, because it serves as
something like a traffic hub for BBs. As a result of this, there can be
register uses that are not dominated by a def in every path from the
entry block. For example, suppose register %a is defined in BB1 and used
in BB2, and there is a single path from BB1 and BB2:
```
BB1 -> ... -> BB2
```
After FixIrreducibleControlFlow runs, there can be a dispatch block
between these two BBs:
```
BB1 -> ... -> Dispatch -> ... -> BB2
```
And this dispatch block has multiple predecessors, now
there is a path to BB2 that does not first visit BB1, and in that path
%a is not dominated by a def anymore.

To fix this problem, we have been adding `IMPLICIT_DEF`s to all
registers in PrepareForLiveInternals pass, and then remove unnecessary
ones in OptimizeLiveIntervals pass after computing `LiveIntervals`. But
FixIrreducibleControlFlow pass itself ends up violating register use-def
relationship, resulting in invalid code. This was OK so far because
MIR verifier apparently didn't check this in validation. But @arsenm
fixed this and it caught this bug in validation
(https://github.com/llvm/llvm-project/issues/55249).

This CL moves the `IMPLICIT_DEF` adding routine from
PrepareForLiveInternals to FixIrreducibleControlFlow. We only run it
when FixIrreducibleControlFlow changes the code. And then
PrepareForLiveInternals doesn't do anything other than setting
`TracksLiveness` property, which is a prerequisite for running
`LiveIntervals` analysis, which is required by the next pass
OptimizeLiveIntervals.

But in our backend we don't seem to do anything that invalidates this up
until OptimizeLiveIntervals, and I'm not sure why we are calling
`invalidateLiveness` in ReplacePhysRegs pass, because what that pass
does is to replace physical registers with virtual ones 1-to-1. I
deleted the `invalidateLiveness` call there and we don't need to set
that flag explicitly, which obviates all the need for
PrepareForLiveInternals.

(By the way, This 'Liveness' here is different from `LiveIntervals`
analysis. Setting this only means BBs' live-in info is correct, all uses
are dominated by defs, `kill` flag is conservatively correct, which
means if there is a `kill` flag set it should be the last use. See
https://github.com/llvm/llvm-project/blob/2a0837aab1489c88efb03784e34c4dc9f2e28302/llvm/include/llvm/CodeGen/MachineFunction.h#L125-L134
for details.)

So this CL removes PrepareForLiveInternals pass altogether. Something
similar to this was attempted by D56091 long ago but that came short of
actually removing the pass, and I couldn't land it because
FixIrreducibleControlFlow violated use-def relationship, which this CL
fixes.

This doesn't change output in any meaningful way. All test changes
except `irreducible-cfg.mir` are register numbering.

Also this will likely to reduce compilation time, because we have been
adding `IMPLICIT_DEF` for all registers every time `-O2` is given, but
now we do that only when there is irreducible control flow, which is
rare.

Fixes https://github.com/llvm/llvm-project/issues/55249.

Reviewed By: dschuff, kripken

Differential Revision: https://reviews.llvm.org/D125515
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/BUILD.gn
The file was removedllvm/lib/Target/WebAssembly/WebAssemblyPrepareForLiveIntervals.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyReplacePhysRegs.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/irreducible-cfg.mir
The file was modifiedllvm/test/CodeGen/WebAssembly/umulo-i64.ll
The file was modifiedllvm/test/CodeGen/WebAssembly/reg-stackify.ll
The file was modifiedllvm/test/CodeGen/WebAssembly/umulo-128-legalisation-lowering.ll
The file was modifiedllvm/lib/Target/WebAssembly/CMakeLists.txt
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssembly.h
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyOptimizeLiveIntervals.cpp
Commit eda4ef3add4d25345e0b29580776f1576040c525 by jhuber6
[Libomptarget] Add `leaf` attribute to `vprintf` declaration

Summary:
This patch adds the `leaf` attribute to the `vprintf` declaration in the
OpenMP runtime. This attribute allows us to determine that the `vprintf`
function will not call any functions within the translation unit,
allowing us to deduce `norecurse` attributes on the caller.
The file was modifiedopenmp/libomptarget/DeviceRTL/src/Debug.cpp
Commit 0f37ba7b236252b29c33335fb00836d81671ea65 by williamjhuang
[ValueTracking] Baseline tests for Power-of-2 value tracking on PHI nodes

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D124885
The file was addedllvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll
Commit a1cf20f012baef53ad734d4489d3a967d7ee4f80 by keithbsmiley
[llvm-dis][test] Fix error case on Windows

The `N` case in the error differs across platforms.
The file was modifiedllvm/test/tools/llvm-dis/errors.test
Commit d5c130f17e503e128b8a413c2ce0e522987d2a16 by williamjhuang
[ValueTracking] Added support to deduce PHI Nodes values being a power of 2

Add Value Tracking support to deduce induction variable being a power of 2, allowing urem optimizations

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D125332
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
Commit ac2f0a6f1d4b3f5ff61dac33d9aba395d79b6a3d by kristof.beyls
[Office Hours] add initial guidance for hosts

This includes adding guidance to announce an office hours session on the
Discord channel and/or IRC, as discussed at the office hours round table at
EuroLLVM 2022, see
https://discourse.llvm.org/t/office-hours-eurollvm-round-table-summary/62480.

Fixes #55423
The file was modifiedllvm/docs/GettingInvolved.rst
Commit 6107cdc9295d339304ce3e88e0b038db661d2bcb by williamjhuang
[InstCombine] NEW Baseline tests for InstCombine optimization to merge GEP instructions with constant indices

Splitted the merge constant-indexed GEP optimization into two smaller transformations: 1. Merging GEP of GEP if both are constant-indexed. 2. Swapping constant indexed GEP in a chain of (non-constant) GEP to the end, so that 1 can be applied repeatedly.
There is existing code to partially  handle transformation 1, but it only deals with limited cases

Unit tests are breaking down into two parts for the 2 transformations.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D125438
The file was addedllvm/test/Transforms/InstCombine/gep-canonicalize-constant-indices.ll
The file was addedllvm/test/Transforms/InstCombine/gep-merge-constant-indices.ll
Commit 80aab0312acea2231b9aec4ba2ceb5951ae8016a by david.green
[ARM] Cost modelling for scalar fptoi_sat

Similar to D124357, this adds some cost modelling for fptoi_sat for Arm
targets. Where VFP2 is available (and FP64/FP16 for the relevant types),
the operations are legal as the Arm instructions naturally saturate.
Otherwise they will need an extra smin/smax clamp, similar to AArch64.

Differential Revision: https://reviews.llvm.org/D125665
The file was modifiedllvm/test/Analysis/CostModel/ARM/fptoi_sat.ll
The file was modifiedllvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
Commit f613e6d19d293d4eff9885b1fb429162bc6700cd by jonathan.l.peyton
[OpenMP][libomp] Fix accidental removal of else for core attributes
The file was modifiedopenmp/runtime/src/kmp_settings.cpp
Commit 304a5a7a14dd26ae93194b336fef9a1213fa44b5 by thakis
Revert "[ValueTracking] Added support to deduce PHI Nodes values being a power of 2"

This reverts commit d5c130f17e503e128b8a413c2ce0e522987d2a16.
Breaks tests, see https://reviews.llvm.org/D125332#3525819
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp