This is an archive of the discontinued LLVM Phabricator instance.

[TII] Allow getMemOpBaseRegImmOfs() to accept negative offsets. NFC.
ClosedPublic

Authored by mcrosier on Mar 8 2016, 1:46 PM.

Details

Summary

Offsets can be negative, of course.

This is in preparation for a follow up patch to improve the AArch64 load/store optimization pass. I plan on adding unscaled loads to getMemOpBaseRegImmOfs() so the MI scheduler clusters loads to improve pairing. In AArch64 unscaled loads/stores are used for negatives offsets.

Please have a look.

Chad

Diff Detail

Event Timeline

mcrosier updated this revision to Diff 50066.Mar 8 2016, 1:46 PM
mcrosier retitled this revision from to [TII] Allow getMemOpBaseRegImmOfs() to accept negative offsets. NFC..
mcrosier updated this object.
mcrosier added a subscriber: llvm-commits.

Adding Matt/Tom as this may impact the R600/SI target.

This change does cause test/CodeGen/AMDGPU/ds_read2st64.ll to fail for the simple_read2st64_f64_max_offset test case. I'll investigate.

mcrosier edited edge metadata.Mar 8 2016, 1:54 PM
mcrosier added a subscriber: bmakam.
arsenm added inline comments.Mar 8 2016, 2:06 PM
include/llvm/Target/TargetInstrInfo.h
976

I think this should be changed to int64_t to be consistent with other offsets everywhere else

mcrosier updated this revision to Diff 50133.Mar 9 2016, 7:05 AM

Use int64_t, per Matt's request. All lit test are now passing.

chandlerc accepted this revision.Mar 9 2016, 7:09 AM
chandlerc added a reviewer: chandlerc.
chandlerc added a subscriber: chandlerc.

LGTM

This revision is now accepted and ready to land.Mar 9 2016, 7:09 AM
mcrosier closed this revision.Mar 9 2016, 8:53 AM

Thanks, Chandler. Committed in r263021.