This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Optimize immediate materialisation with SH*ADD
ClosedPublic

Authored by benshi001 on Nov 10 2021, 7:20 AM.

Details

Summary

Use LUI+SH*ADD+ADDI to compose specific immediates.

Diff Detail

Event Timeline

benshi001 created this revision.Nov 10 2021, 7:20 AM
benshi001 requested review of this revision.Nov 10 2021, 7:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 10 2021, 7:20 AM
This revision is now accepted and ready to land.Nov 10 2021, 3:27 PM
craig.topper requested changes to this revision.Nov 10 2021, 3:35 PM

I accidentally accepted this and I think I can only undo that by selecting Request Changes. Sorry.

llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
294

Why do we need a cast to uint64_t after the divide?

This revision now requires changes to proceed.Nov 10 2021, 3:35 PM
benshi001 updated this revision to Diff 386391.Nov 10 2021, 6:10 PM
benshi001 marked an inline comment as done.
benshi001 added inline comments.
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
294

the cast to uint64 is removed.

benshi001 marked an inline comment as done.Nov 10 2021, 6:15 PM
benshi001 updated this revision to Diff 386482.Nov 11 2021, 5:01 AM

LGTM.

Thanks. Hex values are also attached as comments.

This revision is now accepted and ready to land.Nov 15 2021, 11:32 AM
This revision was automatically updated to reflect the committed changes.