This is an archive of the discontinued LLVM Phabricator instance.

Use New Module Metadata String "AvoidPLT" to avoid calls via PLT
ClosedPublic

Authored by tmsriram on Jan 17 2018, 4:47 PM.

Details

Summary

Introduce a Module Metadata String "AvoidPLT" to avoid calls via PLT.

Annotating functions with nonlazybind attribute to avoid the PLT does not work for intrinsics. Intrinsics need to be handled specially and it seems easier to handle them by just annotating the module.

Diff Detail

Repository
rL LLVM

Event Timeline

tmsriram created this revision.Jan 17 2018, 4:47 PM
rnk added a comment.Jan 17 2018, 4:57 PM

AvoidPLT doesn't seem like the best name. A more affirmative name like "RtlibUseGOT" might be better.

lib/IR/Module.cpp
518 ↗(On Diff #130314)

Maybe this should check Val->getZExtValue for a non-zero value.

test/CodeGen/X86/no-plt.ll
14 ↗(On Diff #130314)

Can you test a few other RTLIB functions like i128 multiply and memset, just for generality?

tmsriram updated this revision to Diff 131514.Jan 25 2018, 2:57 PM

Rafael's change included and test case updated. "Avoid PLT" changed to "RtLibUseGOT".

tmsriram updated this revision to Diff 131853.Jan 29 2018, 12:32 PM

Updated to incorporate Rafael's changes.

tmsriram updated this revision to Diff 131876.Jan 29 2018, 2:26 PM

Updated patch.

tmsriram updated this revision to Diff 135114.Feb 20 2018, 11:28 AM

Patch updated.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 23 2018, 1:34 PM
This revision was automatically updated to reflect the committed changes.