[all-commits] [llvm/llvm-project] 12a1ca: [RISCV] Relax another one use restriction in perfo...
Craig Topper via All-commits
all-commits at lists.llvm.org
Thu Aug 4 14:33:05 PDT 2022
Author: Craig Topper <craig.topper at sifive.com>
Date: 2022-08-04 (Thu, 04 Aug 2022)
[RISCV] Relax another one use restriction in performSRACombine.
When folding (sra (add (shl X, 32), C1), 32 - C) -> (shl (sext_inreg (add X, C1), i32), C)
it's possible that the add is used by multiple sras. We should
allow the combine if all the SRAs will eventually be updated.
After transforming all of the sras, the shls will share a single
(sext_inreg (add X, C1), i32).
This pattern occurs if an sra with 32 is used as index in multiple
GEPs with different scales. The shl from the GEPs will be combined
with the sra before we get a chance to match the sra pattern.
More information about the All-commits