This is an archive of the discontinued LLVM Phabricator instance.

[FuncSpec] Option for specializing const globals and function pointers.
AbandonedPublic

Authored by SjoerdMeijer on Jun 16 2021, 5:55 AM.

Details

Reviewers
ChuanqiXu
fhahn
Summary

In anticipation of D104365 that adds support for constant integers, this adds and option to enable specialisation for constant globals and function pointers. This more fine grain control may also be useful for testing.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Jun 16 2021, 5:55 AM
SjoerdMeijer requested review of this revision.Jun 16 2021, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2021, 5:55 AM
ormris removed a subscriber: ormris.Jun 16 2021, 11:47 AM
ChuanqiXu added inline comments.Jun 16 2021, 7:03 PM
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
488

When would V != A become false? It looks always true to me.

BTW, since !Solver.getLatticeValueFor(V).isConstant() would be true for normal constant, it wouldn't run into the following condition in my minds.

SjoerdMeijer abandoned this revision.Mar 17 2023, 1:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2023, 1:38 AM