Skip to content

[Maintenance]: Callgraph does not record indirect calls #2282

Description

@acl-cqc

Description

When we find a call to an unknown runtime value with a FunctionType, we conservatively record effects (i.e. Effect.ANY):

if isinstance(func_ty, FunctionType):
args, subst, inst = check_call(func_ty, node.args, ty, node, self.ctx, None)
register_effects(self.ctx, [Effect.ANY]) # worst-case safe approximation

if isinstance(ty, FunctionType):
args, return_ty, inst = synthesize_call(ty, node.args, node, self.ctx, None)
register_effects(self.ctx, [Effect.ANY]) # worst-case safe approximation

...but we should also (or instead) record that such a call exists in the callgraph itself, so that any other analysis using the callgraph knows that the results of analysing that function may be unsound.

At first this can just be a bool flag "makes indirect calls", but we might refine this with more information later.
(We could make effects analysis use this flag too, avoiding the need to record the effects of the indirect call separately.)

2 * function-tensor calls similarly.

Motivation

No response

Scope

No response

Component

No response

Priority

None

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-maintenanceCategory: Non-public maintenance tasksS-needs-triageStatus: Needs to be labelled

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions