Commit Graph

351 Commits

Author SHA1 Message Date
Arjun P 855cd847f7 [MLIR][Presburger] normalizeDivisionByGCD: fix bug when constant term is negative
Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D119531
2022-02-11 17:02:52 +05:30
Benjamin Kramer 78eeda7529 [MLIR][Presburger] Fix linkage of functions in header
Static functions in a header cause spurious unused function warnings.
2022-02-08 17:51:34 +01:00
Arjun P 1096fcff7d [MLIR][Presburger] Support computing volumes via hyperrectangular overapproximation
Add support for computing an overapproximation of the number of integer points
in a polyhedron. The returned result is actually the number of integer points
one gets by computing the "rational shadow" obtained by projecting out the
local IDs, finding the minimal axis-parallel hyperrectangular approximation
of the shadow, and returning the number of integer points in that. This does
not currently support symbols.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D119228
2022-02-08 21:06:49 +05:30
Arjun P 738c738b44 [MLIR][Presburger] Simplex::computeIntegerBounds: support unbounded directions by returning Optionals 2022-02-08 20:57:18 +05:30
Arjun P 6472546fb7 [MLIR][Presburger] factor out duplicated function `parsePoly` into a Utils.h
Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D119194
2022-02-09 00:35:43 +05:30
Arjun P d5a2944219 [MLIR][Presburger] Add support for piece-wise multi-affine functions
Add the class MultiAffineFunction which represents functions whose domain is an
IntegerPolyhedron and which produce an output given by a tuple of affine
expressions in the IntegerPolyhedron's ids.

Also add support for piece-wise MultiAffineFunctions, which are defined on a
union of IntegerPolyhedrons, and may have different output affine expressions
on each IntegerPolyhedron. Thus the function is affine on each individual
IntegerPolyhedron piece in the domain.

This is part of a series of patches leading up to parametric integer programming.

Depends on D118778.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D118779
2022-02-08 00:43:59 +05:30
Prashant Kumar 37bad565bf Revert "[MLIR][Presburger] Use `SmallVector` instead of `std::vector` in `getLocalRepr`"
This reverts commit 3cc5447728.
SmallVector inside SmallVector are not optimized.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D119005
2022-02-04 23:24:08 +05:30
River Riddle 14124c3025 [mlir][NFC] Split MlirQuant into proper IR/Utils/Transforms libraries
This matches the structure of other dialects, and also removes
unnecessary dependencies from the core dialect lib.
2022-02-03 10:54:52 -08:00
Prashant Kumar 3cc5447728 [MLIR][Presburger] Use `SmallVector` instead of `std::vector` in `getLocalRepr`
Use `SmallVector` instead of `std::vector` in `getLocalRepr` function.
 Also, fix the casing of a variable.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D118722
2022-02-02 19:57:15 +05:30
Prashant Kumar 1e7c464d2c [MLIR] Extract division representation from equality expressions.
Extract the division representation from equality constraints.
For example:
    32*k == 16*i + j - 31                 <-- k is the localVariable
    expr = 16*i + j - 31, divisor = 32
    k = (16*i + j - 32) floordiv 32
The dividend of the division is set to [16, 1, -32] and the divisor is set
to 32.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D117959
2022-02-01 16:24:28 +05:30
River Riddle 58e7bf78a3 [mlir] Add isa/dyn_cast support for dialect interfaces
This matches the same API usage as attributes/ops/types. For example:

```c++
Dialect *dialect = ...;

// Instead of this:
if (auto *interface = dialect->getRegisteredInterface<DialectInlinerInterface>())

// You can do this:
if (auto *interface = dyn_cast<DialectInlinerInterface>(dialect))
```

Differential Revision: https://reviews.llvm.org/D117859
2022-01-31 19:24:34 -08:00
Alexandre Ganea dc3b9365b6 [mlir] Silence warnings when building with MSVC
Differential Revision: https://reviews.llvm.org/D118536
2022-01-30 17:31:35 -05:00
Sanjoy Das 8f66ab1c2e Replace OwningModuleRef with OwningOpRef<ModuleOp>
This addresses a TODO in BuiltinOps.h.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D118574
2022-01-30 14:07:10 -08:00
Arjun P 6db019582a [MLIR] Introduce LexSimplex to support lexicographic optimization
This patch introduces a class LexSimplex that can currently be used to find the
lexicographically minimal rational point in an IntegerPolyhedron. This is a
series of patches leading to computing the lexicographically minimal integer
lattice point as well parametric lexicographic minimization.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D117437
2022-01-28 22:06:58 +05:30
River Riddle 6842ec42f6 [mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h
These are used pervasively during parsing.

Differential Revision: https://reviews.llvm.org/D118291
2022-01-26 21:37:23 -08:00
River Riddle d10d49dce4 [mlir][NFC] Add a using for llvm::BitVector to LLVM.h
BitVector is becoming widespread enough that we should add a proper using.

Differential Revision: https://reviews.llvm.org/D118290
2022-01-26 21:37:23 -08:00
Jeremy Furtek 33185e66f2 [mlir] Add ODS support for enum attributes with grouped bit cases
This diff modifies the tablegen specification and code generation for
BitEnumAttr attributes in MLIR Operation Definition Specification (ODS) files.
Specifically:

- there is a new tablegen class for "none" values (i.e. no bits set)
- single-bit enum cases are specified via bit index (i.e. [0, 31]) instead of
  the resulting enum integer value
- there is a new tablegen class to represent a "grouped" bitwise OR of other
  enum values

This diff is intended as an initial step towards improving "fastmath"
optimization support in MLIR, to allow more precise control of whether certain
floating point optimizations are applied in MLIR passes. "Fast" math options
for floating point MLIR operations would (following subsequent RFC and
discussion) be specified by using the improved enum bit support in this diff.
For example, a "fast" enum value would act as an alias for a group of other
cases (e.g. finite-math-only, no-signed-zeros, etc.), in a way that is similar
to support in C/C++ compilers (clang, gcc).

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D117029
2022-01-26 21:01:01 +00:00
River Riddle a70aa7bb0d [mlir:Transforms] Move out the remaining non-dialect independent transforms and utilities
This has been a major TODO for a very long time, and is necessary for establishing a proper
dialect-free dependency layering for the Transforms library. Code was moved to effectively
two main locations:

* Affine/
There was quite a bit of affine dialect related code in Transforms/ do to historical reasons
(of a time way into MLIR's past). The following headers were moved to:
Transforms/LoopFusionUtils.h -> Dialect/Affine/LoopFusionUtils.h
Transforms/LoopUtils.h -> Dialect/Affine/LoopUtils.h
Transforms/Utils.h -> Dialect/Affine/Utils.h

The following transforms were also moved:
AffineLoopFusion, AffinePipelineDataTransfer, LoopCoalescing

* SCF/
Only one SCF pass was in Transforms/ (likely accidentally placed here): ParallelLoopCollapsing
The SCF specific utilities in LoopUtils have been moved to SCF/Utils.h

* Misc:
mlir::moveLoopInvariantCode was also moved to LoopLikeInterface.h given
that it is a simple utility defined in terms of LoopLikeOpInterface.

Differential Revision: https://reviews.llvm.org/D117848
2022-01-24 19:25:53 -08:00
Arjun P 0e98fadc79 [MLIR][Presburger] use braces for single-line loop when inner if uses braces [NFC] 2022-01-25 04:18:20 +05:30
Arjun P c1562683ee [MLIR][Presburger] LinearTransform: rename multiplication functions to be more intuitive 2022-01-25 04:18:19 +05:30
Lorenzo Chelini d6f8f56da0 [MLIR][Presburger] Silence -Wdangling-else warning (NFC)
gcc suggests explicit braces to avoid ambiguous ‘else’.
2022-01-24 09:16:05 +01:00
Prashant Kumar b6098c07cb [MLIR] Fix negative gcd in `normalizeDivisionByGCD` function.
When the coefficients of dividend are negative, the gcd may be negative
which will change the sign of dividend and overflow denominator.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D117911
2022-01-22 13:09:28 +05:30
River Riddle 4157455425 [mlir][Pass] Deprecate FunctionPass in favor of OperationPass<FuncOp>
The only benefit of FunctionPass is that it filters out function
declarations. This isn't enough to justify carrying it around, as we can
simplify filter out declarations when necessary within the pass. We can
also explore with better scheduling primitives to filter out declarations
at the pipeline level in the future.

The definition of FunctionPass is left intact for now to allow time for downstream
users to migrate.

Differential Revision: https://reviews.llvm.org/D117182
2022-01-18 19:52:44 -08:00
River Riddle 755dc07d69 [mlir:Analysis] Move the LoopAnalysis library to Dialect/Affine/Analysis
The current state of the top level Analysis/ directory is that it contains two libraries;
a generic Analysis library (free from dialect dependencies), and a LoopAnalysis library
that contains various analysis utilities that originated from Affine loop transformations.
This commit moves the LoopAnalysis to the more appropriate home of `Dialect/Affine/Analysis/`,
given the use and intention of the majority of the code within it. After the move, if there
are generic utilities that would fit better in the top-level Analysis/ directory, we can move
them.

Differential Revision: https://reviews.llvm.org/D117351
2022-01-18 10:28:22 -08:00
Eugene Zhulenev 69bc334be5 [mlir] Remove getNumberOfExecutions from RegionBranchOpInterface
`getNumRegionInvocations` was originally added for the async reference counting, but turned out to be not useful, and currently is not used anywhere (couldn't find any uses in public github repos). Removing dead code.

Reviewed By: Mogball, mehdi_amini

Differential Revision: https://reviews.llvm.org/D117347
2022-01-14 13:15:27 -08:00
Mehdi Amini 5a68a85d85 Mark some MLIR tests as requiring the native target to be configured
This makes `ninja check-mlir` work without the host targets configured.
2022-01-14 07:23:14 +00:00
River Riddle 0998637e6f [mlir] Add a parsePassPipeline overload that returns a new pass manager
This overload parses a pipeline string that contains the anchor operation type, and returns an OpPassManager
corresponding to the provided pipeline. This is useful for various situations, such as dynamic pass pipelines
which are not anchored within a parent pass pipeline.

fixes #52813

Differential Revision: https://reviews.llvm.org/D116525
2022-01-12 14:54:30 -08:00
River Riddle 676bfb2a22 [mlir] Refactor ShapedType into an interface
ShapedType was created in a time before interfaces, and is one of the earliest
type base classes in the ecosystem. This commit refactors ShapedType into
an interface, which is what it would have been if interfaces had existed at that
time. The API of ShapedType and it's derived classes are essentially untouched
by this refactor, with the exception being the API surrounding kDynamicIndex
(which requires a sole home).

For now, the API of ShapedType and its name have been kept as consistent to
the current state of the world as possible (to help with potential migration churn,
among other reasons). Moving forward though, we should look into potentially
restructuring its API and possible its name as well (it should really have "Interface"
at the end like other interfaces at the very least).

One other potentially interesting note is that I've attached the ShapedType::Trait
to TensorType/BaseMemRefType to act as mixins for the ShapedType API. This
is kind of weird, but allows for sharing the same API (i.e. preventing API loss from
the transition from base class -> Interface). This inheritance doesn't affect any
of the derived classes, it is just for API mixin.

Differential Revision: https://reviews.llvm.org/D116962
2022-01-12 14:12:09 -08:00
Groverkss 0e19186c82 [MLIR][NFC] Move PresburgerSet to Presburger/ directory
This patch moves PresburgerSet to Presburger/ directory. This patch is purely
mechincal, it only moves and renames functionality and tests.

This patch is part of a series of patches to move presburger functionality to
Presburger/ directory.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D116836
2022-01-08 15:39:40 +05:30
Groverkss 49b754b5c6 [MLIR][NFC] Move presburger functionality from FlatAffineConstraints to IntegerPolyhedron
This patch moves all presburger functionality from FlatAffineConstraints to
IntegerPolyhedron. This patch is purely mechanical, it only moves and renames
functionality and tests.

This patch is part of a series of patches to move presburger functionality to
Presburger/ directory.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D116681
2022-01-08 01:22:49 +05:30
Prashant Kumar df29318e66 [MLIR] Add division normalization by GCD in `getDivRepr` fn.
This commits adds division normalization in  the `getDivRepr` function which extracts
 the gcd from the dividend and divisor and normalizes them.

Signed-off-by: Prashant Kumar <pk5561@gmail.com>

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D115595
2022-01-06 16:18:50 +05:30
Groverkss 8506c8c13b [MLIR] Move LinearTransform to Presburger/
This patch moves LinearTransform to Presburger/ and makes it use
IntegerPolyhedron instead of FlatAffineConstraints. Also modifies its usage in
`FlatAffineConstraints::findIntegerSample` to support the changes.

This patch is part of a series of patches for moving presburger math functionality into Presburger directory.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D116311
2022-01-03 11:11:09 +05:30
Mehdi Amini 4f415216ca Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC) 2022-01-02 22:37:13 +00:00
Mehdi Amini 337c937ddb Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC) 2022-01-02 22:36:56 +00:00
Mehdi Amini 1fc096af1e Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)
Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D116250
2022-01-02 01:45:18 +00:00
Mehdi Amini 0ae2e9580c Apply clang-tidy fixes for modernize-use-override to MLIR (NFC)
Reviewed By: rriddle, jpienaar

Differential Revision: https://reviews.llvm.org/D116356
2022-01-02 01:24:02 +00:00
Groverkss 5f22f248d8 [MLIR] Use IntegerPolyhedron in Simplex instead of FlatAffineConstraints
This patch replaces usage of FlatAffineConstraints in Simplex with
IntegerPolyhedron. This removes dependency of Simplex on FlatAffineConstraints
and puts it on IntegerPolyhedron, which is part of Presburger library.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D116287
2021-12-27 19:06:35 +05:30
Arjun P 4fe5cfe53e [MLIR] Add forgotten directory Support to unittests cmake
The Support directory was removed from the unittests cmake when the directory
was removed in 204c3b5516. Subsequent commits
added the directory back but seem to have missed adding it back to the cmake.

This patch also removes MLIRSupportIndentedStream from the list of linked
libraries to avoid an ODR violation (it's already part of MLIRSupport which
is also being linked here). Otherwise ASAN complains:

```
=================================================================
==102592==ERROR: AddressSanitizer: odr-violation (0x7fbdf214eee0):
  [1] size=120 'vtable for mlir::raw_indented_ostream' /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
  [2] size=120 'vtable for mlir::raw_indented_ostream' /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
These globals were registered at these points:
  [1]:
    #0 0x28a71d in __asan_register_globals (/home/arjun/llvm-project/build/tools/mlir/unittests/Support/MLIRSupportTests+0x28a71d)
    #1 0x7fbdf214a61b in asan.module_ctor (/home/arjun/llvm-project/build/lib/libMLIRSupportIndentedOstream.so.14git+0x661b)

  [2]:
    #0 0x28a71d in __asan_register_globals (/home/arjun/llvm-project/build/tools/mlir/unittests/Support/MLIRSupportTests+0x28a71d)
    #1 0x7fbdf2061c4b in asan.module_ctor (/home/arjun/llvm-project/build/lib/libMLIRSupport.so.14git+0x11bc4b)

==102592==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY AddressSanitizer: odr-violation: global 'vtable for mlir::raw_indented_ostream' at /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
==102592==ABORTING
```

This patch also fixes a build issue with `DebugAction::classof` under Windows.

This commit re-lands this patch, which was previously reverted in
2132906836 due to a buildbot failure that
turned out to be because of a flaky test.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D116027
2021-12-27 14:42:48 +05:30
Arjun P 2132906836 Revert "[MLIR] Add forgotten directory Support to unittests cmake"
This reverts commit 0c553cc1af.

This caused a buildbot failure (https://lab.llvm.org/buildbot#builders/197/builds/888).

```
******************** TEST 'ScudoStandalone-Unit :: ./ScudoUnitTest-aarch64-Test/ScudoCommonTest.ResidentMemorySize' FAILED ********************
Script:
--
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/projects/compiler-rt/lib/scudo/standalone/tests/./ScudoUnitTest-aarch64-Test --gtest_filter=ScudoCommonTest.ResidentMemorySize
--
Note: Google Test filter = ScudoCommonTest.ResidentMemorySize
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ScudoCommonTest
[ RUN      ] ScudoCommonTest.ResidentMemorySize
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/compiler-rt/lib/scudo/standalone/tests/common_test.cpp:49: Failure
Expected: (getResidentMemorySize()) > (OnStart + Size - Threshold), actual: 707358720 vs 943153152
[  FAILED  ] ScudoCommonTest.ResidentMemorySize (21709 ms)
[----------] 1 test from ScudoCommonTest (21709 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (21709 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ScudoCommonTest.ResidentMemorySize
 1 FAILED TEST
********************
```
2021-12-26 13:59:23 +05:30
Arjun P 0c553cc1af [MLIR] Add forgotten directory Support to unittests cmake
The Support directory was removed from the unittests cmake when the directory
was removed in 204c3b5516. Subsequent commits
added the directory back but seem to have missed adding it back to the cmake.

This patch also removes MLIRSupportIndentedStream from the list of linked
libraries to avoid an ODR violation (it's already part of MLIRSupport which
is also being linked here). Otherwise ASAN complains:

```
=================================================================
==102592==ERROR: AddressSanitizer: odr-violation (0x7fbdf214eee0):
  [1] size=120 'vtable for mlir::raw_indented_ostream' /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
  [2] size=120 'vtable for mlir::raw_indented_ostream' /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
These globals were registered at these points:
  [1]:
    #0 0x28a71d in __asan_register_globals (/home/arjun/llvm-project/build/tools/mlir/unittests/Support/MLIRSupportTests+0x28a71d)
    #1 0x7fbdf214a61b in asan.module_ctor (/home/arjun/llvm-project/build/lib/libMLIRSupportIndentedOstream.so.14git+0x661b)

  [2]:
    #0 0x28a71d in __asan_register_globals (/home/arjun/llvm-project/build/tools/mlir/unittests/Support/MLIRSupportTests+0x28a71d)
    #1 0x7fbdf2061c4b in asan.module_ctor (/home/arjun/llvm-project/build/lib/libMLIRSupport.so.14git+0x11bc4b)

==102592==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY AddressSanitizer: odr-violation: global 'vtable for mlir::raw_indented_ostream' at /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
==102592==ABORTING
```

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D116027
2021-12-26 02:22:00 +05:30
Mogball 32e8b30d6e [mlir] Add unit test for disabling canonicalizer patterns (NFC) 2021-12-22 21:07:06 +00:00
Mehdi Amini e5639b3fa4 Fix more clang-tidy cleanups in mlir/ (NFC) 2021-12-22 20:53:11 +00:00
Mogball 7347c28def [mlir] Add missing unit tests to BUILD.bazel
Several unit test folders were missing from the bazel build, including: Transforms, Conversion, Rewrite
2021-12-22 20:00:27 +00:00
Stephan Herhut 8761f5ebf7 [mlir][Support] Avoid multiplication in floorDiv / ceilDiv
Using comparisons instead avoids potential overflow.

Differential Revision: https://reviews.llvm.org/D116096
2021-12-21 11:50:40 +01:00
Mehdi Amini 02b6fb218e Fix clang-tidy issues in mlir/ (NFC)
Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D115956
2021-12-20 20:25:01 +00:00
Christian Ulmann 85cb53c790 [MLIR] rewrite AffineStructures and Presburger tests to use the parser
This commit rewrites most existing unittests involving FlatAffineConstraints
to use the parsing utility. This helps to make the tests more understandable.

This relands commit b0e8667b1d, which was
reverted in 6963be1276, with a fix to a unittest
which was incorrectly rewritten before.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D115920
2021-12-20 20:11:12 +05:30
Mehdi Amini 6963be1276 Revert "[MLIR] rewrite AffineStructures and Presburger tests to use the parser"
This reverts commit b0e8667b1d.

ASAN/UBSAN bot is broken with this trace:

[ RUN      ] FlatAffineConstraintsTest.FindSampleTest
llvm-project/mlir/include/mlir/Support/MathExtras.h:27:15: runtime error: signed integer overflow: 1229996100002 * 809999700000 cannot be represented in type 'long'
    #0 0x7f63ace960e4 in mlir::ceilDiv(long, long) llvm-project/mlir/include/mlir/Support/MathExtras.h:27:15
    #1 0x7f63ace8587e in ceil llvm-project/mlir/include/mlir/Analysis/Presburger/Fraction.h:57:42
    #2 0x7f63ace8587e in operator* llvm-project/llvm/include/llvm/ADT/STLExtras.h:347:42
    #3 0x7f63ace8587e in uninitialized_copy<llvm::mapped_iterator<mlir::Fraction *, long (*)(mlir::Fraction), long>, long *> include/c++/v1/__memory/uninitialized_algorithms.h:36:62
    #4 0x7f63ace8587e in uninitialized_copy<llvm::mapped_iterator<mlir::Fraction *, long (*)(mlir::Fraction), long>, long *> llvm-project/llvm/include/llvm/ADT/SmallVector.h:490:5
    #5 0x7f63ace8587e in append<llvm::mapped_iterator<mlir::Fraction *, long (*)(mlir::Fraction), long>, void> llvm-project/llvm/include/llvm/ADT/SmallVector.h:662:5
    #6 0x7f63ace8587e in SmallVector<llvm::mapped_iterator<mlir::Fraction *, long (*)(mlir::Fraction), long> > llvm-project/llvm/include/llvm/ADT/SmallVector.h:1204:11
    #7 0x7f63ace8587e in mlir::FlatAffineConstraints::findIntegerSample() const llvm-project/mlir/lib/Analysis/AffineStructures.cpp:1171:27
    #8 0x7f63ae95a84d in mlir::checkSample(bool, mlir::FlatAffineConstraints const&, mlir::TestFunction) llvm-project/mlir/unittests/Analysis/AffineStructuresTest.cpp:37:23
    #9 0x7f63ae957545 in mlir::FlatAffineConstraintsTest_FindSampleTest_Test::TestBody() llvm-project/mlir/unittests/Analysis/AffineStructuresTest.cpp:222:3
2021-12-20 07:20:31 +00:00
Christian Ulmann b0e8667b1d [MLIR] rewrite AffineStructures and Presburger tests to use the parser
This commit rewrites most existing unittests involving FlatAffineConstraints to use the parsing utility. This helps to make the tests more understandable.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D115920
2021-12-19 19:26:47 +05:30
Mogball c7103810bd [mlir][scf] Add getNumRegionInvocations to IfOp
Implements the RegionBranchOpInterface method getNumRegionInvocations to `scf::IfOp` so that, when the condition is constant, the number of region executions can be analyzed by `NumberOfExecutions`.

Reviewed By: jpienaar, ftynse

Differential Revision: https://reviews.llvm.org/D115087
2021-12-15 14:56:20 +00:00
Mogball 843534db3c [mlir][ods] Fix OpDefinitionsGen infer return types builder with regions
Despite handling regions and inferred return types, the builder was never generated for ops with both InferReturnTypeOpInterface and regions.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D115525
2021-12-13 15:11:35 +00:00