Skip to content

Remove unused functions made redundant by optimizer #192

@y1yang0

Description

@y1yang0

Currently, optimize.go implements three types of optimizations. After these optimizations are applied, some functions may become redundant and can be removed.

For instance, consider the following optimization:

	if ctx, skip := otel_trampoline_before(&arg); skip {
	    otel_trampoline_after(ctx, &retval)
	    return ...
	} else {
	    ;
	    ...
	}
=>
	if false {
	    ;
	} else {
	    defer otel_trampoline_after(&HookContext{...}, &retval)
	    ...
	}

As a result of this transformation, the otel_trampoline_before function is no longer called, allowing us to remove its definition entirely.

In addition to this case, the other two optimizations can create similar opportunities for dead code elimination. This helps to reduce the final binary size and improve instruction cache performance.

Metadata

Metadata

Assignees

Labels

availableWelcome to claim it and implement iteffort:lowLow effort to accomplish it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions