[PATCH] D118216: [RISCV] eliminate rematerialization of array's base address

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 8 10:06:02 PST 2022


craig.topper added a comment.

In D118216#3305266 <https://reviews.llvm.org/D118216#3305266>, @jrtc27 wrote:

> This seems conceptually wrong to me. isAsCheapAsAMove is meant to model how expensive an instruction is to execute, but how you compute the immediate it uses has zero bearing on that. `lui rd, 0x123` and `lui rd, %hi(sym)` if `%hi(sym)` happens to be 0x123 are completely indistinguishable from the perspective of the processor. To me this screams of something elsewhere getting cost modelling wrong.

Maybe the heuristic #1 should ignore the isCheapAsMove if the instruction isTriviallyRematerializable?


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

https://reviews.llvm.org/D118216



More information about the llvm-commits mailing list