[PATCH] D143898: [CodeGenPrepare] Fold addressing mode into calls

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 11:20:08 PST 2023


efriedma added a comment.

> For calls we have an addressing computation that's essentially free when it's a part of the call sequence, as opposed to it being a separate instruction and using a simple register-to-register move.

There are a lot of cases where there isn't any extra "mov" that can hide the cost; the most common of those being the case where the value in question is spilled.  But I guess I can see the analogy.  I'd generally prefer to consider that sort of transform in terms of rematerialization, though.  We can compute the cost of remat much more accurately in the register allocator.

> IMHO the main issue here is not extending live ranges too much. As for the runtime overhead, sinking a foldable address is assumed to not increase the execution time, because of the checks in isLegalAddressingMode and (with this patch) in canFoldAddrModeIntoCall.

I was thinking more in terms of sinking to arbitrary uses, as opposed to only sinking some uses.


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

https://reviews.llvm.org/D143898



More information about the llvm-commits mailing list