Page MenuHomePhabricator

[PowerPC] Simplify fp-to-int store optimization
Needs ReviewPublic

Authored by qiucf on Jan 11 2023, 2:14 AM.

Details

Reviewers
nemanjai
shchenz
lei
Group Reviewers
Restricted Project
Summary

On PowerPC VSX targets, fp-to-int will be transformed into xscv* + mfvsr. When the result is to be stored, mfvsr can be replaced by a direct store.

This patch simplifies the optimization by using existing fp-to-int code, which also helps for:

  1. Strict floating point support of this optimization (in another patch)
  2. Better codegen from CSE

Diff Detail

Event Timeline

qiucf created this revision.Jan 11 2023, 2:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 2:14 AM
qiucf requested review of this revision.Jan 11 2023, 2:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 2:14 AM
shchenz added inline comments.Jan 11 2023, 11:49 PM
llvm/test/CodeGen/PowerPC/store_fptoi.ll
1032

From the case change, I am thinking common the 3 xscvdpsxds sounds like making more sense?

qiucf updated this revision to Diff 494157.Feb 1 2023, 9:18 PM
qiucf marked an inline comment as done.
qiucf retitled this revision from [PowerPC] Only optimize store of fptoint for single used to [PowerPC] Simplify fp-to-int store optimization.
qiucf edited the summary of this revision. (Show Details)
qiucf updated this revision to Diff 495004.Feb 5 2023, 10:46 PM