This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Match GNU tools canonical JALR and add aliases
ClosedPublic

Authored by jrtc27 on Dec 4 2018, 8:45 AM.

Details

Summary

The canonical GNU form of JALR resembles a load/store instruction rather
than placing the immediate offset as a separate argument, so match this
behaviour. Also add parser-only aliases for the three-operand form, and
add other shorter aliases also emitted by GNU tools.

Diff Detail

Repository
rL LLVM

Event Timeline

jrtc27 created this revision.Dec 4 2018, 8:45 AM
jrtc27 marked an inline comment as done.Dec 4 2018, 8:51 AM
jrtc27 added inline comments.
test/CodeGen/RISCV/branch-relaxation.ll
35 ↗(On Diff #176650)

Currently the MCOperandPredicate for simm12 doesn't match things other than literal constants and bare symbols so our aliases don't match; in future it should be modified to match the various LO12 variant kinds.

jrtc27 updated this revision to Diff 185326.Feb 5 2019, 9:14 AM

Rebased and added TODO comment.

Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2019, 9:14 AM
jrtc27 updated this revision to Diff 185421.Feb 5 2019, 3:15 PM

Fixed broken test

lenary added a subscriber: lenary.Jul 4 2019, 1:00 PM
asb accepted this revision.Jul 5 2019, 1:24 AM

Thanks James, this looks good to me (needs a rebase and trivial changes for rv32e-valid.s before landing).

This revision is now accepted and ready to land.Jul 5 2019, 1:24 AM
This revision was automatically updated to reflect the committed changes.
plotfi added a subscriber: plotfi.EditedJul 15 2019, 10:37 PM

This change has caused test failures in lld tests:

http://lab.llvm.org:8011/builders/lld-x86_64-ubuntu-fast/builds/3357

asb added a comment.Jul 15 2019, 10:47 PM

Sorry about that, patch incoming.

In D55277#1586958, @asb wrote:

Sorry about that, patch incoming.

I got one coming too. Should I wait for yours or just land this one?

Don't worry about it, I landed a change in r366183

asb added a comment.Jul 15 2019, 10:59 PM
In D55277#1586958, @asb wrote:

Sorry about that, patch incoming.

I got one coming too. Should I wait for yours or just land this one?

Oh great, please land yours then. Mind is written blind as lld doesn't seem to be building after I add it to LLVM_ENABLE_PROJECTS. Will have to wipe my build dir and wait a while.

In D55277#1586961, @asb wrote:
In D55277#1586958, @asb wrote:

Sorry about that, patch incoming.

I got one coming too. Should I wait for yours or just land this one?

Oh great, please land yours then. Mind is written blind as lld doesn't seem to be building after I add it to LLVM_ENABLE_PROJECTS. Will have to wipe my build dir and wait a while.

Would you be able to do a post commit look over: https://github.com/llvm/llvm-project/commit/3e10905c49ffda36d7a90e24be1ab30832fa4afc

??

Thanks

PL

asb added a comment.Jul 16 2019, 12:13 AM
In D55277#1586961, @asb wrote:
In D55277#1586958, @asb wrote:

Sorry about that, patch incoming.

I got one coming too. Should I wait for yours or just land this one?

Oh great, please land yours then. Mind is written blind as lld doesn't seem to be building after I add it to LLVM_ENABLE_PROJECTS. Will have to wipe my build dir and wait a while.

Would you be able to do a post commit look over: https://github.com/llvm/llvm-project/commit/3e10905c49ffda36d7a90e24be1ab30832fa4afc

??

Thanks

PL

LGTM. Thanks for helping clean this up. LLD is now in my standard build and pre-commit check setup.