aboutsummaryrefslogtreecommitdiff
path: root/utils
AgeCommit message (Collapse)AuthorFilesLines
2021-12-22[mlir] Add unit test for disabling canonicalizer patterns (NFC)Mogball1-0/+4
2021-12-22[mlir] Add missing unit tests to BUILD.bazelMogball1-0/+43
Several unit test folders were missing from the bazel build, including: Transforms, Conversion, Rewrite
2021-12-22[mlir] Update BUILD.bazel to include `scf_tests`Mogball1-0/+15
2021-12-20[mlir] Add `mlir/unittests/BUILD.bazel`Mogball1-0/+270
Unit tests are not getting built as part of bazel runs. Reviewed By: mehdi_amini, GMNGeoffrey Differential Revision: https://reviews.llvm.org/D116046
2021-12-20[Support] Revert posix_fallocate in resize_fileFangrui Song3-7/+0
This reverts 3816c53f040cc6aa06425978dd504b0bd5b7899c and removes follow-up fixups. The original intention was to show error earlier (posix_fallocate time) than later for ld.lld but it appears to cause some problems which make it not free. * FreeBSD ZFS: EINVAL, not too bad. * FreeBSD UFS: according to khng "devastatingly slow on freebsd because UFS on freebsd does not have preallocation support like illumos. It zero-fills." * NetBSD: maybe EOPNOTSUPP * Linux tmpfs: unless tmpfs is set up to use huge pages (requires CONFIG_TRANSPARENT_HUGE_PAGECACHE=y), I can consistently demonstrate ~300ms delay for a 1.4GiB output. * Linux ext4: I don't measure any benefit, either backed by a hard disk or by a file in tmpfs. * The current code organization of `defined(HAVE_POSIX_FALLOCATE)` costs us a macro dispatch for AIX. I think we should just remove it. I think if posix_fallocate ever finds demonstrable benefit, it is likely Linux specific and will not need HAVE_POSIX_FALLOCATE, and possibly opt-in by some specific programs. In a filesystem with CoW and compression, the ENOSPC benefit may be lost as well. Reviewed By: khng300 Differential Revision: https://reviews.llvm.org/D115957
2021-12-19Make AsyncParallelForRewrite parameterizable with a cost model which drives ↵bakhtiyar1-1/+4
deciding the parallelization granularity. Reviewed By: ezhulenev, mehdi_amini Differential Revision: https://reviews.llvm.org/D115423
2021-12-19[Bazel] update build files forKrasimir Georgiev1-1/+1
https://github.com/llvm/llvm-project/commit/65d7fd0239bf301c5dcaa26ed474200845966136
2021-12-17[mlir][ods] Added EnumAttr, an AttrDef implementation of enum attributesMogball1-0/+1
`EnumAttr` is a pure TableGen implementation of enum attributes using `AttrDef`. This is meant as a drop-in replacement for `StrEnumAttr`, which is soon to be deprecated. `StrEnumAttr` is often used over `IntEnumAttr` because its more readable in MLIR assembly formats. However, storing and manipulating strings is not efficient. Defining `StrEnumAttr` can also be awkward and relies on a lot of special logic in `EnumsGen`, and has some hidden sharp edges. Also, `EnumAttr` stores the enum directly, removing the need to convert to/from integers when calling attribute getters on ops. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D115181
2021-12-16[Bazel] Add LLVM_BUILD_* variables to llvm-config.h to mirror ↵Dmitri Gribenko2-0/+12
ec37e0bbafab75fa64f1ddb4cdeceb5400491ef8
2021-12-16[mlir] Fix Bazel build after 32fe1a8a2594Diego Caballero1-0/+1
Adding missing dependences.
2021-12-16[mlir][GPU] Extend GPU kernel outlining to generate DL specificationDiego Caballero1-0/+1
This patch extends the GPU kernel outlining pass so that it can take in an optional data layout specification that will be attached to the GPU module operation generated. If the data layout specification is not provided the default data layout is used instead. Reviewed By: herhut, mehdi_amini Differential Revision: https://reviews.llvm.org/D115722
2021-12-16[mlir][PDLL] Add an initial frontend for PDLLRiver Riddle1-0/+48
This is a new pattern rewrite frontend designed from the ground up to support MLIR constructs, and to target PDL. This frontend language was proposed in https://llvm.discourse.group/t/rfc-pdll-a-new-declarative-rewrite-frontend-for-mlir/4798 This commit starts sketching out the base structure of the frontend, and is intended to be a minimal starting point for building up the language. It essentially contains support for defining a pattern, variables, and erasing an operation. The features mentioned in the proposal RFC (including IDE support) will be added incrementally in followup commits. I intend to upstream the documentation for the language in a followup when a bit more of the pieces have been landed. Differential Revision: https://reviews.llvm.org/D115093
2021-12-15Update bazel build rules to match 169ebf03ab2a6f16bfa32a36305929c7bc8e4784.Richard Smith1-1/+4
2021-12-15[libc][NFC][bazel] remove unneeded bzl_libraryGuillaume Chatelet1-14/+0
2021-12-15Embed licence into packageGuillaume Chatelet1-1/+4
2021-12-15[mlir][linalg] Replace LinalgOps.h and LinalgTypes.h by a single header.gysit1-3/+2
After removing the range type, Linalg does not define any type. The revision thus consolidates the LinalgOps.h and LinalgTypes.h into a single Linalg.h header. Additionally, LinalgTypes.cpp is renamed to LinalgDialect.cpp to follow the convention adopted by other dialects such as the tensor dialect. Depends On D115727 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D115728
2021-12-15[bazel] drop some unnecessary dependencies in mlirAlex Zinenko1-2/+0
2021-12-15[bazel] Adjust Bazel BUILD files for a4830d14edbb2a21eb35f3d79d1f64bd09db8b1cDmitri Gribenko1-1/+0
2021-12-15[mlir][linalg][bufferize] Reimplementation of TiledLoopOp bufferizationMatthias Springer1-0/+1
Instead of modifying the existing linalg.tiled_loop op, create a new op with memref input/outputs and delete the old op. Differential Revision: https://reviews.llvm.org/D115493
2021-12-15[mlir][linalg][bufferize] Reimplementation of scf.for bufferizationMatthias Springer1-0/+1
Instead of modifying the existing scf.for op, create a new op with memref OpOperands/OpResults and delete the old op. New allocations / other memrefs can now be yielded from the loop. This functionality is deactivated by default and guarded against by AssertDestinationPassingStyle. This change also introduces `replaceOp`, which will be utilized by all other `bufferize` implementations in future commits. Bufferization will then no longer rely on old (pre-bufferize) ops to DCE away. Instead old ops are deleted on the spot. This improves debuggability because there won't be any duplicate ops anymore (bufferized + not-yet-bufferized) when dumping IR during bufferization. It is also less fragile because unbufferized IR can no longer silently "hang around" due to an implementation bug. Differential Revision: https://reviews.llvm.org/D114926
2021-12-14[Driver] Add CLANG_DEFAULT_PIE_ON_LINUX to emulate GCC --enable-default-pieFangrui Song1-0/+3
In 2015-05, GCC added the configure option `--enable-default-pie`. When enabled, * in the absence of -fno-pic/-fpie/-fpic (and their upper-case variants), -fPIE is the default. * in the absence of -no-pie/-pie/-shared/-static/-static-pie, -pie is the default. This has been adopted by all(?) major distros. I think default PIE is the majority in the Linux world, but --disable-default-pie users is not that uncommon because GCC upstream hasn't switched the default yet (https://gcc.gnu.org/PR103398). This patch add CLANG_DEFAULT_PIE_ON_LINUX which allows distros to use default PIE. The option is justified as its adoption can be very high among Linux distros to make Clang default match GCC, and is likely a future-new-default, at which point we will remove CLANG_DEFAULT_PIE_ON_LINUX. The lit feature `default-pie-on-linux` can be handy to exclude default PIE sensitive tests. Reviewed By: foutrelis, sylvestre.ledru, thesamesam Differential Revision: https://reviews.llvm.org/D113372
2021-12-14[bazel] Port debuginfod rulesBenjamin Kramer2-0/+27
Needed after 34491ca7291c
2021-12-13[libc] Bazel overlay for libcGuillaume Chatelet3-0/+992
This patch provides a draft overlay to support compilation of llvm libc with Bazel. Tested on linux x86-64 with ``` cd git/llvm-project/utils/bazel bazelisk-linux-amd64 build --sandbox_base=/dev/shm --config=generic_clang @llvm-project//libc:all ``` Differential Revision: https://reviews.llvm.org/D114712
2021-12-10[mlir] Update BUILD rule for AffineUtilsChia-hung Duan1-2/+1
bc657b2eef82f604e5bfb8da421cbdfc80156739 adds the dependency to MemRefDialect. Reviewed By: GMNGeoffrey, mehdi_amini Differential Revision: https://reviews.llvm.org/D115558
2021-12-10[mlir] Move `linalg.tensor_expand/collapse_shape` to TensorDialect.Alexander Belyaev1-6/+21
RFC: https://llvm.discourse.group/t/rfc-reshape-ops-restructuring/3310 linalg.fill gets a canonicalizer, because `FoldFillWithTensorReshape` cannot be moved to tensorops (it uses linalg::FillOp inside). Before it was listed as a canonicalization pattern for the reshape operations, now it became a canonicalization for FillOp. Differential Revision: https://reviews.llvm.org/D115502
2021-12-10[mlir] Add filegroup for Conversion/PassDetailChia-hung Duan1-42/+50
Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D115487
2021-12-09[bazel] Exclude MLModelRunnerTest.cppMircea Trofin1-0/+1
Until we figure MLGO + bazel, exclude this unittest (same as TFUtilsTest.cpp) Differential Revision: https://reviews.llvm.org/D115472
2021-12-07[mlir][linalg][bufferize] Add FuncOp bufferization passMatthias Springer1-0/+12
This passes bufferizes FuncOp bodies, but not FuncOp boundaries. Differential Revision: https://reviews.llvm.org/D114671
2021-12-06Bazel: add new llvm-c/Deprecated.h headerDavid Blaikie1-0/+1
2021-12-03[mlir][linalg][bufferize] Op interface implementation for Bufferization ↵Matthias Springer1-0/+2
dialect ops This change provides `BufferizableOpInterface` implementations for ops from the Bufferization dialects. These ops are needed at the bufferization boundaries for partial bufferization. Differential Revision: https://reviews.llvm.org/D114618
2021-12-02[Bazel] Set the right default for LLVM_WINDOWS_PREFER_FORWARD_SLASH on WindowsGeoffrey Martin-Noble2-2/+4
This cmake configure option was added in df0ba47c36f6bd0865e3286853b76d37e037c2d7, and was ported to Bazel in 7d323dc7738e3152c4bd54a23ac27554bfbbf583. However, the setting chosen in Bazel seems accidental, not necessarily intentional. LLVM_WINDOWS_PREFER_FORWARD_SLASH has no effect on Unix, and on Windows, setting it to 0 is the default, which gets the same behaviour as before. Setting it to 1 enables new experimental behaviours (which is enabled by default on MinGW targets only). As I don't see any explicit intent to opt in to the new experimental behaviour, I believe the current configuration in bazel was a mistake. Differential Revision: https://reviews.llvm.org/D114065
2021-12-02[bazel] Update static analyzer unit test deps for clangTestingReid Kleckner1-0/+1
2021-12-02[Bazel] Add LLVM_ENABLE_CURL to Bazel llvm-config.h.cmake for e0b259f2Reid Kleckner2-0/+6
2021-12-02[Bazel] Remove old macho lld portKeith Smiley1-7/+1
This code and cmake was removed in https://reviews.llvm.org/D114842 Differential Revision: https://reviews.llvm.org/D114976
2021-12-02[Bazel] Remove old MachO LLD from the Bazel buildReid Kleckner1-93/+0
Updates Bazel files for 9e3552523ebd3385487e01e3e7af37b8c0efaf57
2021-12-02[bazel][mlgo] Remove the mlgo-related build excludesMircea Trofin1-11/+0
They aren't needed anymore, we handle conditional compilation in those files. Reviewed By: GMNGeoffrey Differential Revision: https://reviews.llvm.org/D114970
2021-11-30[mlir] Add bazel build for BufferizationToMemRef.Alexander Belyaev1-0/+24
2021-11-30[mlir] Fix BufferizationToMemRef build.Alexander Belyaev1-3/+2
2021-11-30[mlir] Move bufferization-related passes to `bufferization` dialect.Alexander Belyaev1-0/+48
[RFC](https://llvm.discourse.group/t/rfc-dialect-for-bufferization-related-ops/4712) Differential Revision: https://reviews.llvm.org/D114698
2021-11-26[mlir][linalg][bufferize][NFC] Extract func boundary bufferizationMatthias Springer1-0/+2
Bufferization of function boundaries is extracted from ComprehensiveBufferize into a separate file. This will become its own build target in the future. Differential Revision: https://reviews.llvm.org/D114226
2021-11-26[mlir][linalg][bufferize][NFC] Move Affine interface impl to new build targetMatthias Springer1-1/+17
This makes ComprehensiveBufferize entirely independent of the Affine dialect. Differential Revision: https://reviews.llvm.org/D114222
2021-11-25[mlir] Move memref.[tensor_load|buffer_cast|clone] to "bufferization" dialect.Alexander Belyaev1-1/+98
https://llvm.discourse.group/t/rfc-dialect-for-bufferization-related-ops/4712 Differential Revision: https://reviews.llvm.org/D114552
2021-11-25[mlir][linalg][bufferize][NFC] Move SCF interface impl to new build targetMatthias Springer1-1/+19
This makes ComprehensiveBufferize entirely independent of the SCF dialect. Differential Revision: https://reviews.llvm.org/D114221
2021-11-25[mlir][linalg][bufferize][NFC] Move arith interface impl to new build targetMatthias Springer1-2/+21
This makes ComprehensiveBufferize entirely independent of the arith dialect. Differential Revision: https://reviews.llvm.org/D114219
2021-11-24[mlir][linalg][bufferize][NFC] Move vector interface impl to new build targetMatthias Springer1-1/+19
This makes ComprehensiveBufferize entirely independent of the vector dialect. Differential Revision: https://reviews.llvm.org/D114218
2021-11-24[mlir][linalg][bufferize][NFC] Move tensor interface impl to new build targetMatthias Springer1-1/+20
This makes ComprehensiveBufferize entirely independent of the tensor dialect. Differential Revision: https://reviews.llvm.org/D114217
2021-11-23Move dependency llvm:AllTargetsAsmParsers from Translation to ExecutionEngine.Rahul Joshi1-1/+1
- Fixes a minor issue in https://reviews.llvm.org/D114338, which seems incorrectly added the llvm:AllTargetsAsmParsers dependency to Translation in bazel build files. Differential Revision: https://reviews.llvm.org/D114471
2021-11-23Revert "Revert "[mlir] Move AllocationOpInterface to ↵Alexander Belyaev1-0/+38
Bufferize/IR/AllocationOpInterface.td."" This reverts and fixes commit de18b7dee6a81e5e790c8e8060065b1ef72d13ed.
2021-11-23[mlir][Vector] Add a vblendps-based impl for transpose8x8 (both intrin and ↵Nicolas Vasilache1-0/+2
inline_asm) This revision follows up on the conversation titled: ```[llvm-dev] Understanding and controlling some of the AVX shuffle emission paths``` The revision adds a vblendps-based implementation for transpose8x8 and further distinguishes between and intrinsics and an inline_asm implementation. This results in roughly 20% fewer cycles as reported by llvm-mca: After this revision (intrinsic version, resolves to virtually identical assembly as per the llvm-dev discussion, no vblendps instruction is emitted): ``` Iterations: 100 Instructions: 5900 Total Cycles: 2415 Total uOps: 7300 Dispatch Width: 6 uOps Per Cycle: 3.02 IPC: 2.44 Block RThroughput: 24.0 Cycles with backend pressure increase [ 89.90% ] Throughput Bottlenecks: Resource Pressure [ 89.65% ] - SKXPort1 [ 0.04% ] - SKXPort2 [ 12.42% ] - SKXPort3 [ 12.42% ] - SKXPort5 [ 89.52% ] Data Dependencies: [ 37.06% ] - Register Dependencies [ 37.06% ] - Memory Dependencies [ 0.00% ] ``` After this revision (inline_asm version, vblendps instructions are indeed emitted): ``` Iterations: 100 Instructions: 6300 Total Cycles: 2015 Total uOps: 7700 Dispatch Width: 6 uOps Per Cycle: 3.82 IPC: 3.13 Block RThroughput: 20.0 Cycles with backend pressure increase [ 83.47% ] Throughput Bottlenecks: Resource Pressure [ 83.18% ] - SKXPort0 [ 14.49% ] - SKXPort1 [ 14.54% ] - SKXPort2 [ 19.70% ] - SKXPort3 [ 19.70% ] - SKXPort5 [ 83.03% ] - SKXPort6 [ 14.49% ] Data Dependencies: [ 39.75% ] - Register Dependencies [ 39.75% ] - Memory Dependencies [ 0.00% ] ``` An accessible copy of the conversation is available [here](https://gist.github.com/nicolasvasilache/68c7f34012584b0e00f335bcb374ede0). Differential Revision: https://reviews.llvm.org/D114393
2021-11-23[mlir][linalg][bufferize][NFC] Move helper function to op interfaceMatthias Springer1-0/+1
This is in preparation of changing the op traversal during bufferization. Differential Revision: https://reviews.llvm.org/D114040