Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[interp] Squash multiple call args moves into single opcode #52242

Merged
merged 3 commits into from
May 14, 2021

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented May 4, 2021

Plus a few other small optimizations

BrzVlad added 3 commits May 4, 2021 15:05
Some vars cannot be used directly as an argument to another call. In this case, the var offset allocator generates new intermediary vars. For methods with a lot of parameters, we can end up with quite a lot of these stores.

As an example, for the following method:
```
public static void MethodPartial (int a, int b, object c, object d)
{
	MethodFull (a, b, c, d, 12523);
}
```

Before:
```
IR_0000: ldc.i8         [72 <- nil], 12523
IR_0006: mov.4          [40 <- 0],
IR_0009: mov.4          [48 <- 8],
IR_000c: mov.8          [56 <- 16],
IR_000f: mov.8          [64 <- 24],
IR_0012: call           [32 <- 40], 0
IR_0016: ret.void       [nil <- nil],
```

After:
```
IR_0000: ldc.i8         [72 <- nil], 12523
IR_0006: mov.8.4        [nil <- nil], 40 <- 0, 48 <- 8, 56 <- 16, 64 <- 24
IR_000f: call           [32 <- 40], 0
IR_0013: ret.void       [nil <- nil]
```
@ghost
Copy link

ghost commented May 4, 2021

Tagging subscribers to this area: @BrzVlad
See info in area-owners.md if you want to be subscribed.

Issue Details

Plus a few other small optimizations

Author: BrzVlad
Assignees: -
Labels:

area-Codegen-Interpreter-mono

Milestone: -

@BrzVlad BrzVlad merged commit 49eef91 into dotnet:main May 14, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants