<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/IR/IntegerSet.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[MLIR] Use a shared uniquer for affine maps and integer sets.</title>
<updated>2021-12-02T22:49:32+00:00</updated>
<author>
<name>Ulysse Beaugnon</name>
<email>ulysse@google.com</email>
</author>
<published>2021-12-02T22:49:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e45705ad5051247e1cb2355094ef77316ae24c37'/>
<id>e45705ad5051247e1cb2355094ef77316ae24c37</id>
<content type='text'>
Affine maps and integer sets previously relied on a single lock for creating unique instances. In a multi-threaded setting, this lock becomes a contention point. This commit updates AffineMap and IntegerSet to use StorageUniquer instead. StorageUniquer internally uses sharded locks and thread-local caches to reduce contention. It is already used for affine expressions, types and attributes. On my local machine, this gives me a 5X speedup for an application that manipulates a lot of affine maps and integer sets.

This commit also removes the integer set uniquer threshold. The threshold was used to avoid adding integer sets with a lot of constraints to the hash_map containing unique instances, but the constraints and the integer set were still allocated in the same allocator and never freed, thus not saving any space expect for the hash-map entry.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D114942
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Affine maps and integer sets previously relied on a single lock for creating unique instances. In a multi-threaded setting, this lock becomes a contention point. This commit updates AffineMap and IntegerSet to use StorageUniquer instead. StorageUniquer internally uses sharded locks and thread-local caches to reduce contention. It is already used for affine expressions, types and attributes. On my local machine, this gives me a 5X speedup for an application that manipulates a lot of affine maps and integer sets.

This commit also removes the integer set uniquer threshold. The threshold was used to avoid adding integer sets with a lot of constraints to the hash_map containing unique instances, but the constraints and the integer set were still allocated in the same allocator and never freed, thus not saving any space expect for the hash-map entry.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D114942
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][NFC] drop some unnecessary includes</title>
<updated>2020-03-27T03:47:27+00:00</updated>
<author>
<name>Uday Bondhugula</name>
<email>uday@polymagelabs.com</email>
</author>
<published>2020-03-26T16:18:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ad4b4acbb065c7f40faaff3d3865ebef9d70d16e'/>
<id>ad4b4acbb065c7f40faaff3d3865ebef9d70d16e</id>
<content type='text'>
 Drop unnecessary includes

Differential Revision: https://reviews.llvm.org/D76898
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 Drop unnecessary includes

Differential Revision: https://reviews.llvm.org/D76898
</pre>
</div>
</content>
</entry>
<entry>
<title>Mass update the MLIR license header to mention "Part of the LLVM project"</title>
<updated>2020-01-26T03:58:30+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>aminim@google.com</email>
</author>
<published>2020-01-26T03:58:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=308571074c13ea2a0758aa085aa02f72150f891e'/>
<id>308571074c13ea2a0758aa085aa02f72150f891e</id>
<content type='text'>
This is an artifact from merging MLIR into LLVM, the file headers are
now aligned with the rest of the project.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an artifact from merging MLIR into LLVM, the file headers are
now aligned with the rest of the project.
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust License.txt file to use the LLVM license</title>
<updated>2019-12-23T23:33:37+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>aminim@google.com</email>
</author>
<published>2019-12-23T17:35:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=56222a0694e4caf35e892d70591417c39fef1185'/>
<id>56222a0694e4caf35e892d70591417c39fef1185</id>
<content type='text'>
PiperOrigin-RevId: 286906740
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PiperOrigin-RevId: 286906740
</pre>
</div>
</content>
</entry>
<entry>
<title>NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared in `mlir` namespace.</title>
<updated>2019-12-18T17:29:20+00:00</updated>
<author>
<name>River Riddle</name>
<email>riverriddle@google.com</email>
</author>
<published>2019-12-18T17:28:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4562e389a43caa2e30ebf277c12743edafe6a0ac'/>
<id>4562e389a43caa2e30ebf277c12743edafe6a0ac</id>
<content type='text'>
Aside from being cleaner, this also makes the codebase more consistent.

PiperOrigin-RevId: 286206974
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Aside from being cleaner, this also makes the codebase more consistent.

PiperOrigin-RevId: 286206974
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typos, NFC.</title>
<updated>2019-10-04T11:37:53+00:00</updated>
<author>
<name>Christian Sigg</name>
<email>csigg@google.com</email>
</author>
<published>2019-10-04T11:37:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=85dcaf19c721c4c745cd4fa3972aa9093acd69d3'/>
<id>85dcaf19c721c4c745cd4fa3972aa9093acd69d3</id>
<content type='text'>
PiperOrigin-RevId: 272851237
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PiperOrigin-RevId: 272851237
</pre>
</div>
</content>
</entry>
<entry>
<title>Integer set + operands / affine if op canonicalization</title>
<updated>2019-09-06T06:12:35+00:00</updated>
<author>
<name>Uday Bondhugula</name>
<email>udayb@iisc.ac.in</email>
</author>
<published>2019-09-06T06:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=854a384f509fb198fc82c0440b82a7f8c21d73fb'/>
<id>854a384f509fb198fc82c0440b82a7f8c21d73fb</id>
<content type='text'>
- turn canonicalizeMapAndOperands into a template that works on both
  sets and maps, and use it to introduce a utility to canonicalize an
  affine integer set and its operands
- add pattern to canonicalize affine if op's.
- rename IntegerSet::getNumOperands -&gt; IntegerSet::getNumInputs to be
  consistent with AffineMap
- add missing accessors for IntegerSet

Doesn't need extensive testing since canonicalizeSetAndOperands just
reuses canonicalizeMapAndOperands' logic, and the latter is tested on
affine.apply map + operands; the new method works the same way on an
integer set + operands of an affine if op for example.

Signed-off-by: Uday Bondhugula &lt;uday@polymagelabs.com&gt;

Closes tensorflow/mlir#112

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/112 from bondhugula:set-canonicalize eff72f23250b96fa7d9f5caff3877440f5de2cec
PiperOrigin-RevId: 267532876
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- turn canonicalizeMapAndOperands into a template that works on both
  sets and maps, and use it to introduce a utility to canonicalize an
  affine integer set and its operands
- add pattern to canonicalize affine if op's.
- rename IntegerSet::getNumOperands -&gt; IntegerSet::getNumInputs to be
  consistent with AffineMap
- add missing accessors for IntegerSet

Doesn't need extensive testing since canonicalizeSetAndOperands just
reuses canonicalizeMapAndOperands' logic, and the latter is tested on
affine.apply map + operands; the new method works the same way on an
integer set + operands of an affine if op for example.

Signed-off-by: Uday Bondhugula &lt;uday@polymagelabs.com&gt;

Closes tensorflow/mlir#112

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/112 from bondhugula:set-canonicalize eff72f23250b96fa7d9f5caff3877440f5de2cec
PiperOrigin-RevId: 267532876
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce Fourier-Motzkin variable elimination + other cleanup/support</title>
<updated>2019-03-29T20:38:24+00:00</updated>
<author>
<name>Uday Bondhugula</name>
<email>bondhugula@google.com</email>
</author>
<published>2018-10-25T15:33:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=80610c2f49731d21d4a885501075f2ba443a89a4'/>
<id>80610c2f49731d21d4a885501075f2ba443a89a4</id>
<content type='text'>
- Introduce Fourier-Motzkin variable elimination to eliminate a dimension from
  a system of linear equalities/inequalities. Update isEmpty to use this.
  Since FM is only exact on rational/real spaces, an emptiness check based on
  this is guaranteed to be exact whenever it says the underlying set is empty;
  if it says, it's not empty, there may still be no integer points in it.
  Also, supports a version that computes "dark shadows".

- Test this by checking for "always false" conditionals in if statements.

- Unique IntegerSet's that are small (few constraints, few variables). This
  basically means the canonical empty set and other small sets that are
  likely commonly used get uniqued; allows checking for the canonical empty set
  by pointer. IntegerSet::kUniquingThreshold gives the threshold constraint size
  for uniqui'ing.

- rename simplify-affine-expr -&gt; simplify-affine-structures

Other cleanup

- IntegerSet::numConstraints, AffineMap::numResults are no longer needed;
  remove them.
- add copy assignment operators for AffineMap, IntegerSet.
- rename Invalid() -&gt; Null() on AffineExpr, AffineMap, IntegerSet
- Misc cleanup for FlatAffineConstraints API

PiperOrigin-RevId: 218690456
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Introduce Fourier-Motzkin variable elimination to eliminate a dimension from
  a system of linear equalities/inequalities. Update isEmpty to use this.
  Since FM is only exact on rational/real spaces, an emptiness check based on
  this is guaranteed to be exact whenever it says the underlying set is empty;
  if it says, it's not empty, there may still be no integer points in it.
  Also, supports a version that computes "dark shadows".

- Test this by checking for "always false" conditionals in if statements.

- Unique IntegerSet's that are small (few constraints, few variables). This
  basically means the canonical empty set and other small sets that are
  likely commonly used get uniqued; allows checking for the canonical empty set
  by pointer. IntegerSet::kUniquingThreshold gives the threshold constraint size
  for uniqui'ing.

- rename simplify-affine-expr -&gt; simplify-affine-structures

Other cleanup

- IntegerSet::numConstraints, AffineMap::numResults are no longer needed;
  remove them.
- add copy assignment operators for AffineMap, IntegerSet.
- rename Invalid() -&gt; Null() on AffineExpr, AffineMap, IntegerSet
- Misc cleanup for FlatAffineConstraints API

PiperOrigin-RevId: 218690456
</pre>
</div>
</content>
</entry>
<entry>
<title>Adds Gaussian Elimination to FlatAffineConstraints.</title>
<updated>2019-03-29T20:38:10+00:00</updated>
<author>
<name>MLIR Team</name>
<email>no-reply@google.com</email>
</author>
<published>2018-10-24T18:30:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=54132393500708e79649530eb87ae6411de987a7'/>
<id>54132393500708e79649530eb87ae6411de987a7</id>
<content type='text'>
- Adds FlatAffineConstraints::isEmpty method to test if there are no solutions to the system.
- Adds GCD test check if equality constraints have no solution.
- Adds unit test cases.

PiperOrigin-RevId: 218546319
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Adds FlatAffineConstraints::isEmpty method to test if there are no solutions to the system.
- Adds GCD test check if equality constraints have no solution.
- Adds unit test cases.

PiperOrigin-RevId: 218546319
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] IntegerSet value type</title>
<updated>2019-03-29T20:27:19+00:00</updated>
<author>
<name>Nicolas Vasilache</name>
<email>ntv@google.com</email>
</author>
<published>2018-10-10T16:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b04f881dcb8ec081031c3a64c937c46b05776a96'/>
<id>b04f881dcb8ec081031c3a64c937c46b05776a96</id>
<content type='text'>
This CL applies the same pattern as AffineMap to IntegerSet: a simple struct
that acts as the storage is allocated in the bump pointer. The IntegerSet is
immutable and accessed everywhere by value.

Note that unlike AffineMap, it is not possible to remove the MLIRContext
parameter when constructing an IntegerSet for now. One possible way to achieve
this would be to add an enum to distinguish between the mathematically empty
set, the universe set and other sets.

This is left for future discussion.

PiperOrigin-RevId: 216545361
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This CL applies the same pattern as AffineMap to IntegerSet: a simple struct
that acts as the storage is allocated in the bump pointer. The IntegerSet is
immutable and accessed everywhere by value.

Note that unlike AffineMap, it is not possible to remove the MLIRContext
parameter when constructing an IntegerSet for now. One possible way to achieve
this would be to add an enum to distinguish between the mathematically empty
set, the universe set and other sets.

This is left for future discussion.

PiperOrigin-RevId: 216545361
</pre>
</div>
</content>
</entry>
</feed>
