This is an archive of the discontinued LLVM Phabricator instance.

[GISel] Combine G_FMULs into G_FABS/G_FNEG(G_FABS)
Needs RevisionPublic

Authored by mkitzan on May 19 2022, 12:37 PM.

Details

Summary

Patch adds new GICombineRules for G_FMUL:

  • G_FMUL(x, G_SELECT(G_FCMP(x > 0.0), -1.0, 1.0) -> G_FNEG(G_FABS(x))
  • G_FMUL(x, G_SELECT(G_FCMP(x > 0.0), 1.0, -1.0)) -> G_FABS(x)

Patch additionally adds new combine tests for AArch64 target for these new rules.
(Split off from https://reviews.llvm.org/D87870)

Diff Detail

Event Timeline

mkitzan created this revision.May 19 2022, 12:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2022, 12:37 PM
mkitzan requested review of this revision.May 19 2022, 12:37 PM
mkitzan retitled this revision from [GISel] Add new combines for G_FMUL with constant operands to [GISel] Combine G_FMULs into G_FABS/G_FNEG(G_FABS).
mkitzan edited the summary of this revision. (Show Details)May 19 2022, 12:42 PM
arsenm requested changes to this revision.Aug 17 2023, 3:47 PM

Should try new combiner pattern support

This revision now requires changes to proceed.Aug 17 2023, 3:47 PM