This is an archive of the discontinued LLVM Phabricator instance.

AArch64: Use TTI branch functions in branch relaxation
ClosedPublic

Authored by arsenm on Sep 7 2016, 3:04 PM.

Details

Summary

The main change is to start optionally returning the change in code size from InsertBranch/RemoveBranch. Alternatively, the code size could be inferred from the number of instructions emitted with getInstSizeInBytes, however this doesn't work in the RemoveBranch case.

Patch mostly by Tim Northover

Diff Detail

Event Timeline

arsenm updated this revision to Diff 70608.Sep 7 2016, 3:04 PM
arsenm retitled this revision from to AArch64: Use TTI branch functions in branch relaxation.
arsenm updated this object.
arsenm added a reviewer: t.p.northover.
arsenm added a subscriber: llvm-commits.
rovka accepted this revision.Sep 14 2016, 4:44 AM
rovka added a reviewer: rovka.
rovka added a subscriber: rovka.

LGTM with minor nits.

include/llvm/Target/TargetInstrInfo.h
530

Since you're touching all of these, it might be a good time to fix them to follow the naming convention (removeBranch etc).

558

I think for the sake of consistency it would be nice for this to have an optional BytesAdded operand.

lib/Target/AArch64/AArch64BranchRelaxation.cpp
300

This sentence doesn't end right anymore.

This revision is now accepted and ready to land.Sep 14 2016, 4:44 AM
arsenm added inline comments.Sep 14 2016, 7:48 AM
include/llvm/Target/TargetInstrInfo.h
530

I thought about doing this, but then it would require touching all of the many other call sites in the one patch. I can do this in a follow up

arsenm closed this revision.Sep 14 2016, 10:33 AM

r281505-6