Skip to content

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]
```
@BrzVlad BrzVlad requested a review from vargaz as a code owner May 4, 2021 12:14
@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