[llvm] [RISCV][WIP] Fold (sh3add Z, (add X, (slli Y, 6))) -> (sh3add (sh3add Y, Z), X). (PR #85734)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 21:54:53 PDT 2024


topperc wrote:

> @topperc In case no one has started on this, I can assign it to myself and work on it.

Are you going to tackle it has reassociate in DAG combine?

There are multiple variations of this that need to be handled.
-If the index to the gep is a srl, the shl will be combined to a shift and an `and` instead of two shifts.
-Need to handle the case where the GEP indices indices are zext from i32 so we can use shXadd.uw. The `and` and `shl` might could be in either order. We handle the (and (shl X, C), mask) case in `selectSHXADD_UWOp` during isel.

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


More information about the llvm-commits mailing list