[all-commits] [llvm/llvm-project] a2de12: [RISCV] Relax a one use restriction performSRACombine
Craig Topper via All-commits
all-commits at lists.llvm.org
Thu Aug 4 11:25:47 PDT 2022
Author: Craig Topper <craig.topper at sifive.com>
Date: 2022-08-04 (Thu, 04 Aug 2022)
[RISCV] Relax a one use restriction performSRACombine
When folding (sra (add (shl X, 32), C1), 32 - C) -> (shl (sext_inreg (add X, C1), C)
ignore the use count on the (shl X, 32).
The sext_inreg after the transform is free. So we're only making
2 new instructions, the add and the shl. So we only need to be
concerned with replacing the original sra+add. The original shl
can have other uses. This helps if there are multiple different
constants being added to the same shl.
More information about the All-commits