This is an archive of the discontinued LLVM Phabricator instance.

[cfi] Avoid branch veneers in jump tables when possible.
ClosedPublic

Authored by eugenis on Aug 25 2017, 5:56 PM.

Details

Summary

When jumptable encoding does not match target code encoding (arm vs
thumb), a veneer is inserted by the linker. We can not avoid this
in all cases, because entries within one jumptable must have the same
encoding, but we can make it less common by selecting the jumptable
encoding to match the majority of its targets.

This change only covers FullLTO, and not ThinLTO.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis created this revision.Aug 25 2017, 5:56 PM
pcc added inline comments.Aug 25 2017, 6:20 PM
llvm/lib/Transforms/IPO/LowerTypeTests.cpp
1121 ↗(On Diff #112769)

It seems arbitrary for the module architecture to be the tie breaker. With full LTO I think it will just be the same architecture as the first (or maybe last?) input file. I'd remove this part.

eugenis updated this revision to Diff 112924.Aug 28 2017, 11:30 AM

addressed pcc's comment

eugenis marked an inline comment as done.Aug 28 2017, 11:30 AM
eugenis updated this revision to Diff 112939.Aug 28 2017, 12:42 PM

update the test

pcc accepted this revision.Aug 28 2017, 12:50 PM

LGTM

This revision is now accepted and ready to land.Aug 28 2017, 12:50 PM
This revision was automatically updated to reflect the committed changes.