commit | c26db586a06204a9e6f9912f41fce62a559a0196 | [log] [tgz] |
---|---|---|
author | Prakhar Dixit <dixitprakhar11@gmail.com> | Wed Apr 30 20:51:54 2025 +0530 |
committer | GitHub <noreply@github.com> | Wed Apr 30 17:21:54 2025 +0200 |
tree | 6915bbeb7f4ebbd4e695a92c0e26cb8400fab301 | |
parent | 75f040ab3e119e0ee87963ec9d2a01b1e6d4039e [diff] |
[mlir][affine] Modify assertion into a user visible diagnostic (#136474) Fixes #122227 The loop’s induction variable (%i) is used to compute two different indices via affine.apply. And the Vectorization Assumption is Violated i.e, Each vectorized loop should contribute at most one non-invariant index. **Minimal example crashing :** ``` #map = affine_map<(d0)[s0] -> (d0 mod s0)> #map1 = affine_map<(d0)[s0] -> (d0 floordiv s0)> func.func @single_loop_unrolling_2D_access_pattern(%arg0: index) -> memref<2x2xf32> { %c2 = arith.constant 2 : index %cst = arith.constant 1.0 : f32 %alloc = memref.alloc() : memref<2x2xf32> affine.for %i = 0 to 4 { %row = affine.apply #map1(%i)[%c2] %col = affine.apply #map(%i)[%c2] affine.store %cst, %alloc[%row, %col] : memref<2x2xf32> } return %alloc : memref<2x2xf32> } ``` The single loop %i contributes two indices (%row and %col) to the 2D memref access. The permutation map expects one index per vectorized loop dimension, but here one loop (%i) maps to two indices (dim=0 and dim=1). The code detects this when trying to assign the second index (dim=1) to the same vector dimension (perm[0]).
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.
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.
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.