[PATCH] D117741: [RISCV] Set CostPerUse to 1 iff RVC is enabled

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 05:57:53 PST 2022


jrtc27 added a comment.

In D117741#3258034 <https://reviews.llvm.org/D117741#3258034>, @luismarques wrote:

> In D117741#3257196 <https://reviews.llvm.org/D117741#3257196>, @pcwang-thead wrote:
>
>> In D117741#3257026 <https://reviews.llvm.org/D117741#3257026>, @jrtc27 wrote:
>>
>>> This scheme seems rather inflexible. We can get away with it currently since the default behaviour of zero-filling CostPerUse elements out to the maximum list size works in every case, but I could see there being issues in future where you end up needing to be extremely verbose to avoid such behaviour.
>>
>> Correct me if I am wrong, we shall define CostPerUse=[0, 0] explicitly for RVC registers?
>
> If I understand correctly, that would be enough to address @jrtc27's comment, no?
>
> Overall LGTM. Maybe just clarify and address that previous point?

No, I would rather //not// do that. My concern is that if we ever want more than one dimension, much like HwMode, we will have to expand out the 2^N possibilities for every register, with most entries being duplicates. That would only be solved if you could, say, choose the index based on what register is being asked about, not just the MachineFunction, as then you could have different meanings for CostPerUse indices between different sets of registers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117741



More information about the llvm-commits mailing list