This is an archive of the discontinued LLVM Phabricator instance.

[mips] Compact branch policy control for MIPSR6
ClosedPublic

Authored by sdardis on May 11 2016, 6:36 AM.

Details

Reviewers
dsanders
Summary

This patch adds the commandline option -mips-compact-branches={never,optimal,always),
which controls how LLVM generates compact branches for MIPS targets. By
default, the compact branch policy is 'optimal' where LLVM will (hopefully)
pick the optimal branch for any situation. The 'never' policy will disable
the generation of compact branches and 'always' will generate compact branches
wherever possible.

Diff Detail

Event Timeline

sdardis updated this revision to Diff 56900.May 11 2016, 6:36 AM
sdardis retitled this revision from to [mips] Compact branch policy control for MIPSR6.
sdardis updated this object.
sdardis set the repository for this revision to rL LLVM.
sdardis added subscribers: llvm-commits, vkalintiris.
dsanders accepted this revision.May 16 2016, 7:06 AM
dsanders added a reviewer: dsanders.

LGTM with a couple nits

lib/Target/Mips/MipsDelaySlotFiller.cpp
66–68

We should mention that never/always aren't absolute in a doxygen comment.

Also an optional nit: We don't have any rules about it but most enumerators seem to separate the prefix from the name using an underscore (e.g. 'CB_Never')

test/CodeGen/Mips/compactbranches/compact-branch-policy.ll
13

Could you add a comment indicating why the ALWAYS case has one?

This revision is now accepted and ready to land.May 16 2016, 7:06 AM
sdardis closed this revision.May 17 2016, 3:28 AM

Thanks, committed as rL269753.