[llvm] [Reland][PatternMatch] Add `m_[Shift]OrSelf` matchers. (PR #154375)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 03:56:49 PDT 2025


nikic wrote:

> Relands https://github.com/llvm/llvm-project/pull/152924. This patch removes an unnecessary one-use check on the leaf node.

I wouldn't really say it's unnecessary. Without the check, we may now load the same location multiple times. But it does seem beneficial in practice.

However, the behavior is now inconsistent, in that this place omits the one-use check, but the other doesn't (i.e. no one-use check on L1, but one-use check on L2).

I think it would be good to do the one-use changes separate from this refactoring.

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


More information about the llvm-commits mailing list