[PATCH] D141473: [PowerPC] Simplify fp-to-int store optimization

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 22:25:48 PDT 2023


shchenz accepted this revision as: shchenz.
shchenz added a comment.
This revision is now accepted and ready to land.

LGTM. No more comments from me.

Please hold on some days in case other reviewers have concerns. Thanks very much for this improvement.



================
Comment at: llvm/lib/Target/PowerPC/PPCInstrP10.td:1258
+  def : Pat<(PPCstore_scal_int_from_vsr f128:$src, (PPCmatpcreladdr PCRelForm:$dst), 8),
+            (PSTXSDpc (COPY_TO_REGCLASS $src, VSRC), $dst, 0)>;
 
----------------
qiucf wrote:
> shchenz wrote:
> > qiucf wrote:
> > > shchenz wrote:
> > > > Can you explain why we need to copy to regclass `VSRC`? The definition of `PSTXSDpc` seems requiring RC to be `VFRC` for `$src`.
> > > Thanks, I updated the copied classes to respective regclass of the instructions. This `COPY_TO_REGCLASS` is needed, otherewise we'll get a `HW typeset is empty` build failure.
> > Yeah, I know we need a `COPY_TO_REGCLASS`, my confusion is why the dest RC is `VSRC`, not the original `VFRC` as the `$src` for `PSTXSDpc` requires `VFRC`.
> I updated them accordingly, they should get missed in last revision.
> 
> As of why `VSRC` also passes, I think the classes will be automatically shortened.
Thanks, yes, VFRC matchs what I thought.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141473



More information about the llvm-commits mailing list