This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Add support for G_ADD and G_SUB.
ClosedPublic

Authored by Kai on Jun 17 2022, 4:13 PM.

Details

Summary

Extends the global isel implementation to support G_ADD and G_SUB.

Diff Detail

Event Timeline

Kai created this revision.Jun 17 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2022, 4:13 PM
Kai requested review of this revision.Jun 17 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2022, 4:13 PM
arsenm added inline comments.Jun 17 2022, 4:21 PM
llvm/test/CodeGen/PowerPC/GlobalISel/ppc-irtranslator.ll
42–43 ↗(On Diff #438059)

Checking these in an IRTranslator test is pointless

llvm/test/CodeGen/PowerPC/GlobalISel/ppc-isel-arithmentic.ll
11

Probably should also test some illegal types and vectors

Kai updated this revision to Diff 438453.Jun 20 2022, 12:21 PM
  • Removed test in ppc-irtranslator.ll
  • Added tests for i8, i16, i32.
Kai marked an inline comment as done.Jun 20 2022, 12:23 PM
Kai added inline comments.
llvm/test/CodeGen/PowerPC/GlobalISel/ppc-irtranslator.ll
42–43 ↗(On Diff #438059)

Removed tests.

llvm/test/CodeGen/PowerPC/GlobalISel/ppc-isel-arithmentic.ll
11

Added tests for i8, i16, i32.
Vectors are not yet supported, the base code in D127530 does not even have a register bank for vector res.

Kai added reviewers: shchenz, amyk, Restricted Project.Aug 30 2022, 8:42 AM
Kai marked an inline comment as done.
arsenm accepted this revision.Sep 14 2022, 3:09 PM

LGTM but I'd recommend generating the test checks

This revision is now accepted and ready to land.Sep 14 2022, 3:09 PM
amyk accepted this revision as: amyk.Sep 14 2022, 9:36 PM

LGTM, and I also think autogenerating the checks would be a good idea.

amyk added a comment.Oct 27 2022, 7:20 PM

Also, slight nit, but I think the name of test file should be ppc-isel-arithmetic.ll.

This revision was landed with ongoing or failed builds.Nov 21 2022, 3:35 PM
This revision was automatically updated to reflect the committed changes.