Manual-sync mirror of chromium.googlesource.com/external/github.com/llvm/llvm-project (bare monorepo, no subtree suffix)
Find a file
Andrzej Warzyński de5cef3127
[mlir][vector] Extend combineContractAndBroadcast to accept vector.shape_cast (#208752)
`combineContractAndBroadcast` is a pattern that matches
`vector.contract` operations whose inputs are defined by
`vector.broadcast`, e.g.:

```mlir
%0 = vector.broadcast %lhs : vector<8x4xi32> to vector<1x8x4xi32>
%1 = vector.broadcast %rhs : vector<8x4xi32> to vector<1x8x4xi32>
%result = vector.contract {
    indexing_maps = [#map0, #map1, #map2],
    iterator_types = ["reduction", "parallel", "parallel", "reduction"],
    kind = #vector.kind<add>
  } %0, %1, %acc : vector<1x8x4xi32>, vector<1x8x4xi32> into vector<8x8xi32>
```

The pattern folds away the reduction over a unit dimension introduced by
the defining operations, producing a simplified `vector.contract`:

```mlir
vector.contract {
  indexing_maps = [#[[$MAP0]], #[[$MAP1]], #[[$MAP2]]]
  iterator_types = ["parallel", "parallel", "reduction"]
} %0, %1, %acc : vector<8x4xi32>, vector<8x4xi32> into vector<8x8xi32>
```

This change extends the pattern to also accept broadcast-like
`vector.shape_cast` operations:

```mlir
%0 = vector.shape_cast %lhs : vector<8x4xi32> to vector<1x8x4xi32>
%1 = vector.shape_cast %rhs : vector<8x4xi32> to vector<1x8x4xi32>
%result = vector.contract {
    indexing_maps = [#map0, #map1, #map2],
    iterator_types = ["reduction", "parallel", "parallel", "reduction"],
    kind = #vector.kind<add>
  } %0, %1, %acc : vector<1x8x4xi32>, vector<1x8x4xi32> into vector<8x8xi32>
```

Note that `mlir::vector::isBroadcastableTo` was only moved to make it
available to the newly introduced `ShapeCastOp` helper,
`ShapeCastOp::isBroadcastLike()`.
2026-07-17 15:45:40 +00:00
.ci Revert "[lldb][Windows][CI] split steps (#206946)" (#208519) 2026-07-09 21:45:47 +01:00
.github workflows: Fixes for release-binaries and upload-release-artifact (#209246) 2026-07-16 21:06:59 -07:00
bolt [BOLT] Add fdata symbols mode (#209932) 2026-07-16 17:31:30 -07:00
clang [ExtractAPI] Include nullability attributes (#209221) 2026-07-17 16:42:46 +01:00
clang-tools-extra [clangd][Support] Outline LSP payload decode errors (#203121) 2026-07-17 08:38:19 +03:00
cmake Bump version to 24.0.0git (#209473) 2026-07-14 09:21:03 -04:00
compiler-rt [compiler-rt][test] Use configured Python for lit page-size probe (#209175) 2026-07-17 07:50:28 +02:00
cross-project-tests [DTLTO] Add remote compiler option forwarding coverage (#208589) 2026-07-16 09:56:40 +01:00
flang [Flang][OpenACC] Check routine level for function references in loops (#209529) 2026-07-17 10:48:56 -04:00
flang-rt [fakeflang] Also detect CMakeTestGNU.c (#210175) 2026-07-17 09:01:11 +02:00
libc [libc][docs] Dynamically generate time.h documentation (#210197) 2026-07-17 08:14:57 +01:00
libclc [CMake] Warn when the version of CMake is older than 3.31.0 (#204203) 2026-06-29 11:16:27 -07:00
libcxx [libcxx] avoid include Uppercase windows headers (#208903) 2026-07-17 12:11:45 +03:00
libcxxabi [libc++] Partially revert #208330 (#209928) 2026-07-16 08:15:30 -04:00
libsycl [libsycl] add explicit instantiations for event::get_profiling_info (#210118) 2026-07-17 13:07:39 +02:00
libunwind [libunwind][test] Add .clang-format (#209364) 2026-07-14 13:29:57 -04:00
lld [LLD] [COFF] Fix linking directly against an ARM64X DLL without import library (#210311) 2026-07-17 17:30:31 +02:00
lldb [lldb][Windows] Reuse preloaded exe module on launch (#210010) 2026-07-17 17:32:31 +02:00
llvm [X86] Pull out isFoldableAsShuffle lamdba as helper function. NFC. (#210354) 2026-07-17 15:43:40 +00:00
llvm-libgcc [CMake] Warn when the version of CMake is older than 3.31.0 (#204203) 2026-06-29 11:16:27 -07:00
mlir [mlir][vector] Extend combineContractAndBroadcast to accept vector.shape_cast (#208752) 2026-07-17 15:45:40 +00:00
offload [OFFLOAD][L0] Don't return error on initImpl if library/drivers are missing (#210083) 2026-07-16 22:04:21 +02:00
openmp [OpenMP] Fix endian bug in hierarchical barrier code (#117073) 2026-07-15 18:59:52 +02:00
orc-rt [orc-rt] Add TaskGroup::TokenSource; drop raw group accessor (#210240) 2026-07-17 14:45:45 +10:00
polly Bound ISL operations during DeLICM scalar collapsing (#203073) 2026-07-16 15:42:35 +05:30
runtimes [fakeflang] Also detect CMakeTestGNU.c (#210175) 2026-07-17 09:01:11 +02:00
third-party Fix a warning and an uninitialized variable in benchmark (#200927) 2026-06-02 13:49:06 -07:00
utils [libc][bazel] Add remaining sys/socket functions and tests (#209798) 2026-07-17 07:54:19 +02:00
.clang-format
.clang-format-ignore [Docs] Update coding standard for TD files (#200848) 2026-06-01 21:35:58 +01:00
.clang-tidy Add default empty header filter regex to root .clang-tidy (#167386) 2025-11-11 01:36:25 +03:00
.git-blame-ignore-revs Add "Split clang/lib/CodeGen/CGBuiltin.cpp" to .git-blame-ignore-revs (#203419) 2026-06-12 12:03:28 +01:00
.gitattributes [libclang/python] Enable packaging clang python bindings (#125806) 2025-11-24 17:21:24 -08:00
.gitignore gitignore: Add emacs lock files (#205055) 2026-06-22 18:19:29 +02:00
.mailmap [mailmap] Add mailmap entry for myself (#189447) 2026-03-30 18:35:34 +00:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.TXT
pyproject.toml [docs] Create utils/docs (#203962) 2026-06-24 15:12:48 -04:00
README.md
SECURITY.md [SECURITY.md] add pointers to "what is a security issue" (#177372) 2026-01-22 17:19:09 -07:00

The LLVM Compiler Infrastructure

OpenSSF Scorecard OpenSSF Best Practices libc++

Welcome to the LLVM project!

This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.

The LLVM project has multiple components. The core of the project is itself called "LLVM". This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.

C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.

Other components include: the libc++ C++ standard library, the LLD linker, and more.

Getting the Source Code and Building LLVM

Consult the Getting Started with LLVM page for information on building and running LLVM.

For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.

Getting in touch

Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.

The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.