<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Interfaces/Utils/InferIntRangeCommon.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] Apply clang-tidy fixes for performance-unnecessary-copy-initialization in InferIntRangeCommon.cpp (NFC)</title>
<updated>2025-10-01T11:50:15+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2025-08-21T17:29:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d5f98f3b01d8cece369d62366c180a5deb89e42f'/>
<id>d5f98f3b01d8cece369d62366c180a5deb89e42f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][InferIntRangeCommon] Fix Division by Zero Crash (#151637)</title>
<updated>2025-08-17T17:56:34+00:00</updated>
<author>
<name>Veera</name>
<email>32646674+veera-sivarajan@users.noreply.github.com</email>
</author>
<published>2025-08-17T17:56:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e1aa41522020a51a99389675d8de3d9c5910e2cf'/>
<id>e1aa41522020a51a99389675d8de3d9c5910e2cf</id>
<content type='text'>
Fixes #131273

Adds a check to avoid division when max value of denominator is zero.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #131273

Adds a check to avoid division when max value of denominator is zero.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][IntRangeInference] Infer values for {memref,tensor}.dim (#122945)</title>
<updated>2025-01-30T00:43:53+00:00</updated>
<author>
<name>Krzysztof Drewniak</name>
<email>Krzysztof.Drewniak@amd.com</email>
</author>
<published>2025-01-30T00:43:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cdc09a118a7107b8e13ba5a254d3d794f51f9818'/>
<id>cdc09a118a7107b8e13ba5a254d3d794f51f9818</id>
<content type='text'>
Implement the integer range inference niterface for memref.dim and
tetnor.dim using shared code. The inference will infer the `dim` of
dynamic dimensions to [0, index_max] and take the union of all the
dimensions that the `dim` argument could be validly referring to.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement the integer range inference niterface for memref.dim and
tetnor.dim using shared code. The inference will infer the `dim` of
dynamic dimensions to [0, index_max] and take the union of all the
dimensions that the `dim` argument could be validly referring to.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][IntRangeInference] Fix `arith.ceildivsi` range inference when it includes `INT_MIN` (#121062)</title>
<updated>2024-12-27T13:50:21+00:00</updated>
<author>
<name>Ivan Butygin</name>
<email>ivan.butygin@gmail.com</email>
</author>
<published>2024-12-27T13:50:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ab16d49c99966f33900d68ed5370f19927ca52c'/>
<id>9ab16d49c99966f33900d68ed5370f19927ca52c</id>
<content type='text'>
There is a special case in `arith.ceildivsi` range inference for
handling `lhs.smin()==INT_MIN`, but when `lhs` is not a single value, it
can cause it to skip entire negative range. Add `lhs.smin() + 1` check
to handle it.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a special case in `arith.ceildivsi` range inference for
handling `lhs.smin()==INT_MIN`, but when `lhs` is not a single value, it
can cause it to skip entire negative range. Add `lhs.smin() + 1` check
to handle it.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][int-range] Update int range inference for `arith.xori` (#117272)</title>
<updated>2024-11-26T10:50:43+00:00</updated>
<author>
<name>Ivan Butygin</name>
<email>ivan.butygin@gmail.com</email>
</author>
<published>2024-11-26T10:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d471c85e654ad0111cdffe588b2b958b62eca29f'/>
<id>d471c85e654ad0111cdffe588b2b958b62eca29f</id>
<content type='text'>
Previous impl was getting incorrect results for widths &gt; i1 and was
disabled.

While same algorithm can be used for `andi` and `ori` too, without
additional modifications it will produce less precise result.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previous impl was getting incorrect results for widths &gt; i1 and was
disabled.

While same algorithm can be used for `andi` and `ori` too, without
additional modifications it will produce less precise result.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][int-range] Limit xor int range inference to i1 (#116968)</title>
<updated>2024-11-20T17:12:33+00:00</updated>
<author>
<name>Ivan Butygin</name>
<email>ivan.butygin@gmail.com</email>
</author>
<published>2024-11-20T17:12:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0733f384142b02558b80b3e9a4633dc4d202a14b'/>
<id>0733f384142b02558b80b3e9a4633dc4d202a14b</id>
<content type='text'>
Fixes https://github.com/llvm/llvm-project/issues/82168

`intrange::inferXor` was incorrectly handling ranges for widths &gt; i1
(see example in code). Limit it to i1 for now. For bigger widths it will
return maxRange.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/llvm/llvm-project/issues/82168

`intrange::inferXor` was incorrectly handling ranges for widths &gt; i1
(see example in code). Limit it to i1 for now. For bigger widths it will
return maxRange.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][IntRangeInference] Handle ceildivsi(INT_MIN, x &gt; 1) as expected (#116284)</title>
<updated>2024-11-15T17:43:05+00:00</updated>
<author>
<name>Krzysztof Drewniak</name>
<email>Krzysztof.Drewniak@amd.com</email>
</author>
<published>2024-11-15T17:43:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f2e42d9324f488ef113b8d2157f52ef1699b95f9'/>
<id>f2e42d9324f488ef113b8d2157f52ef1699b95f9</id>
<content type='text'>
Fixes #115293

While the definition of ceildivsi is integer division, rounding up, most
implementations will use `-(-a / b)` for dividing `a ceildiv b` with `a`
negative and `b` positive.

Mathematically, and for most integers, these two definitions are
equivalent. However, with `a == INT_MIN`, the initial negation is a
noop, which means that, while divinding and rounding up would give a
negative result, `-((- INT_MIN) / b)` is `-(INT_MIN / b)`, which is
positive.

This commit adds a special case to ceilDivSI inference to handle this
case and bring it in line with the operational instead of the
mathematical semantics of ceiling division.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #115293

While the definition of ceildivsi is integer division, rounding up, most
implementations will use `-(-a / b)` for dividing `a ceildiv b` with `a`
negative and `b` positive.

Mathematically, and for most integers, these two definitions are
equivalent. However, with `a == INT_MIN`, the initial negation is a
noop, which means that, while divinding and rounding up would give a
negative result, `-((- INT_MIN) / b)` is `-(INT_MIN / b)`, which is
positive.

This commit adds a special case to ceilDivSI inference to handle this
case and bring it in line with the operational instead of the
mathematical semantics of ceiling division.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] Fix dangling llvm::function_ref references (#114950)</title>
<updated>2024-11-05T16:34:48+00:00</updated>
<author>
<name>Haojian Wu</name>
<email>hokein.wu@gmail.com</email>
</author>
<published>2024-11-05T16:34:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4a88b9043fc400e9c7a8a7ca3cfd7a67be3a6a7f'/>
<id>4a88b9043fc400e9c7a8a7ca3cfd7a67be3a6a7f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Arith] Improve accuracy of `inferDivU` (#113789)</title>
<updated>2024-10-29T14:41:59+00:00</updated>
<author>
<name>goldsteinn</name>
<email>35538541+goldsteinn@users.noreply.github.com</email>
</author>
<published>2024-10-29T14:41:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e612f8d868b3fb88a44964a3d4efd61ee63e06a'/>
<id>2e612f8d868b3fb88a44964a3d4efd61ee63e06a</id>
<content type='text'>
1) We can always bound the maximum with the numerator.
    - https://alive2.llvm.org/ce/z/PqHvuT
2) Even if denominator min can be zero, we can still bound the minimum
   result with `lhs.umin u/ rhs.umax`.

This is similar to https://github.com/llvm/llvm-project/pull/110169</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1) We can always bound the maximum with the numerator.
    - https://alive2.llvm.org/ce/z/PqHvuT
2) Even if denominator min can be zero, we can still bound the minimum
   result with `lhs.umin u/ rhs.umax`.

This is similar to https://github.com/llvm/llvm-project/pull/110169</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] Unconditionally take min of max lhs/rhs value in inferRemU (#110169)</title>
<updated>2024-10-04T03:17:44+00:00</updated>
<author>
<name>goldsteinn</name>
<email>35538541+goldsteinn@users.noreply.github.com</email>
</author>
<published>2024-10-04T03:17:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e9b7a093417bda7e0bed2bd62bcaeb7c2a662665'/>
<id>e9b7a093417bda7e0bed2bd62bcaeb7c2a662665</id>
<content type='text'>
- **[MLIR] Add test for inferring range of remu; NFC**
- **[MLIR] Unconditionally take min of max lhs/rhs value in inferRemU**

`arith.remu` cannot be larger than (rhs - 1) or lhs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- **[MLIR] Add test for inferring range of remu; NFC**
- **[MLIR] Unconditionally take min of max lhs/rhs value in inferRemU**

`arith.remu` cannot be larger than (rhs - 1) or lhs.</pre>
</div>
</content>
</entry>
</feed>
