This is an archive of the discontinued LLVM Phabricator instance.

[mips] For PIC code convert unconditional jump to unconditional branch
ClosedPublic

Authored by atanasyan on Dec 6 2016, 1:51 PM.

Details

Summary

Unconditional branch uses relative addressing which is the right choice in case of position independent code.

This is a fix for the bug:
https://dmz-portal.mips.com/bugz/show_bug.cgi?id=2445

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 80477.Dec 6 2016, 1:51 PM
atanasyan retitled this revision from to [mips] For PIC code convert unconditional jump to unconditional branch.
atanasyan updated this object.
atanasyan added a reviewer: sdardis.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a subscriber: llvm-commits.
sdardis edited edge metadata.Dec 12 2016, 3:54 AM

LGTM with the nits addressed.

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
1791 ↗(On Diff #80477)

Nit: This comment should be before the "if ((Inst.getOpcode() == ..".

test/MC/Mips/expansion-j-sym-pic.s
2–8 ↗(On Diff #80477)

Tiny nit: the check prefix should be MIPS.

10–17 ↗(On Diff #80477)

Tiny nit: the check prefix should MM.

This revision was automatically updated to reflect the committed changes.