[all-commits] [llvm/llvm-project] 8eb4dc: [RISCV] Move some SHXADD matching cases into a Com...

Craig Topper via All-commits all-commits at lists.llvm.org
Sun Jul 3 21:59:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8eb4dcb737479ba105db2ffc83e9f62a7f3f7fb3
      https://github.com/llvm/llvm-project/commit/8eb4dcb737479ba105db2ffc83e9f62a7f3f7fb3
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-07-03 (Sun, 03 Jul 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
    M llvm/lib/Target/RISCV/RISCVInstrInfoZb.td

  Log Message:
  -----------
  [RISCV] Move some SHXADD matching cases into a ComplexPattern. NFC

Some more complex cases require checking the relationship of
operands on different nodes of the match. They also require
additional instructions to be created. Using a ComplexPattern
gives us that flexibility.

I'll be adding another pattern in a future patch.


  Commit: d36e09cfe5914b246e4469cd972f67d35d80bf9c
      https://github.com/llvm/llvm-project/commit/d36e09cfe5914b246e4469cd972f67d35d80bf9c
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-07-03 (Sun, 03 Jul 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
    M llvm/test/CodeGen/RISCV/rv64zba.ll

  Log Message:
  -----------
  [RISCV] Add more SHXADD patterns.

This handles the code we get for this.

int foo(unsigned x, int *y) {
    return y[x >> 3];
}

The srl and shl implied by the array index will be combined to
form (srl (and X, C2), C1). We need to reverse this get to back
the shl to fold into SHXADD.


Compare: https://github.com/llvm/llvm-project/compare/93d6fdfc232c...d36e09cfe591


More information about the All-commits mailing list