[all-commits] [llvm/llvm-project] ec0f0e: [RISCV] Add asserts that we don't increase codesiz...

Philip Reames via All-commits all-commits at lists.llvm.org
Tue Jan 31 07:50:09 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec0f0ecd48e99ebecd224585c04c67a177543fa1
      https://github.com/llvm/llvm-project/commit/ec0f0ecd48e99ebecd224585c04c67a177543fa1
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2023-01-31 (Tue, 31 Jan 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp
    M llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp

  Log Message:
  -----------
  [RISCV] Add asserts that we don't increase codesize during pseudo expansion

We currently assume that pseudo expansion doesn't increase the distance between a branch and it's label. This patch adds some asserts to catch violations of this property in pseudo expansion.

I chose to only do the assertion at the function level as we have to scan the whole function for size changes (since expansion can create multiple blocks). We could cache individual block sizes, and thus make the check cheap enough to do after every expansion, but that requires more complex code.

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




More information about the All-commits mailing list