This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Share code for fixed offsets adjustRegs (thus materializing fewer constants)
ClosedPublic

Authored by reames on Nov 28 2022, 4:03 PM.

Details

Summary

This reuses the existing optimized implementation of adjustReg, and commons up code. This has the effect of enabling two code changes for the new caller. First, we enable the "split andi" lowering (with no alignment requirement), and second we use a sub with smaller constant in register instead of a add with negative constant in register.

Diff Detail

Event Timeline

reames created this revision.Nov 28 2022, 4:03 PM
reames requested review of this revision.Nov 28 2022, 4:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 4:03 PM
jrtc27 added inline comments.Nov 28 2022, 4:05 PM
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
301

/*...=*/?

llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
170

Name doesn't match the header

reames updated this revision to Diff 478606.Nov 29 2022, 8:03 AM

Address @jrtc27 's comments

This revision is now accepted and ready to land.Nov 30 2022, 1:01 AM
asb accepted this revision.Nov 30 2022, 3:33 AM

Nice improvement - LGTM!

reames closed this revision.Nov 30 2022, 11:00 AM

This has landed, but I accidentally tagged with the wrong review so auto-close didn't catch it.

commit ac1ec9e2904a696e360b40572c3b3c29d67981ef
Author: Philip Reames <preames@rivosinc.com>
Date: Wed Nov 30 07:22:52 2022 -0800

[RISCV] Share code for fixed offsets adjustRegs (thus materializing fewer constants)

This reuses the existing optimized implementation of adjustReg, and commons up code. This has the effect of enabling two code changes for the new caller. First, we enable the "split andi" lowering (with no alignment requirement), and second we use a sub with smaller constant in register instead of a add with negative constant in register.

Differential Revision: https://reviews.llvm.org/D132839