[llvm] [DAGCombiner] Attempt to fold 'add' nodes to funnel-shift or rotate (PR #125612)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 21 10:25:11 PDT 2025


Artem-B wrote:

> Are you asking that I land the pre-commit on main as a separate commit? 

Not quite. Or, rather, that, and a bit more. We're concerned about corner cases that may be exposed by the change, and could benefit for wider testing. For testing to be useful we either need confidence that the tests themselves are correct, and it helps to have an established known good baseline. For this particular mix of instructions we appear to have no tests at the moment, but we do know that the current code in LLVM has been around for a while and is likely correct.

What I'm proposing is to create a set of tests capturing the status quo, across multiple "important" architectures. I would target x86, arm, amdgpu and nvptx.

Then land your patch, and see what changes in those baseline tests and verify that the changes do work and make sense.

It's not, strictly speaking, necessary to do it that way, but it's a relatively easy way to capture potential issues early.

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


More information about the llvm-commits mailing list