[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
Mon Mar 18 23:54:34 PDT 2024


topperc wrote:

> which is (z << 3 + y << 6) + x and dag combine simplified it to (y << 3 + z) << 3 + x:

Weird that it did that unless it knew about the sh3add instruction existing. Without a sh3add instruction, it doesn't save code and increases the path length.

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


More information about the llvm-commits mailing list