[PATCH] D129715: [LoongArch] Heuristically load FP immediates by movgr2fr from materialized integer
WÁNG Xuěruì via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 27 05:49:03 PDT 2022
xen0n added a comment.
In D129715#3681385 <https://reviews.llvm.org/D129715#3681385>, @gonglingqin wrote:
> In D129715#3681358 <https://reviews.llvm.org/D129715#3681358>, @xry111 wrote:
>
>> In D129715#3681339 <https://reviews.llvm.org/D129715#3681339>, @gonglingqin wrote:
>>
>>> I used `cpu2017(fortran excluded)` to test the performance in 5 cases,
>>>
>>> 1. using constant pool,
>>> 2. materialized integer with 1 instruction,
>>> 3. materialized integer within 2 instructions,
>>> 4. materialized integer within 3 instructions,
>>> 5. materialized integer within 4 instructions.
>>>
>>> (Tests were run three times for each condition and the scores were geometrically averaged).
>>> The results showed no change in the scores for the 5 cases. @xen0n, @xry111, do you have any suggestions?
>>
>> Make it a tunable (`-loongarch-materialize-float-imm=0/1/2/3/4`, or some better name), I guess. And set the default to `0` for `-mtune=generic` or `-mtune=la464`. Then we can set it to other values if a future uarch behaves differently.
>
> Good suggestion! Thanks! If others agree with this opinion, I will implement it.
Hmm, so the workload characteristics of SPEC2017fp actually changed enough to make this optimization negligible. Interesting.
I think @xry111's suggestion to make this optimization tunable is reasonable, but it may need more work then. Perhaps this patch could be put on the back burner, we can always come to finish this later after the more essential things. Lots of downstream projects are blocked by availability of LLVM so it may be very worthwhile to shift priorities for now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129715/new/
https://reviews.llvm.org/D129715
More information about the llvm-commits
mailing list