<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Analysis/ValueTracking.cpp, branch users/nico/python-2</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>[ValueTracking] Add `matchSimpleBinaryIntrinsicRecurrence` helper</title>
<updated>2025-06-27T17:04:28+00:00</updated>
<author>
<name>Antonio Frighetto</name>
<email>me@antoniofrighetto.com</email>
</author>
<published>2025-06-27T17:03:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c11ea449e59cfbd10b7ba2ed11a049ca5184164a'/>
<id>c11ea449e59cfbd10b7ba2ed11a049ca5184164a</id>
<content type='text'>
Similarly to what it is being done to match simple recurrence cycle
relations, attempt to match value-accumulating recurrences of kind:
```
  %umax.acc = phi i8 [ %umax, %backedge ], [ %a, %entry ]
  %umax = call i8 @llvm.umax.i8(i8 %umax.acc, i8 %b)
```
Preliminary work to let InstCombine avoid folding such recurrences,
so that simple loop-invariant computation may get hoisted. Minor
opportunity to refactor out code as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similarly to what it is being done to match simple recurrence cycle
relations, attempt to match value-accumulating recurrences of kind:
```
  %umax.acc = phi i8 [ %umax, %backedge ], [ %a, %entry ]
  %umax = call i8 @llvm.umax.i8(i8 %umax.acc, i8 %b)
```
Preliminary work to let InstCombine avoid folding such recurrences,
so that simple loop-invariant computation may get hoisted. Minor
opportunity to refactor out code as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] KnownBits::isNonNegative should recognize `b - a` after `a &lt;= b` (#145105)</title>
<updated>2025-06-24T16:51:49+00:00</updated>
<author>
<name>Ross Kirsling</name>
<email>ross.kirsling@sony.com</email>
</author>
<published>2025-06-24T16:51:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7d2293d1d95379bbdbb6446b088219ac06b97e1e'/>
<id>7d2293d1d95379bbdbb6446b088219ac06b97e1e</id>
<content type='text'>
Alive2: https://alive2.llvm.org/ce/z/an9npN
Fixes #142283.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Alive2: https://alive2.llvm.org/ce/z/an9npN
Fixes #142283.</pre>
</div>
</content>
</entry>
<entry>
<title>[ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (#144686)</title>
<updated>2025-06-24T00:43:47+00:00</updated>
<author>
<name>Wenju He</name>
<email>wenju.he@intel.com</email>
</author>
<published>2025-06-24T00:43:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9d570d568b37249ddcff8319c5965c4bdc4f7ca2'/>
<id>9d570d568b37249ddcff8319c5965c4bdc4f7ca2</id>
<content type='text'>
In our downstream GPU target, following IR is valid before instcombine
although the second addrspacecast causes UB.
  define i1 @test(ptr addrspace(1) noundef %v) {
    %0 = addrspacecast ptr addrspace(1) %v to ptr addrspace(4)
    %1 = call i32 @llvm.xxxx.isaddr.shared(ptr addrspace(4) %0)
    %2 = icmp eq i32 %1, 0
    %3 = addrspacecast ptr addrspace(4) %0 to ptr addrspace(3)
    %4 = select i1 %2, ptr addrspace(3) null, ptr addrspace(3) %3
    %5 = icmp eq ptr addrspace(3) %4, null
    ret i1 %5
  }
We have a custom optimization that replaces invalid addrspacecast with
poison, and IR is still valid since `select` stops poison propagation.

However, instcombine pass optimizes `select` to `or`:
    %0 = addrspacecast ptr addrspace(1) %v to ptr addrspace(4)
    %1 = call i32 @llvm.xxxx.isaddr.shared(ptr addrspace(4) %0)
    %2 = icmp eq i32 %1, 0
    %3 = addrspacecast ptr addrspace(1) %v to ptr addrspace(3)
    %4 = icmp eq ptr addrspace(3) %3, null
    %5 = or i1 %2, %4
    ret i1 %5
The transform is invalid for our target.

---------

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In our downstream GPU target, following IR is valid before instcombine
although the second addrspacecast causes UB.
  define i1 @test(ptr addrspace(1) noundef %v) {
    %0 = addrspacecast ptr addrspace(1) %v to ptr addrspace(4)
    %1 = call i32 @llvm.xxxx.isaddr.shared(ptr addrspace(4) %0)
    %2 = icmp eq i32 %1, 0
    %3 = addrspacecast ptr addrspace(4) %0 to ptr addrspace(3)
    %4 = select i1 %2, ptr addrspace(3) null, ptr addrspace(3) %3
    %5 = icmp eq ptr addrspace(3) %4, null
    ret i1 %5
  }
We have a custom optimization that replaces invalid addrspacecast with
poison, and IR is still valid since `select` stops poison propagation.

However, instcombine pass optimizes `select` to `or`:
    %0 = addrspacecast ptr addrspace(1) %v to ptr addrspace(4)
    %1 = call i32 @llvm.xxxx.isaddr.shared(ptr addrspace(4) %0)
    %2 = icmp eq i32 %1, 0
    %3 = addrspacecast ptr addrspace(1) %v to ptr addrspace(3)
    %4 = icmp eq ptr addrspace(3) %3, null
    %5 = or i1 %2, %4
    ret i1 %5
The transform is invalid for our target.

---------

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Fold `ceil(X / (2 ^ C)) == 0` -&gt; `X == 0` (#143683)</title>
<updated>2025-06-23T02:51:17+00:00</updated>
<author>
<name>Iris Shi</name>
<email>0.0@owo.li</email>
</author>
<published>2025-06-23T02:51:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=32f911f3e83b0a3d2242502940c487998672ffd4'/>
<id>32f911f3e83b0a3d2242502940c487998672ffd4</id>
<content type='text'>
Co-authored-by: Yingwei Zheng &lt;dtcxzyw2333@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Yingwei Zheng &lt;dtcxzyw2333@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[ValueTracking] Improve `Bitcast` handling to match SDAG" (#145191)</title>
<updated>2025-06-21T23:02:26+00:00</updated>
<author>
<name>Arthur Eubanks</name>
<email>aeubanks@google.com</email>
</author>
<published>2025-06-21T23:02:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=570885128351868c1308bb22e8ca351d318bc4a1'/>
<id>570885128351868c1308bb22e8ca351d318bc4a1</id>
<content type='text'>
Reverts llvm/llvm-project#125935

Causes miscompiles, see comments in #125935</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#125935

Causes miscompiles, see comments in #125935</pre>
</div>
</content>
</entry>
<entry>
<title>[ValueTracking] Improve `Bitcast` handling to match SDAG (#125935)</title>
<updated>2025-06-19T17:35:40+00:00</updated>
<author>
<name>Abhishek Kaushik</name>
<email>abhishek.kaushik@intel.com</email>
</author>
<published>2025-06-19T17:35:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0b8179b2adbc821324c425d7cafd269f84e72d5e'/>
<id>0b8179b2adbc821324c425d7cafd269f84e72d5e</id>
<content type='text'>
Closes #125228</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #125228</pre>
</div>
</content>
</entry>
<entry>
<title>[DebugInfo][RemoveDIs] Remove a swathe of debug-intrinsic code (#144389)</title>
<updated>2025-06-17T14:55:14+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2025-06-17T14:55:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9eb0020555fc643582b2802abb8c1bc92059c248'/>
<id>9eb0020555fc643582b2802abb8c1bc92059c248</id>
<content type='text'>
Seeing how we can't generate any debug intrinsics any more: delete a
variety of codepaths where they're handled. For the most part these are
plain deletions, in others I've tweaked comments to remain coherent, or
added a type to (what was) type-generic-lambdas.

This isn't all the DbgInfoIntrinsic call sites but it's most of the
simple scenarios.

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Seeing how we can't generate any debug intrinsics any more: delete a
variety of codepaths where they're handled. For the most part these are
plain deletions, in others I've tweaked comments to remain coherent, or
added a type to (what was) type-generic-lambdas.

This isn't all the DbgInfoIntrinsic call sites but it's most of the
simple scenarios.

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[ValueTracking] Remove unused variable in matchSimpleRecurrence (NFC). (#144316)</title>
<updated>2025-06-16T08:57:21+00:00</updated>
<author>
<name>Ricardo Jesus</name>
<email>rjj@nvidia.com</email>
</author>
<published>2025-06-16T08:57:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f12dd8f86a2911f69349807359d3bc792e6b773d'/>
<id>f12dd8f86a2911f69349807359d3bc792e6b773d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ValueTracking] Remove opcode whitelist from matchSimpleRecurrence. (#144031)</title>
<updated>2025-06-16T08:12:42+00:00</updated>
<author>
<name>Ricardo Jesus</name>
<email>rjj@nvidia.com</email>
</author>
<published>2025-06-16T08:12:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cca454b54c7d58930e261c7fa72f44a1a8976997'/>
<id>cca454b54c7d58930e261c7fa72f44a1a8976997</id>
<content type='text'>
This also patches HashRecognize to avoid it mishandling some opcodes.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This also patches HashRecognize to avoid it mishandling some opcodes.</pre>
</div>
</content>
</entry>
<entry>
<title>[ValueTracking] Add subtraction support for setLimitsForBinOp (#143618)</title>
<updated>2025-06-15T07:32:34+00:00</updated>
<author>
<name>AZero13</name>
<email>gfunni234@gmail.com</email>
</author>
<published>2025-06-15T07:32:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=30a41a642358d0f427c3cbc0299ea48fbc0cf79e'/>
<id>30a41a642358d0f427c3cbc0299ea48fbc0cf79e</id>
<content type='text'>
We can determine the range from a subtraction if it has nsw or nuw.

https://alive2.llvm.org/ce/z/tXAKVV
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can determine the range from a subtraction if it has nsw or nuw.

https://alive2.llvm.org/ce/z/tXAKVV
</pre>
</div>
</content>
</entry>
</feed>
