SuccessChanges

Summary

  1. [openmp] Fix warning in generated OMP.cpp (details)
  2. [WebAssembly] Prefer v128.const for constant splats (details)
  3. Summary: [clang] Provide a way for WhileStmt to report the location of its LParen and RParen. (details)
  4. [RISCV][test] Add a test for (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2) transformation (details)
  5. [PowerPC][MachinePipeliner] Enable pipeliner if hasInstrSchedModel (details)
  6. [X86][MMX] Optimize MMX shift intrinsics. (details)
  7. [HIP] Fix rocm detection (details)
  8. [lldb/Test] Fix missing yaml2obj in Xcode standalone build. (details)
  9. [OpenMP][CUDA] Fix std::complex in GPU regions (details)
  10. Fix signed vs unsigned comparison warnings a different way. (details)
  11. [OpenMP][NFC] Remove unused (always fixed) arguments (details)
  12. [OpenMP][NFC] Fix some typos (details)
  13. [OpenMP][NFC] Add convenient helper and early exit check (details)
  14. [OpenMP] Identify GPU kernels (aka. OpenMP target regions) (details)
  15. [OpenMP] Compute a proper module slice for the CGSCCC pass (details)
  16. [OpenMP] Replace function pointer uses in GPU state machine (details)
  17. Remove unused variable `KMPC_KERNEL_PARALLEL_WORK_FN_PTR_ARG_NO` (NFC) (details)
  18. [OpenMP][FIX] remove unused variable and long if-else chain (details)
  19. [clang-tidy] Reworked enum options handling(again) (details)
  20. Fix gn builds after 943660fd1 (details)
  21. Revert "Fix gn builds after 943660fd1" (details)
Commit 7b67bc16ef1b954eea5f99e478ccd4840ebe7a06 by clementval
[openmp] Fix warning in generated OMP.cpp
The file was modifiedllvm/utils/TableGen/DirectiveEmitter.cpp
Commit b59c6fcaf3fc8fd4c42daeecf0545e47b37b1aa7 by tlively
[WebAssembly] Prefer v128.const for constant splats

In BUILD_VECTOR lowering, we used to generally prefer using splats
over v128.const instructions because v128.const has a very large
encoding. However, in d5b7a4e2e8 we switched to preferring consts
because they are expected to be more efficient in engines. This patch
updates the ISel patterns to match this current preference.

Differential Revision: https://reviews.llvm.org/D83581
The file was modifiedllvm/test/CodeGen/WebAssembly/simd-arith.ll
The file was modifiedllvm/test/CodeGen/WebAssembly/simd.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
Commit 17ea41e472566823e16d3a04661221fbd18d9fae by vyng
Summary: [clang] Provide a way for WhileStmt to report the location of its LParen and RParen.

Summary: This helps avoiding hacks downstream.

Reviewers: shafik

Subscribers: martong, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83529
The file was modifiedclang/include/clang/AST/Stmt.h
The file was modifiedclang/lib/AST/ASTImporter.cpp
The file was modifiedclang/lib/Sema/TreeTransform.h
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/AST/Stmt.cpp
The file was modifiedclang/lib/Sema/SemaStmt.cpp
The file was modifiedclang/include/clang/Parse/Parser.h
The file was modifiedclang/unittests/AST/SourceLocationTest.cpp
The file was modifiedclang/lib/Parse/ParseStmt.cpp
The file was modifiedclang/lib/Serialization/ASTWriterStmt.cpp
Commit 28acaf84230fd246311f1cf18bad34b4bc3e5c0c by maskray
[RISCV][test] Add a test for (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2) transformation

Reviewed By: lenary, MaskRay

Differential Revision: https://reviews.llvm.org/D83159
The file was addedllvm/test/CodeGen/RISCV/addimm-mulimm.ll
Commit 3e3acc1cc773f61470d815165704288118cb27e1 by Jinsong Ji
[PowerPC][MachinePipeliner] Enable pipeliner if hasInstrSchedModel

P9 is the only one with InstrSchedModel, but we may have more in the
future, we should not hardcoded it to P9, check hasInstrSchedModel
instead.

Reviewed By: hfinkel

Differential Revision: https://reviews.llvm.org/D83590
The file was modifiedllvm/test/CodeGen/PowerPC/sms-remark.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCSubtarget.cpp
Commit e6280925249c87c11568a305a074581cc073bd45 by pengfei.wang
[X86][MMX] Optimize MMX shift intrinsics.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D83534
The file was modifiedllvm/test/CodeGen/X86/mmx-intrinsics.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 849d4405f534434ebbda9889f24ff20122e34671 by Yaxun.Liu
[HIP] Fix rocm detection

Do not detect device library by default in rocm detector.
Only detect device library in Rocm and HIP toolchain.

Separate detection of HIP runtime and Rocm device library.

Detect rocm path by version file in host toolchains.

Also added detecting rocm version and printing rocm
installation path and version with -v.

Fixed include path and device library detection for
ROCm 3.5.

Added --hip-version option. Renamed --hip-device-lib-path
to --rocm-device-lib-path.

Fixed default value for -fhip-new-launch-api.

Added default -std option for HIP.

Differential Revision: https://reviews.llvm.org/D82930
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/test/Driver/hip-include-path.hip
The file was modifiedclang/lib/Driver/ToolChains/MSVC.cpp
The file was addedclang/test/Driver/hip-launch-api.hip
The file was modifiedclang/lib/CodeGen/CGCUDANV.cpp
The file was addedclang/test/Driver/hip-std.hip
The file was modifiedclang/test/Driver/rocm-detect.cl
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
The file was addedclang/test/Driver/Inputs/rocm/bin/.hipVersion
The file was addedclang/test/Driver/hip-version.hip
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/Driver/rocm-not-found.cl
The file was modifiedclang/include/clang/Basic/DiagnosticDriverKinds.td
The file was modifiedclang/lib/Driver/ToolChains/HIP.cpp
The file was modifiedclang/lib/Driver/ToolChains/AMDGPU.cpp
The file was modifiedclang/lib/Driver/ToolChains/ROCm.h
The file was modifiedclang/test/Driver/rocm-detect.hip
Commit 8ee225744f109b19e7d2412cbc50d4586991d8cf by Jonas Devlieghere
[lldb/Test] Fix missing yaml2obj in Xcode standalone build.

Rather than trying to find the yaml2obj from dotest we should pass it in
like we do for dsymutil and FileCheck.
The file was modifiedlldb/test/API/lit.cfg.py
The file was modifiedlldb/test/API/lit.site.cfg.py.in
The file was modifiedlldb/test/API/CMakeLists.txt
The file was modifiedlldb/utils/lldb-dotest/lldb-dotest.in
The file was modifiedlldb/packages/Python/lldbsuite/test/configuration.py
The file was modifiedlldb/packages/Python/lldbsuite/test/dotest.py
The file was modifiedlldb/packages/Python/lldbsuite/test/lldbtest.py
The file was modifiedlldb/utils/lldb-dotest/CMakeLists.txt
The file was modifiedlldb/packages/Python/lldbsuite/test/dotest_args.py
Commit b5667d00e0447747419a783697b84a37f59ce055 by johannes
[OpenMP][CUDA] Fix std::complex in GPU regions

The old way worked to some degree for C++-mode but in C mode we actually
tried to introduce variants of macros (e.g., isinf). To make both modes
work reliably we get rid of those extra variants and directly use NVIDIA
intrinsics in the complex implementation. While this has to be revisited
as we add other GPU targets which want to reuse the code, it should be
fine for now.

Reviewed By: tra, JonChesterfield, yaxunl

Differential Revision: https://reviews.llvm.org/D83591
The file was modifiedclang/test/Headers/nvptx_device_math_complex.cpp
The file was modifiedclang/test/Headers/nvptx_device_math_complex.c
The file was modifiedclang/lib/Headers/__clang_cuda_complex_builtins.h
The file was modifiedclang/lib/Headers/__clang_cuda_math.h
Commit 256e4d46a67517056d1e45d71c02424db01eff44 by echristo
Fix signed vs unsigned comparison warnings a different way.
The file was modifiedlld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
The file was modifiedlld/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp
Commit c98699582a6333bbe76ff7853b4cd6beb45754cf by johannes
[OpenMP][NFC] Remove unused (always fixed) arguments

There are various runtime calls in the device runtime with unused, or
always fixed, arguments. This is bad for all sorts of reasons. Clean up
two before as we match them in OpenMPOpt now.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D83268
The file was modifiedclang/test/OpenMP/nvptx_parallel_codegen.cpp
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/parallel.cu
The file was modifiedllvm/include/llvm/Frontend/OpenMP/OMPKinds.def
The file was modifiedclang/test/OpenMP/nvptx_data_sharing.cpp
The file was modifiedopenmp/libomptarget/deviceRTLs/interface.h
The file was modifiedclang/test/OpenMP/nvptx_target_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_teams_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_teams_distribute_codegen.cpp
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
Commit b726c55709a0a5e31a26c8e381544348c5dcd402 by johannes
[OpenMP][NFC] Fix some typos
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit 54bd3751ceebe6eb67804a1ed8be72943817852f by johannes
[OpenMP][NFC] Add convenient helper and early exit check
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit e8039ad4def0c4a2499cfbaba38bcc8ef48dee92 by johannes
[OpenMP] Identify GPU kernels (aka. OpenMP target regions)

We now identify GPU kernels, that is entry points into the GPU code.
These kernels (can) correspond to OpenMP target regions. With this patch
we identify and on request print them via remarks.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D83269
The file was modifiedllvm/include/llvm/Transforms/IPO/OpenMPOpt.h
The file was addedllvm/test/Transforms/OpenMP/gpu_kernel_detection_remarks.ll
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit 624d34afff5de099a6f84e678c81055556c3d42d by johannes
[OpenMP] Compute a proper module slice for the CGSCCC pass

The module slice describes which functions we can analyze and transform
while working on an SCC as part of the CGSCC OpenMPOpt pass. So far, we
simply restricted it to the SCC. In a follow up we will need to have a
bigger scope which is why this patch introduces a proper identification
of the module slice. In short, everything that has a transitive
reference to a function in the SCC or is transitively referenced by one
is fair game.

Reviewed By: sstefan1

Differential Revision: https://reviews.llvm.org/D83270
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit 5b0581aedc2252481462970503d1085dc27e65eb by johannes
[OpenMP] Replace function pointer uses in GPU state machine

In non-SPMD mode we create a state machine like code to identify the
parallel region the GPU worker threads should execute next. The
identification uses the parallel region function pointer as that allows
it to work even if the kernel (=target region) and the parallel region
are in separate TUs. However, taking the address of a function comes
with various downsides. With this patch we will identify the most common
situation and replace the function pointer use with a dummy global
symbol (for identification purposes only). That means, if the parallel
region is only called from a single target region (or kernel), we do not
use the function pointer of the parallel region to identify it but a new
global symbol.

Fixes PR46450.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D83271
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
The file was addedllvm/test/Transforms/OpenMP/gpu_state_machine_function_ptr_replacement.ll
Commit c44702bcdf8aa829e28399d0d4ac4bfc5ac4fff1 by joker.eph
Remove unused variable `KMPC_KERNEL_PARALLEL_WORK_FN_PTR_ARG_NO` (NFC)

This fixes a compiler warning.
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit dce6bc18c4e1d086182f9faa3f984912566a3c20 by johannes
[OpenMP][FIX] remove unused variable and long if-else chain

MSVC throws an error if you use "too many" if-else in a row:
  `Frontend/OpenMP/OMPKinds.def(570): fatal error C1061: compiler limit:
    blocks nested too deeply`
We work around it now...
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit c3bdc9814d947946bf8e1062f6bf41b7f8813f80 by n.james93
[clang-tidy] Reworked enum options handling(again)

Reland b9306fd after fixing the issue causing mac builds to fail unittests.

Following on from D77085, I was never happy with the passing a mapping to the option get/store functions. This patch addresses this by using explicit specializations to handle the serializing and deserializing of enum options.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D82188
The file was modifiedclang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/utils/IncludeSorter.h
The file was modifiedclang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
The file was modifiedclang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
The file was modifiedclang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/ClangTidyCheck.h
The file was modifiedclang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
The file was modifiedclang-tools-extra/clang-tidy/ClangTidyCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
Commit 4abdcdb45ee22d77dd64a71cb41e967d35361280 by n.james93
Fix gn builds after 943660fd1
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Frontend/OpenMP/BUILD.gn
Commit 8fb91dfeed1bd1ffdfd31a345e1bf7cf0b7c86e2 by n.james93
Revert "Fix gn builds after 943660fd1"

This reverts commit 4abdcdb45ee22d77dd64a71cb41e967d35361280.
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Frontend/OpenMP/BUILD.gn