[PATCH] D129715: [LoongArch] Optimize the loading of floating-point immediates

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 19:53:01 PDT 2022


xen0n added a comment.

In D129715#3650519 <https://reviews.llvm.org/D129715#3650519>, @SixWeining wrote:

> This change optimzies out the constant pool for loading floating-point constant by li+i2f, so I think the title could be:  "[LoongArch] Optimize the loading of floating-point immediates by li+i2f", and it' better that use a common case in the summary but not the 1.0.
>
> To other reviewers: we tested this optimization with an internal llvm version (llvm13) on 3A5000, and it shows that SPEC CPU2006 FP score increases 1% in average. 470.lbm score increases 8.9%. But we wonder why other architectures have not done so? Is there any potential issue?

Hmm yeah I overlooked the overly generic patch title (I was reviewing the code in the metro). But it seems the `i2f` isn't found anywhere in the repo nor the commit history, instead there's `i2fp` but that usage isn't common either. I assume the `i2fp` is short for the `{s,u}itofp` IR insn. Then the description is incorrect because the `{s,u}itofp` transfers the numeric value, not bit layout.

I think the title could be further simplified into something like "[LoongArch] Load FP immediates by movgr2fr from materialized integer", and the justification (such as the performance numbers you cited) could be put in the commit message body. What do you think?


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