llvm-project/mlir
Nicolas Vasilache 63b2ff07e8 [mlir] Add padding to 1-D Vector in CRunnerUtils.h
Summary:
This revision fixes a -Wzero-length-array compile error that
caused e459596917 which reverted
78f9e5d098.
Also fixes a struct vs class mismatch that broke compilation with
-Werror for Windows that caused
57397eba7a.

This revision adds padding for 1-D Vector in the common case of x86
execution with a stadard data layout. This supports properly interfacing
codegen with arrays of e.g. `vector<9xf32>`.

Such vectors are already assumed padded to the next power of 2 by LLVM
codegen with the default x86 data layout:
```
define void @test_vector_add_1d_2_3(<3 x float>* nocapture readnone %0,
<3 x float>* nocapture readonly %1, i64 %2, i64 %3, i64 %4, <3 x float>*
nocapture readnone %5, <3 x float>* nocapture readonly %6, i64 %7, i64
%8, i64 %9, <3 x float>* nocapture readnone %10, <3 x float>* nocapture
%11, i64 %12, i64 %13, i64 %14) local_unnamed_addr {
  %16 = getelementptr <3 x float>, <3 x float>* %6, i64 1
  %17 = load <3 x float>, <3 x float>* %16, align 16
  %18 = getelementptr <3 x float>, <3 x float>* %1, i64 1
  %19 = load <3 x float>, <3 x float>* %18, align 16
  %20 = fadd <3 x float> %17, %19
  %21 = getelementptr <3 x float>, <3 x float>* %11, i64 1
```

The pointer addressing a `vector<3xf32>` is assumed aligned `@16`.
Similarly, the pointer addressing a `vector<65xf32>` is assumed aligned
`@512`.

This revision allows using objects such as `vector<3xf32>` properly with
the standard x86 data layout used in the JitRunner. Integration testing
is done out of tree, at the moment such testing fails without this
change.

Differential Revision: https://reviews.llvm.org/D75459
2020-03-03 09:35:06 -05:00
..
cmake/modules Revert "[MLIR] Add support for libMLIR.so" 2020-02-29 11:09:21 -08:00
docs [mlir] Fix typo 2020-02-28 10:59:52 -08:00
examples Revert "[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries." 2020-02-29 11:52:08 -08:00
include [mlir] Add padding to 1-D Vector in CRunnerUtils.h 2020-03-03 09:35:06 -05:00
lib [mlir] Hotfix - Fix Windows build 2020-03-03 09:27:33 -05:00
test [MLIR][GPU] Add error checking to loop.parallel to gpu transform. 2020-03-03 13:29:09 +01:00
tools Revert "[mlir][ods] Add query for derived attribute" 2020-03-03 10:23:38 +01:00
unittests Revert "[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries." 2020-02-29 11:52:08 -08:00
utils [mlir][spirv] Support implied extensions and capabilities 2020-01-17 08:01:57 -05:00
.clang-format [mlir] add .clang-format 2019-03-29 12:41:43 -07:00
.clang-tidy Add a clang-tidy configuration file for MLIR, it is using camelBack for naming at the moment 2019-12-26 21:42:01 +00:00
CMakeLists.txt Revert "[MLIR] Add support for libMLIR.so" 2020-02-29 11:09:21 -08:00
LICENSE.TXT Add the Apache2 with LLVM exceptions license to MLIR 2019-12-24 00:58:06 -08:00
README.md mlir README.md: Fix the syntax 2019-12-24 13:31:07 +01:00

README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.