[all-commits] [llvm/llvm-project] b41e0f: [RISCV] Prevent overflowing the small size of Inst...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon Jun 12 15:29:27 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b41e0fb44ffaeebb508efb02d3359b175bf04c84
      https://github.com/llvm/llvm-project/commit/b41e0fb44ffaeebb508efb02d3359b175bf04c84
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-06-12 (Mon, 12 Jun 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp

  Log Message:
  -----------
  [RISCV] Prevent overflowing the small size of InstSeq in generateInstSeq.

The small size is 8 which is the worst case of the core recursive
algorithm.

The special cases use the core algorithm and append additonal
instructions. We were pushing the extra instructions before checking
the profitability. This could lead to 9 and maybe 10 instructions
in the sequence which overflows the small size.

This patch does the profitability check before inserting the
extra instructions so that we don't create 9 or 10 insruction
sequences.

Alternative we could bump the small size to 9 or 10, but then
we're pushing things that are never going be used.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D152308




More information about the All-commits mailing list