[PATCH] D130560: [RISCV] Handle register spill in branch relaxation

Piggy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 23:23:17 PDT 2022


piggynl added a comment.

In D130560#3684918 <https://reviews.llvm.org/D130560#3684918>, @CoelacanthusHex wrote:

> There seems to be a problem here: if we perform only some operations on registers without sd after a jump (which can easily happen if only a few short instructions are executed between jumps), we then jump to another place. If we still restore immediately in this case, we are actually wasting resources.

Yes. We can construct a loop with a few instructions executed and a long jump at each iteration, making the jump scratch register saved/restored frequently. Maybe we can add a TODO in BranchRelaxation.cpp for future improvements?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130560/new/

https://reviews.llvm.org/D130560



More information about the llvm-commits mailing list