LLVM/project 70b5a1dflang-rt/lib/runtime io-api-server.cpp io-api-gpu.cpp, offload/test/offloading/fortran formatted-io.f90

[flang-rt] Add support for formatted I/O on the GPU (#182580)

Summary:
Expands on the previous support to enable formatted output, characters,
and checking basic iostat. We intentionally do not handle cases where
the descriptor is non-null as this is a non-trivial class that cannot
easily be shepherded across the wire.
DeltaFile
+67-0offload/test/offloading/fortran/formatted-io.f90
+52-9flang-rt/lib/runtime/io-api-server.cpp
+26-6flang-rt/lib/runtime/io-api-gpu.cpp
+15-12flang-rt/lib/runtime/io-api-gpu.h
+160-274 files

LLVM/project 2b07482flang/lib/Optimizer/Transforms FIRToMemRef.cpp, flang/test/Transforms/FIRToMemRef array-coor-block-arg.mlir no-declare.mlir

Reapply "[flang] Lowering a ArrayCoorOp to arithmetic computations" (#182585)

Reapplying the changes. Reverted it wrongly yesterday

This reverts commit 3c6523dcb8ebc0396f69c578285599b66e16dce7.
DeltaFile
+14-15flang/lib/Optimizer/Transforms/FIRToMemRef.cpp
+28-0flang/test/Transforms/FIRToMemRef/array-coor-block-arg.mlir
+7-6flang/test/Transforms/FIRToMemRef/no-declare.mlir
+49-213 files

LLVM/project fafaaa1llvm/lib/Transforms/Scalar LoopFuse.cpp

[LoopFusion] Improve collectFusionCandidates() (#182571)

The order of visiting loops in collectFusionCandidates() guarantees that
a new member can only possibly be added to the end of a set.

Also currently `NumFusionCandidates` counts any loop that is added to a
candidate set. Usually large majority of candidate sets have a single
members so they are not really candidates for fusion. Only the second
member of a candidate set and the ones that come after that could be
counted as fusion candidates.
DeltaFile
+2-11llvm/lib/Transforms/Scalar/LoopFuse.cpp
+2-111 files

LLVM/project 2f47bbfclang/include/clang/CIR/Dialect/IR CIRCUDAAttrs.td CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenCall.cpp

[CIR][CUDA] Add CUDAKernelNameAttr for device stubs (#180051)

Besides the Attribute description. It is worth noting that this
attribute will later be consumed when handling runtime registration on
loweringPrepare.
DeltaFile
+40-0clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+10-0clang/lib/CIR/CodeGen/CIRGenCall.cpp
+3-3clang/test/CIR/CodeGenCUDA/kernel-stub-name.cu
+2-0clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+55-34 files

LLVM/project 5c92981utils/bazel/llvm-project-overlay/mlir BUILD.bazel

[bazel][NVVM][MLIR] Port 7d9b863bc39f690c6f7716dd27d24e6ccfcfae33 (#182588)

Co-authored-by: Pranav Kant <prka at google.com>
DeltaFile
+27-0utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+27-01 files

LLVM/project 8735e69flang/lib/Optimizer/CodeGen CodeGen.cpp

[flang] OPTIONAL char dummy has no defining op; add null check (#182582)

size.getDefiningOp() returns nullptr for block arguments when a OPTIONAL
character length generated the conditional "fir.if". Check for a nullptr
before calling mlir::isa<> to avoid the crash.

Addresses: https://github.com/llvm/llvm-project/issues/182436
Passes check-flang, check-flang-rt, and llvm-test-suite (x86_64)

---------

Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval at gmail.com>
DeltaFile
+3-1flang/lib/Optimizer/CodeGen/CodeGen.cpp
+3-11 files

LLVM/project 94724e8llvm/test/Transforms/LoopVectorize epilog-iv-select-cmp.ll

[LV] Add epilogue test with FindLast reduction of wrapping IV.

Extra test coverage for https://github.com/llvm/llvm-project/pull/172569
DeltaFile
+71-0llvm/test/Transforms/LoopVectorize/epilog-iv-select-cmp.ll
+71-01 files

LLVM/project 7d9b863mlir/include/mlir/Conversion Passes.td, mlir/include/mlir/Conversion/GPUToNVVM GPUToNVVMPass.h

[NVVM][MLIR] Refactor conversion of Math / Arith Operations seperate Passes (#180058)

This Commit refactors the conversion of Math / Arith operations to NVVM
into a separate Pass called MathToNVVM. This was done to allow to
support the lowering of Math / Arith operations in flang. This mirrors
what was done in MathToROCDL.

This is PR (1/2) to address
https://github.com/llvm/llvm-project/issues/147023 and
https://github.com/llvm/llvm-project/issues/179347.

PR(2/2) that adds this pass to flang is here:
https://github.com/llvm/llvm-project/pull/180060
DeltaFile
+279-0mlir/lib/Conversion/MathToNVVM/MathToNVVM.cpp
+1-217mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
+27-0mlir/include/mlir/Conversion/MathToNVVM/MathToNVVM.h
+26-0mlir/lib/Conversion/MathToNVVM/CMakeLists.txt
+14-0mlir/include/mlir/Conversion/Passes.td
+0-6mlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
+347-2233 files not shown
+350-2239 files

LLVM/project f1a9f1allvm/test/CodeGen/AMDGPU amdgpu-simplify-libcall-pow.ll amdgpu-simplify-libcall-powr.ll

Revert "AMDGPU: Perform libcall recognition to replace fast OpenCL pow (#182135)"

This reverts commit fdc4274e2fcc79b8ba3064235da721573cdeea83.
DeltaFile
+1,728-4,143llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow.ll
+881-1,244llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-powr.ll
+440-633llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-rootn.ll
+0-658llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow-fast.ll
+0-566llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pown-fast.ll
+0-487llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-powr-fast.ll
+3,049-7,7316 files not shown
+3,268-8,54112 files

LLVM/project a8989c0clang/unittests/Analysis/Scalable CMakeLists.txt, clang/unittests/Analysis/Scalable/Serialization JSONFormatTest.cpp

[clang][ssaf] Refactor `JSONFormatTest` into a directory with a shared fixture header (#182523)

This change converts `Serialization/JSONFormatTest.cpp` into a directory
to support reuse of the `JSONFormatTest` fixture by upcoming test files
for additional data structures with JSON serialization support. New test
files for other serializable data structures can now include
`JSONFormatTest.h`, inherit from `JSONFormatTest`, and add their own
fixture and tests without duplicating the filesystem scaffolding.
DeltaFile
+0-1,848clang/unittests/Analysis/Scalable/Serialization/JSONFormatTest.cpp
+1,736-0clang/unittests/Analysis/Scalable/Serialization/JSONFormatTest/TUSummaryTest.cpp
+144-0clang/unittests/Analysis/Scalable/Serialization/JSONFormatTest/JSONFormatTest.h
+1-1clang/unittests/Analysis/Scalable/CMakeLists.txt
+1,881-1,8494 files

LLVM/project 23d1e36llvm/lib/Target/AMDGPU AMDGPULibFunc.cpp

AMDGPU: Try to fix leak in AMDGPULibFunc

I don't know why this was trying to do placement do. I guess
this was overriding the unique_ptr, bypassing its destructor.
DeltaFile
+1-1llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp
+1-11 files

LLVM/project 0dd1cb0clang/lib/CodeGen/TargetBuiltins ARM.cpp, clang/lib/Sema SemaARM.cpp

[clang][ARM] Refactor argument handling in `EmitAArch64BuiltinExpr` (2/2) (NFC) (#181974)

Refactor `EmitAArch64BuiltinExpr` so that all AArch64/NEON builtins
handled by this hook _and marked as overloaded_ share a common path
for generating LLVM IR arguments (collected into the `Ops`
`SmallVector<Value*>`) (*). This is a follow-up for #181794 - please
refer to that PR for more context.

As in the previous PR, the key change is implemented in
`HasExtraNeonArgument` , i.e. in the hook that identifies Builtins with
the extra argument. In this PR, I am replacing the ad-hoc switch
statement with a more principled approach borrowed from SemaARM.cpp,
namely:
```cpp
static bool HasExtraNeonArgument(unsigned BuiltinID) {
  // (...)
  uint64_t mask = 0;
  switch (BuiltinID) {
  #define GET_NEON_OVERLOAD_CHECK

    [29 lines not shown]
DeltaFile
+48-254clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+3-1clang/lib/Sema/SemaARM.cpp
+51-2552 files

LLVM/project 11d7e13clang/tools/c-index-test core_main.cpp

[c-index-test] Avoid loading a module input file when we need a file name only. (#182426)

Loading a module input file triggers its validation. Avoid this process
when we need only a file name.

rdar://167647519
DeltaFile
+10-5clang/tools/c-index-test/core_main.cpp
+10-51 files

LLVM/project 741b2cdllvm/cmake/modules HandleLLVMOptions.cmake

Re-enable MSVC C4706 diagnostic; NFC (#182564)

From MSDN:

https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4706?view=msvc-170

> assignment used as a condition

This diagnostic was disabled as part of enabling /W4 use in
5c73e1f85c5d37a5b037c70f3c112eec5646acb3 where there were hundreds of
instances of the diagnostic being triggered. However, local testing
suggests we now are adding the parentheses required to silence the
diagnostic, and so I believe this can be enabled again.
DeltaFile
+0-1llvm/cmake/modules/HandleLLVMOptions.cmake
+0-11 files

LLVM/project 2092145libc/src/setjmp/arm longjmp.cpp setjmp.cpp

[libc] Save one instruction on ARM (#181515)

For assembler functions, doing them as best as possible is paramount.
Save sp in ARM, restore sp in ARM.
DeltaFile
+17-1libc/src/setjmp/arm/longjmp.cpp
+16-1libc/src/setjmp/arm/setjmp.cpp
+33-22 files

LLVM/project 6767bfelld/test/ELF/lto linker-script-symbols-ipo.ll, llvm/lib/CodeGen/AsmPrinter AsmPrinter.cpp

CodeGen: Emit .prefalign directives based on the prefalign attribute.

The result of the MachineFunction preferred alignment query is emitted
as a .prefalign directive if supported, otherwise it gets combined into
the minimum alignment.

Part of this RFC:
https://discourse.llvm.org/t/rfc-enhancing-function-alignment-attributes/88019

Reviewers: nikic, vitalybuka

Reviewed By: vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/155529
DeltaFile
+27-0llvm/test/CodeGen/X86/prefalign.ll
+14-2llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+2-2llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
+1-1lld/test/ELF/lto/linker-script-symbols-ipo.ll
+44-54 files

LLVM/project a5fc887llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn build] Port d7a24d30f62bc
DeltaFile
+1-0llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+1-01 files

LLVM/project 11ddecellvm/utils/gn/secondary/llvm/lib/MC BUILD.gn, llvm/utils/gn/secondary/llvm/lib/MC/MCParser BUILD.gn

[gn build] Port f6c86bd69d92e
DeltaFile
+2-0llvm/utils/gn/secondary/llvm/lib/MC/BUILD.gn
+1-0llvm/utils/gn/secondary/llvm/lib/MC/MCParser/BUILD.gn
+3-02 files

LLVM/project fec29b3llvm/utils/gn/secondary/clang/lib/Analysis/Scalable BUILD.gn, llvm/utils/gn/secondary/clang/unittests/Analysis/Scalable BUILD.gn

[gn build] Port 98c76d36432cc
DeltaFile
+2-0llvm/utils/gn/secondary/clang/unittests/Analysis/Scalable/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/lib/Analysis/Scalable/BUILD.gn
+3-02 files

LLVM/project 13948d7llvm/utils/gn/secondary/clang/lib/Analysis/Scalable BUILD.gn, llvm/utils/gn/secondary/clang/unittests/Analysis/Scalable BUILD.gn

[gn build] Port 7c3c9c45f85da
DeltaFile
+1-0llvm/utils/gn/secondary/clang/lib/Analysis/Scalable/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/unittests/Analysis/Scalable/BUILD.gn
+2-02 files

LLVM/project 847608cllvm/utils/gn/secondary/clang/unittests/Analysis/Scalable BUILD.gn

[gn build] Port 41c6aa67a3430
DeltaFile
+1-0llvm/utils/gn/secondary/clang/unittests/Analysis/Scalable/BUILD.gn
+1-01 files

LLVM/project ce1628cllvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone BUILD.gn

[gn build] Port 8f378ea7e6fa3
DeltaFile
+1-0llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone/BUILD.gn
+1-01 files

LLVM/project fef1c43llvm/utils/gn/secondary/llvm/lib/CodeGen BUILD.gn, llvm/utils/gn/secondary/llvm/unittests/CodeGen BUILD.gn

[gn build] Port 32392468d7139
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn
+1-0llvm/utils/gn/secondary/llvm/unittests/CodeGen/BUILD.gn
+2-02 files

LLVM/project 3a30812llvm/test/CodeGen/RISCV clmul.ll clmulr.ll

[RISCV] Pre-commit tests for #182389 (#182558)

Split clmul.ll into 3 files to reduce size.

Add RUN lines without M extension. Add RUN lines with M+Zbs.
DeltaFile
+14,035-8,410llvm/test/CodeGen/RISCV/clmul.ll
+14,058-0llvm/test/CodeGen/RISCV/clmulr.ll
+13,835-0llvm/test/CodeGen/RISCV/clmulh.ll
+41,928-8,4103 files

LLVM/project ebe9c6ellvm/include/llvm/CodeGen MachineFunction.h, llvm/lib/CodeGen MachineFunction.cpp

CodeGen: Introduce MachineFunction::getPreferredAlignment().

MachineFunction can now be queried for the preferred alignment which
comes from the function attributes (optsize, minsize, prefalign) and
TargetLowering.

Part of this RFC:
https://discourse.llvm.org/t/rfc-enhancing-function-alignment-attributes/88019

Reviewers: vitalybuka, nikic, efriedma-quic, MaskRay

Reviewed By: vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/158368
DeltaFile
+13-5llvm/lib/CodeGen/MachineFunction.cpp
+4-0llvm/include/llvm/CodeGen/MachineFunction.h
+2-2llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+1-1llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+1-1llvm/lib/Target/X86/X86AsmPrinter.cpp
+1-1llvm/test/CodeGen/PowerPC/alloca-crspill.ll
+22-106 files

LLVM/project 47ad905lldb/source/Utility ArchSpec.cpp

[lldb][RISCV] Make char an unsigned type for RISC-V by default (#182260)

According to RISC-V ELF psABI, Section 4.3 (C/C++ Type Representations)
"char is unsigned".

This patch makes plain `char` unsigned by default on RISC-V. Also this
fixes TestConstStaticIntegralMember.py on RISC-V
DeltaFile
+2-0lldb/source/Utility/ArchSpec.cpp
+2-01 files

LLVM/project 763fbee.github/workflows lldb-pylint-action.yml, llvm/utils/git requirements_pylint.txt requirements_pylint.txt.in

[CI][lldb] Add a github workflow that runs pylint on LLDB API test changes (#182003)

The motivator here is that Python allows class methods to be redefined.
But in the vast majority of cases this is a bug. E.g., in our API
test-suite two methods with the same name cause the latest definition to
shadow the earlier, in which case only one test-case runs. This happens
silently. Every couple of months i've been running the script from
https://github.com/llvm/llvm-project/pull/97043 manually on the
code-base and it catches a handful of these every time.

This patch sets up a github action that runs on pull requests that
change any files under `lldb/test/API`. The action runs `pylint` on the
changed Python files. The caveat here is that `pylint` isn't set up to
run cleanly on our test-suite. So I just use the [specific redefinition
error
code](https://pylint.readthedocs.io/en/stable/user_guide/messages/error/function-redefined.html).
Any other errors won't cause `pylint` to fail for now (hence the
`--error-under=0`).


    [3 lines not shown]
DeltaFile
+60-0.github/workflows/lldb-pylint-action.yml
+34-0llvm/utils/git/requirements_pylint.txt
+1-0llvm/utils/git/requirements_pylint.txt.in
+95-03 files

LLVM/project 02b541allvm/lib/Target/Hexagon HexagonGlobalScheduler.cpp, llvm/test/CodeGen/AMDGPU fmaxnum.ll fminnum.ll

Address review comments

Created using spr 1.3.6-beta.1
DeltaFile
+5,330-0llvm/lib/Target/Hexagon/HexagonGlobalScheduler.cpp
+2,601-98llvm/test/CodeGen/AMDGPU/fmaxnum.ll
+2,510-101llvm/test/CodeGen/AMDGPU/fminnum.ll
+831-0llvm/test/CodeGen/Hexagon/global-sched-skip-vsub_fake.ll
+612-4mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+444-172llvm/test/CodeGen/X86/cmov-fp.ll
+12,328-375543 files not shown
+28,599-4,973549 files

LLVM/project 7588e7bllvm/lib/Target/Hexagon HexagonGlobalScheduler.cpp, llvm/test/CodeGen/AMDGPU fmaxnum.ll fminnum.ll

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.6-beta.1

[skip ci]
DeltaFile
+5,330-0llvm/lib/Target/Hexagon/HexagonGlobalScheduler.cpp
+2,601-98llvm/test/CodeGen/AMDGPU/fmaxnum.ll
+2,510-101llvm/test/CodeGen/AMDGPU/fminnum.ll
+831-0llvm/test/CodeGen/Hexagon/global-sched-skip-vsub_fake.ll
+612-4mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+444-172llvm/test/CodeGen/X86/cmov-fp.ll
+12,328-375542 files not shown
+28,597-4,973548 files

LLVM/project de3034bclang/include/clang/Analysis/Scalable/Analyses/UnsafeBufferUsage UnsafeBufferUsage.h UnsafeBufferUsageBuilder.h, clang/unittests/Analysis/Scalable CMakeLists.txt

[clang][ssaf] Add UnsafeBufferUsage summary data structures (#181067)

An UnsafeBufferUsage summary is the ssaf representation of the set of
unsafe buffer pointers found by `-Wunsafe-buffer-usage` in a translation
unit.

rdar://170176278

---------

Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
DeltaFile
+120-0clang/include/clang/Analysis/Scalable/Analyses/UnsafeBufferUsage/UnsafeBufferUsage.h
+100-0clang/unittests/Analysis/Scalable/Analyses/UnsafeBufferUsage/UnsafeBufferUsageTest.cpp
+31-0clang/include/clang/Analysis/Scalable/Analyses/UnsafeBufferUsage/UnsafeBufferUsageBuilder.h
+1-0clang/unittests/Analysis/Scalable/CMakeLists.txt
+252-04 files