[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


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 12a1ca9c42c45cfb4777a42f73db5d33e87577e4
      https://github.com/llvm/llvm-project/commit/12a1ca9c42c45cfb4777a42f73db5d33e87577e4
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-08-04 (Thu, 04 Aug 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rv64i-shift-sext.ll

  Log Message:
  -----------
  [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 mailing list