[PATCH] D79785: [ARM] Register pressure with -mthumb forces register reload before each call

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 06:35:11 PDT 2020


dmgreen added a comment.

In D79785#2251753 <https://reviews.llvm.org/D79785#2251753>, @prathamesh wrote:

> It seems the issue comes from TargetInstrInfo::foldMemoryOperand, which adds the memory operands of LoadMI to newly created MI.
> ...
> If we return immediately after calling foldMemoryOperandImpl, then the test-case compiles succeesfully.
> I guess for this specific folding we don't need to attach memory operands of LoadMI, but that might not be true in general case ?
> Should there be some way for foldMemoryOperandImpl to signal to foldMemoryOperand not to add memory operands of LoadMI ?

Yeah. That sounds like what I was seeing. I'm not sure if I would recommend changing it so that foldMemoryOperandImpl is responsible for adding the memory operand - there seems to be quite a lot of code already in different targets foldMemoryOperandImpl that would need to be changed. That looks complex and error prone.

Perhaps like you say a slightly different interface could be used, so that we have more control over the instruction we are creating in this case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79785



More information about the llvm-commits mailing list