Page MenuHomePhabricator

[RISCV] Optimize immediate materialisation with BSETI/BCLRI
ClosedPublic

Authored by benshi001 on Sun, Oct 10, 6:04 AM.

Details

Summary

Opitimize immediate materialisation in the following way if profitable:

  1. Use BCLRI for upper 32 bits if the lower 32 bits are negative int32.
  2. Use BSETI for upper 32 bits if the lower 32 bits are positive int32.

Diff Detail

Event Timeline

benshi001 created this revision.Sun, Oct 10, 6:04 AM
benshi001 requested review of this revision.Sun, Oct 10, 6:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptSun, Oct 10, 6:04 AM
benshi001 updated this revision to Diff 378668.Mon, Oct 11, 8:03 AM
craig.topper added inline comments.Mon, Oct 11, 9:40 AM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
208

BCLI -> BCLRI

215

cprresponding -> corresponding

benshi001 marked 2 inline comments as done.
benshi001 updated this revision to Diff 378968.Tue, Oct 12, 4:29 AM
craig.topper added inline comments.Tue, Oct 12, 9:59 AM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
218

Can we build the bits from low to hi instead of hi to low?

benshi001 updated this revision to Diff 379242.Tue, Oct 12, 6:16 PM
This comment was removed by benshi001.
benshi001 edited the summary of this revision. (Show Details)Tue, Oct 12, 6:17 PM
benshi001 set the repository for this revision to rG LLVM Github Monorepo.
benshi001 edited the summary of this revision. (Show Details)
benshi001 updated this revision to Diff 379247.Tue, Oct 12, 6:45 PM
benshi001 marked an inline comment as done.
craig.topper added inline comments.Wed, Oct 13, 10:03 AM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
226

"32-bit" -> "32 bits"

"32-bit is" -> "32 bits are"

32-bit with a hyphen refers to a 32-bit architecture. Your just talking about number of bits here so no hyphen.

227

32-bit -> 32 bits

228

32-bit is -> 32 bits are

benshi001 updated this revision to Diff 379573.Wed, Oct 13, 6:09 PM
benshi001 edited the summary of this revision. (Show Details)
benshi001 marked 3 inline comments as done.
benshi001 updated this revision to Diff 379595.Wed, Oct 13, 8:13 PM
This revision is now accepted and ready to land.Wed, Oct 13, 9:47 PM