[llvm] [SimplifyCFG] Treat umul + extract pattern as cheap single instruction. (PR #124933)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 05:54:45 PST 2025


=?utf-8?q?Gábor?= Spaits <gaborspaits1 at gmail.com>,
=?utf-8?q?Gábor?= Spaits <gaborspaits1 at gmail.com>,
=?utf-8?q?Gábor?= Spaits <gaborspaits1 at gmail.com>,
=?utf-8?q?Gábor?= Spaits <gaborspaits1 at gmail.com>,Gabor Spaits
 <gaborspaits1 at gmail.com>,Gabor Spaits <gaborspaits1 at gmail.com>,Gabor Spaits
 <gaborspaits1 at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/124933 at github.com>


antoniofrighetto wrote:

Perhaps we could include `!extract oneuse(op.with.overflow),1` in the pattern, have something like (and adjust the limit):
```cpp
WithOverflowInst *UnusedWO;
if (match(&I, m_CombineOr(m_ExtractValue<1>(m_OneUse(m_WithOverflowInst(UnusedWO))),
                          m_Not(m_ExtractValue<1>(m_OneUse(m_WithOverflowInst(UnusedWO)))))))
  Found = true;
```
But TBH, I believe the current code should be fine (regardless of the test).

https://github.com/llvm/llvm-project/pull/124933


More information about the llvm-commits mailing list