This is an archive of the discontinued LLVM Phabricator instance.

X86: Produce @ABS8 symbol modifiers for absolute symbols in range [0,256).
ClosedPublic

Authored by pcc on Jan 13 2017, 11:58 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 84348.Jan 13 2017, 11:58 AM
pcc retitled this revision from to X86: Produce @ABS8 symbol modifiers for absolute symbols in range [0,256)..
pcc updated this object.
pcc added reviewers: RKSimon, craig.topper.
pcc added a subscriber: llvm-commits.
RKSimon added inline comments.Jan 31 2017, 10:49 AM
llvm/lib/Target/X86/X86Subtarget.cpp
100 ↗(On Diff #84348)

Should we treating this as an unsigned value? D28688 suggested its sign-extended

pcc updated this revision to Diff 86470.Jan 31 2017, 11:39 AM
  • Address review comments
pcc marked an inline comment as done.Jan 31 2017, 11:39 AM
pcc added inline comments.
llvm/lib/Target/X86/X86Subtarget.cpp
100 ↗(On Diff #84348)

Good point. The tricky thing here is that R_X86_64_8 is an unsigned relocation, but we're using it to relocate a sign extended operand. Probably the safest thing we can do here is to accept only the range [0,128), which I've done. If it proves necessary later, we can try to recognise patterns like sext i64 (trunc i8 (i8* @foo)) and allow the range [-128,128).

pcc updated this revision to Diff 86471.Jan 31 2017, 11:40 AM
pcc marked an inline comment as done.
  • Update a comment
RKSimon accepted this revision.Feb 1 2017, 3:50 AM

Please update the patch title to "X86: Produce @ABS8 symbol modifiers for absolute symbols in range [0,128)." before submission.

LGTM

This revision is now accepted and ready to land.Feb 1 2017, 3:50 AM
This revision was automatically updated to reflect the committed changes.