This is an archive of the discontinued LLVM Phabricator instance.

[PPC] Use subfic instruction for subtract from immediate
ClosedPublic

Authored by inouehrs on Feb 1 2017, 3:37 AM.

Details

Summary
  • generate subfic instruction for subtracting a value in a GPR from a 16-bit immediate (e.g. x = 64 - y); currently LLVM generates two instructions (load immediate + subtract) for this purpose
  • add a unit test to confirm that subfic is used if possible

Diff Detail

Event Timeline

inouehrs created this revision.Feb 1 2017, 3:37 AM
inouehrs updated this revision to Diff 86630.Feb 1 2017, 6:53 AM

Uploaded the patch with full context.

nemanjai added inline comments.Feb 1 2017, 10:53 PM
test/CodeGen/PowerPC/subtract_from_imm.ll
4

Please remove this metadata and add -mtriple to the run line (also add a run line for ppc64le).

inouehrs updated this revision to Diff 86771.Feb 1 2017, 11:37 PM

remove metadata from unit test and add -mtriple to the run lines

inouehrs marked an inline comment as done.Feb 22 2017, 11:37 PM

gentle ping

This revision is now accepted and ready to land.Feb 23 2017, 3:50 AM
This revision was automatically updated to reflect the committed changes.