Skip to content

Fix constant prop around intrinsic#1749

Merged
vitek-karas merged 3 commits intodotnet:masterfrom
vitek-karas:FixConstantPropAroundIntrinsics
Jan 13, 2021
Merged

Fix constant prop around intrinsic#1749
vitek-karas merged 3 commits intodotnet:masterfrom
vitek-karas:FixConstantPropAroundIntrinsics

Conversation

@vitek-karas
Copy link
Member

In #1734 a change was made that substitutions are only considered for methods which are not intrinsic or no-inline. That is not how it should work, even intrinsic or no-inline methods should still allow substitutions and constant propagation from those.

What intrinsic and no-inline methods should not do is participate in constant propagation as intermediate methods (so methods which become constant because they're calling other constant methods).

In short substitutions effectively override the intrinsic/no-inline.

Added test cases.

Fixes #1747

In dotnet#1734 a change was made that substitutions are only considered for methods which are not instrinsic or no-inline. That is not how it should work, even intrinsic or no-inline methods should still allow substitutions and constant propagation from those.

What instrinsic and no-inline methods should not do is participate in constant propagation as intermediate methods (so methods which become constant because they're calling other constant methods).

In short substitutions effectively override the intrinsic/no-inline.

Added test cases.
Also added a test to cover this
@vitek-karas vitek-karas added this to the .NET 6.0 milestone Jan 13, 2021
@vitek-karas vitek-karas self-assigned this Jan 13, 2021
@vitek-karas vitek-karas merged commit fc8abef into dotnet:master Jan 13, 2021
@vitek-karas vitek-karas deleted the FixConstantPropAroundIntrinsics branch March 13, 2021 21:50
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
In dotnet/linker#1734 a change was made that substitutions are only considered for methods which are not intrinsic or no-inline. That is not how it should work, even intrinsic or no-inline methods should still allow substitutions and constant propagation from those.

What intrinsic and no-inline methods should not do is participate in constant propagation as intermediate methods (so methods which become constant because they're calling other constant methods).

In short substitutions effectively override the intrinsic/no-inline.

Added test cases.

Fixes dotnet/linker#1747

Commit migrated from dotnet/linker@fc8abef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IsDynamicCodeCompiled path no longer being trimmed in 6.0.100-alpha.1.21062.9

2 participants