LLVM/project a78a223mlir/include/mlir/Dialect/Affine/IR AffineOps.h AffineOps.td, mlir/lib/Dialect/Affine/IR AffineOps.cpp

[MLIR] Migrate AffineDma ops to ODS (NFC) (#182497)

For some historical reasons, seems like we never converted these.
DeltaFile
+0-333mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
+305-0mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+6-51mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+311-3843 files

LLVM/project 9e6a6bellvm/lib/Target/AMDGPU AMDGPUArgumentUsageInfo.h AMDGPUArgumentUsageInfo.cpp, llvm/test/CodeGen/AMDGPU cc-entry.ll llc-pipeline-npm.ll

[AMDGPU] Remove AMDGPUArgumentUsageInfo pass (#182490)

`AMDGPUArgumentUsageInfo` provided a per-function map that
`lowerFormalArguments` would write each function's implicit argument
register layout into, and `passSpecialInputs` would read back when
lowering calls to look up the callee's layout. This per-function map is
redundant for all non-entry callees, which already use the same
`FixedABIFunctionInfo` register layout.

GlobalISel already used `FixedABIFunctionInfo` unconditionally. This
change makes SelectionDAG do the same.
DeltaFile
+0-68llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h
+2-60llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.cpp
+9-39llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+14-14llvm/test/CodeGen/AMDGPU/cc-entry.ll
+9-9llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
+6-9llvm/test/CodeGen/AMDGPU/llc-pipeline-npm.ll
+40-1996 files not shown
+41-22212 files

LLVM/project eac18e7libc/src/__support/GPU allocator.cpp

[libc] Update the GPU allocator to work under post-Volta ITS

Summary:
There were several gaps that caused the allocator not to work under
NVIDIA's independent thread scheduling model. The problems (I know of)
are fixed in this commit. Generally this required using correct masks,
synchronizing before a few dependent operations, and overhauling the
allocate function to stick with the existing mask instead of querying
it.

The general idiom here is that at the start we obtain a single mask and
opportunistically use it. Every use must specifically sync this subset.
I.e. query a single time and never change it.

This passes most tests, however I have encountered two issues.
1. A bug in `nvlink` failing to link symbols called in 'free'
2. A deadlock under heavy divergence caused by IPSCCP altering control
   flow.


    [2 lines not shown]
DeltaFile
+53-46libc/src/__support/GPU/allocator.cpp
+53-461 files

LLVM/project 966a461llvm/lib/Transforms/Vectorize VectorCombine.cpp, llvm/test/Transforms/VectorCombine/AArch64 fold-signbit-reduction-cmp.ll

[VectorCombine] Support ashr sign-bit extraction (#181998)

This change extends a sign-bit reduction fold introduced earlier. Prior
to it, we only supported LSHR isntructions for sign-bits extraction.
Similar logic can be applied to ASHR and the fold can be generalized.

## Alive2 proofs

| Reduction | == 0 | == -1 / -N | slt 0 | sgt -1 / -N | 
|-----------|------|------------|-------|-------------|
| or | [proof](https://alive2.llvm.org/ce/z/DaSMPt) |
[proof](https://alive2.llvm.org/ce/z/wzR48R) |
[proof](https://alive2.llvm.org/ce/z/rfyr_7) |
[proof](https://alive2.llvm.org/ce/z/MTFFe5) |
| and | [proof](https://alive2.llvm.org/ce/z/PmmpbX) |
[proof](https://alive2.llvm.org/ce/z/7_9hSn) |
[proof](https://alive2.llvm.org/ce/z/wudWY3) |
[proof](https://alive2.llvm.org/ce/z/QZ33KB) |
| umax | [proof](https://alive2.llvm.org/ce/z/gQGnDc) |

    [10 lines not shown]
DeltaFile
+322-0llvm/test/Transforms/VectorCombine/AArch64/fold-signbit-reduction-cmp.ll
+309-0llvm/test/Transforms/VectorCombine/X86/fold-signbit-reduction-cmp.ll
+303-0llvm/test/Transforms/VectorCombine/RISCV/fold-signbit-reduction-cmp.ll
+69-27llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+1,003-274 files

LLVM/project 134e538clang/lib/CodeGen CGStmtOpenMP.cpp, llvm/include/llvm/Frontend/OpenMP OMPIRBuilder.h

Use BasicBlocks to place deallocations
DeltaFile
+63-61mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+56-68llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+58-58llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+25-25llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+15-15clang/lib/CodeGen/CGStmtOpenMP.cpp
+16-13llvm/lib/Transforms/Utils/CodeExtractor.cpp
+233-2403 files not shown
+243-2519 files

LLVM/project 669b900mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp

streamline target privatization
DeltaFile
+8-22mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+8-221 files

LLVM/project bda1091llvm/include/llvm/Frontend/OpenMP OMPIRBuilder.h, llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

Update after rebase
DeltaFile
+14-8llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+11-10mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+4-2llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+29-203 files

LLVM/project 6f8ffa3clang/lib/CodeGen CGStmtOpenMP.cpp, llvm/include/llvm/Frontend/OpenMP OMPIRBuilder.h

[OMPIRBuilder] Add support for explicit deallocation points

In this patch, some OMPIRBuilder codegen functions and callbacks are updated to
work with arrays of deallocation insertion points. The purpose of this is to
enable the replacement of `alloca`s with other types of allocations that
require explicit deallocations in a way that makes it possible for
`CodeExtractor` instances created during OMPIRBuilder finalization to also use
them.

The OpenMP to LLVM IR MLIR translation pass is updated to properly store and
forward deallocation points together with their matching allocation point to
the OMPIRBuilder.

Currently, only the `DeviceSharedMemCodeExtractor` uses this feature to get the
`CodeExtractor` to use device shared memory for intermediate allocations when
outlining a parallel region inside of a Generic kernel (code path that is only
used by Flang via MLIR, currently). However, long term this might also be
useful to refactor finalization of variables with destructors, potentially
reducing the use of callbacks and simplifying privatization and reductions.

    [5 lines not shown]
DeltaFile
+193-133llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+143-168llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+137-96mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+58-39llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+43-34clang/lib/CodeGen/CGStmtOpenMP.cpp
+20-17llvm/lib/Transforms/Utils/CodeExtractor.cpp
+594-4879 files not shown
+630-51615 files

LLVM/project 99c74cellvm/lib/Frontend/OpenMP OMPIRBuilder.cpp, llvm/unittests/Frontend OpenMPIRBuilderTest.cpp

improve device shared memory handling for parallel regions
DeltaFile
+28-20llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+17-2llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+6-1mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir
+51-233 files

LLVM/project 1267822llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

Address formatting issue
DeltaFile
+3-3llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+3-31 files

LLVM/project 63d61abllvm/include/llvm/Frontend/OpenMP OMPIRBuilder.h, llvm/include/llvm/Transforms/Utils CodeExtractor.h

rename allocIP back to allocaIP
DeltaFile
+69-69llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+51-50mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+49-49llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+18-18llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+3-2llvm/include/llvm/Transforms/Utils/CodeExtractor.h
+2-2llvm/lib/Transforms/Utils/CodeExtractor.cpp
+192-1901 files not shown
+194-1927 files

LLVM/project 2da729aclang .clang-format-ignore

Do not format .td files in Clang; NFC (#182075)

We have varying needs for these files. e.g., a diagnostic file is a
different kind of file than compiler options which is different than
attributes which is different than attribute documentation, etc. So
running clang-format over .td files in Clang is not going well in
practice because of how often it reformats things unlike the rest of the
file. This results in a poor new contributor experience because
pre-commit CI tells them the changes are not clang-format clean but we
don't want the changes to be clang-format clean and so a reviewer asks
them to revert and ignore pre-commit CI.

---------

Co-authored-by: Sirraide <aeternalmail at gmail.com>
DeltaFile
+3-0clang/.clang-format-ignore
+3-01 files

LLVM/project 72f5050mlir/include/mlir/IR OperationSupport.h, mlir/include/mlir/Transforms GreedyPatternRewriteDriver.h

[mlir][NFC] Remove unused deprecated API wrappers (#182715)

Remove deprecated functions and constructors that have zero callers in
the monorepo: `applyPatternsAndFoldGreedily`, `applyOpPatternsAndFold`,
`NamedAttrList(std::nullopt_t)`, and `OpPrintingFlags(std::nullopt_t)`.

These had FIXME comments requesting their removal.
DeltaFile
+0-37mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
+0-4mlir/include/mlir/IR/OperationSupport.h
+0-412 files

LLVM/project 26a6d88llvm/lib/Transforms/IPO FunctionAttrs.cpp, llvm/test/Transforms/FunctionAttrs nofpclass-issue182834.ll

FunctionAttrs: Do not infer top down on functions with no uses

Guards against introducing illegal nofpclass on functions that don't
have FP typed arguments or return values. This would only happen if
the call graph analysis had stale edges.

Fixes #182834
DeltaFile
+78-0llvm/test/Transforms/FunctionAttrs/nofpclass-issue182834.ll
+1-1llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+79-12 files

LLVM/project b9f5d70llvm/test/CodeGen/AArch64 aarch64-neonvector-tensorflow-regression.ll

Compile time regression test
DeltaFile
+13-0llvm/test/CodeGen/AArch64/aarch64-neonvector-tensorflow-regression.ll
+13-01 files

LLVM/project 3944d84flang/docs ReleaseNotes.md

review comments, Tarun
DeltaFile
+3-3flang/docs/ReleaseNotes.md
+3-31 files

LLVM/project 0e3a96dllvm/test/CodeGen/X86 vector-shuffle-512-v64.ll

[X86] Add test coverage for #137422 (#182832)

DeltaFile
+73-0llvm/test/CodeGen/X86/vector-shuffle-512-v64.ll
+73-01 files

LLVM/project 532d229flang/docs ReleaseNotes.md

[flang][ReleaseNotes] Add `do concurrent` parallelizatio note
DeltaFile
+12-0flang/docs/ReleaseNotes.md
+12-01 files

LLVM/project fd44b06clang/include/clang/Analysis/Analyses/LifetimeSafety LifetimeSafety.h, clang/include/clang/Basic DiagnosticGroups.td DiagnosticSemaKinds.td

[LifetimeSafety] Reorganize diagnostic groups and remove confidence-based warnings (#179309)

Reorganized lifetime safety diagnostic groups to be more granular and
renamed diagnostic messages for better clarity.

- **Diagnostic Group Restructuring**: Split lifetime safety warnings
into more specific categories:
- `lifetime-safety-use-after-scope` and
`lifetime-safety-use-after-scope-moved` for scope-related issues
- `lifetime-safety-return-stack-addr` and
`lifetime-safety-return-stack-addr-moved` for return address issues
- `lifetime-safety-dangling-field` and
`lifetime-safety-dangling-field-moved` for field reference issues
- Added new umbrella groups `lifetime-safety-validations` and
`lifetime-safety-all`
- **Diagnostic Message Updates**: Renamed warning diagnostics from
generic "loan expires" terminology to more specific messages like "use
after scope" and "return stack addr"
- **Code Cleanup**: Removed `Confidence` logic (based on possible vs

    [22 lines not shown]
DeltaFile
+59-12clang/include/clang/Basic/DiagnosticGroups.td
+10-15clang/lib/Sema/AnalysisBasedWarnings.cpp
+9-12clang/include/clang/Basic/DiagnosticSemaKinds.td
+9-9clang/test/Sema/warn-lifetime-safety.cpp
+2-0clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeSafety.h
+89-485 files

LLVM/project 2358290llvm/lib/CodeGen PrologEpilogInserter.cpp

[CodeGen] Workaround for compiler crash

This patch implements a workaround for a "Getting frame offset for a dead
object?" assertion triggered when compiling the target-generic-loops.f90
offloading test. A more concise reproducer for this issue:

```f90
! flang -O0 -fopenmp -fopenmp-version=52 --offload-arch=gfx1100 test.f90
program main
  integer :: i, counter

  !$omp target teams distribute
  do i=1, 10
  end do

  counter = 0
  !$omp target map(tofrom: counter)
    !$omp parallel do reduction(+:counter)
    do i=1, 10

    [11 lines not shown]
DeltaFile
+9-1llvm/lib/CodeGen/PrologEpilogInserter.cpp
+9-11 files

LLVM/project b9f45f8llvm/lib/Transforms/IPO OpenMPOpt.cpp, offload/test/offloading/fortran target-generic-loops.f90 target-spmd-loops.f90

[OpenMPOpt] Make parallel regions reachable from new DeviceRTL loop functions

This patch updates the OpenMP optimization pass to know about the new DeviceRTL
functions for loop constructs.

This change marks these functions as potentially containing parallel regions,
which fixes a current bug with the state machine rewrite optimization. It
previously failed to identify parallel regions located inside of the callbacks
passed to these new DeviceRTL functions, causing the resulting code to skip
executing these parallel regions.

As a result, Generic kernels produced by Flang that contain parallel regions
now work properly.

One known related issue not fixed by this patch is that the presence of calls
to these functions will prevent the SPMD-ization of Generic kernels by
OpenMPOpt. Previously, this was due to assuming there was no parallel region.
This is changed by this patch, but instead we now mark it temporarily as
unsupported in an SPMD context. The reason is that, without additional changes,

    [3 lines not shown]
DeltaFile
+130-0offload/test/offloading/fortran/target-generic-loops.f90
+39-0offload/test/offloading/fortran/target-spmd-loops.f90
+22-0llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+191-03 files

LLVM/project 564cebcllvm/lib/Transforms/IPO OpenMPOpt.cpp

Address review comments
DeltaFile
+2-1llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+2-11 files

LLVM/project 302dcballvm/lib/Frontend/OpenMP OMPIRBuilder.cpp, mlir/test/Target/LLVMIR omptarget-parallel-llvm.mlir

[OpenMP][OMPIRBuilder] Support parallel in Generic kernels

This patch introduces codegen logic to produce a wrapper function argument for
the `__kmpc_parallel_51` DeviceRTL function needed to handle arguments passed
using device shared memory in Generic mode.
DeltaFile
+94-6llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+22-3mlir/test/Target/LLVMIR/omptarget-parallel-llvm.mlir
+116-92 files

LLVM/project dbda6bdllvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

Address review comments
DeltaFile
+7-7llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+7-71 files

LLVM/project 51da22dllvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

formatting
DeltaFile
+2-2llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+2-21 files

LLVM/project 36d60b1clang/docs/analyzer checkers.rst, clang/include/clang/StaticAnalyzer/Checkers Checkers.td

[analyzer] New checker: optin.core.UnconditionalVAArg (#175602)

Add a new optin checker which reports variadic functions that
unconditionally use `va_arg()`. It would be undefined behavior to call
such functions without passing any variadic arguments, so the SEI-CERT
rule EXP47-C says that this pattern should be avoided.

As this part of this SEI-CERT rule focuses on a very narrow area, I
aimed to write a simple and stable checker that can report basic "clear"
occurrences of this fault. It would be possible to cover some additional
corner cases, but it isn't worth the effort.
DeltaFile
+274-0clang/test/Analysis/unconditional-va_arg.c
+175-0clang/lib/StaticAnalyzer/Checkers/UnconditionalVAArgChecker.cpp
+43-0clang/docs/analyzer/checkers.rst
+5-0clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+4-0clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+1-1clang/lib/StaticAnalyzer/Checkers/VAListChecker.cpp
+502-12 files not shown
+504-18 files

LLVM/project d70d18bmlir/test/lib/Dialect/Test TestAttributes.cpp

[MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in TestAttributes.cpp (NFC)
DeltaFile
+1-1mlir/test/lib/Dialect/Test/TestAttributes.cpp
+1-11 files

LLVM/project baef055libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint midpoint.integer.pass.cpp midpoint.float.pass.cpp

[libc++][NFC] Format `std::midpoint` tests (#175531)

### Summary

- Format code
- Fix comments

Extracted NFC changes from PR #175388.
DeltaFile
+97-98libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
+90-87libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
+49-55libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.pointer.pass.cpp
+236-2403 files

LLVM/project 20bdcbdclang/lib/Sema SemaAPINotes.cpp, clang/test/APINotes fields.cpp

[APINotes] Fix fatal error when using the Type key on fields (#180672)

This fixes a clang crash when importing a module with apinotes that sets
the Type key on a Field:
```
# .---command stderr------------
# | API notes allowed a type on an unknown declaration
# | UNREACHABLE executed at <path>/llvm-project/clang/lib/Sema/SemaAPINotes.cpp:419!
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
# | Stack dump:
# | 0.  <path>/llvm-project/clang/test/APINotes/Inputs/Headers/Fields.h:4:12: current parser token ';'
# | 1.  <path>/llvm-project/clang/test/APINotes/Inputs/Headers/Fields.h:3:1: parsing struct/union/class body 'IntWrapper'
...
# |  #8 0x0000000109540868 clang::Sema::ApplyAPINotesType(clang::Decl*, llvm::StringRef)
# |  #9 0x000000010955c6ec applyAPINotesType(clang::Sema&, clang::Decl*, llvm::StringRef, (anonymous namespace)::VersionedInfoMetadata)
```
```yaml
Tags:
- Name: IntWrapper

    [24 lines not shown]
DeltaFile
+6-0clang/lib/Sema/SemaAPINotes.cpp
+2-0clang/test/APINotes/Inputs/Headers/Fields.h
+1-1clang/test/APINotes/fields.cpp
+1-0clang/test/APINotes/Inputs/Headers/Fields.apinotes
+10-14 files

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

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

This reverts commit 6767bfeec5ede8a878792e39aedff053c36854b2.

This breaks the tools/gold/X86/multiple-sections.ll test.
DeltaFile
+0-27llvm/test/CodeGen/X86/prefalign.ll
+2-14llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+2-2llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
+1-1lld/test/ELF/lto/linker-script-symbols-ipo.ll
+5-444 files