This is an archive of the discontinued LLVM Phabricator instance.

[RISCV 11.5/n] Codegen support for materializing constants
ClosedPublic

Authored by asb on Oct 19 2017, 10:38 AM.

Details

Summary

Splitting out support for materializing constants, as suggested by @reames in D29934.

This patch adds support and tests for materializing 32-bit constants.

Diff Detail

Repository
rL LLVM

Event Timeline

asb created this revision.Oct 19 2017, 10:38 AM
sdardis added inline comments.
lib/Target/RISCV/RISCVInstrInfo.td
281 ↗(On Diff #119600)

You should add the LUI pattern for materializing constants where the lower 12 bits are all zeros,

asb added inline comments.Oct 19 2017, 11:09 AM
lib/Target/RISCV/RISCVInstrInfo.td
281 ↗(On Diff #119600)

Agreed, thanks for the comment. I had someone who has been playing with this patchset do this and send me a patch + tests via email. In order to track code ownership properly (and get them introduced to the LLVM code review process), they will submit to phabricator. It would probably make sense to commit this patch with a // TODO: add pattern for immediate with lower 12 bits all zeros.

sdardis added inline comments.Oct 19 2017, 11:21 AM
lib/Target/RISCV/RISCVInstrInfo.td
281 ↗(On Diff #119600)

In order to track code ownership properly (and get them introduced to the LLVM code review process), they will submit to phabricator. It would probably make sense to commit this patch with a // TODO: add pattern for immediate with lower 12 bits all zeros.

Sounds reasonable.

asb updated this revision to Diff 119664.Oct 20 2017, 8:53 AM

Split out the immediate materialisation tests to a separate file and add a TODO for immediates with lo12=0.

reames accepted this revision.Oct 20 2017, 3:55 PM

LGTM

This revision is now accepted and ready to land.Oct 20 2017, 3:55 PM
This revision was automatically updated to reflect the committed changes.