PrincetonUniversity / cpf

Collaborative Parallelization Framework (CPF)
MIT License
31 stars 4 forks source link

Dealing with `availabe_external` linkage type #22

Open vgene opened 3 years ago

vgene commented 3 years ago

Overview

Some functions has available_external linkage type and with definition (instead of declaration) and SpecPriv will go inside and add profile calls. However, this functions will not be codegened since they are external library calls. The available_external allows inlining and other analysis/opts to know what’s inside.

Problem

SpecPriv doesn't understand this information and will try to modify the function by adding profiling calls (might applies to LAMP too). This is problematic because the instrumented code will be discarded during codegen.

@sapostolakis comments In terms of planning it might be also better to interpret the linkage type and if the function is pure/local/semi-local avoid going into it. For functions with cross-iter deps it should be profitable to go inside. In general, it might be useful to link all external functions with this linkage and have a unified approach that will justify better the use of profile-guided devirt that requires full visibility

Actions