This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Set isAsCheapAsAMove for ADDI, ORI, XORI, LUI
ClosedPublic

Authored by apazos on Jan 9 2019, 6:13 PM.

Details

Summary

Affected instructions:
PseudoLI simplest form (ADDI with X0)
ALU operations with immediate (they do not set status flag - ADDI, ORI, XORI)

Diff Detail

Repository
rL LLVM

Event Timeline

apazos created this revision.Jan 9 2019, 6:13 PM
apazos updated this revision to Diff 181359.Jan 11 2019, 1:06 PM
apazos retitled this revision from WIP Identify isCheapAsAMove and isReMaterializable instructions to Fixed isReMaterializable and isAsCheapAsAMove settings.
apazos edited the summary of this revision. (Show Details)
apazos updated this revision to Diff 181360.Jan 11 2019, 1:12 PM
asb added a reviewer: asb.Jan 17 2019, 7:14 AM

Adding myself as reviewer.

asb added a comment.Jan 17 2019, 7:20 AM

I think it would be best to have a separate patch to fix isReMaterializable for LUI affecting the neighbouring instructions, and leave this patch for the isAsCheapAsAMove changes.

I'd be very happy for you to directly commit the change to isReMaterializable for LUI, and we can focus on discussing isAsCheapAsAMove here.

lib/Target/RISCV/RISCVInstrInfo.td
311 ↗(On Diff #181360)

Should LUI have isAsCheapAsAMove = 1?

kito-cheng removed a subscriber: kito-cheng.
kito-cheng added a subscriber: kito-cheng.

Sure, will update this patch and I have pushed the other changes to separate patches:
R351895 - Fixed isReMaterializable setting for LUI instruction.
https://reviews.llvm.org/D57069 [RISCV] Fixed isReMaterializable setting for ORI, XORI

apazos updated this revision to Diff 182995.Jan 22 2019, 4:08 PM
apazos retitled this revision from Fixed isReMaterializable and isAsCheapAsAMove settings to Fixed isAsCheapAsAMove settings.
apazos edited the summary of this revision. (Show Details)
asb accepted this revision.Jan 22 2019, 8:26 PM

LGTM, thanks. Might be best titled as something like "[RISCV] Set isAsCheapAsAMove for ADDI, ORI, XORI, LUI"

This revision is now accepted and ready to land.Jan 22 2019, 8:26 PM
apazos retitled this revision from Fixed isAsCheapAsAMove settings to [RISCV] Set isAsCheapAsAMove for ADDI, ORI, XORI, LUI.Jan 23 2019, 6:04 PM
This revision was automatically updated to reflect the committed changes.
asb added a comment.Jan 24 2019, 6:19 AM

Hi Ana. I reviewed the test changes caused by this commit, and they all seem fine to me.