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

Split states for is not patterns #52205

Closed
wants to merge 11 commits into from
Closed

Split states for is not patterns #52205

wants to merge 11 commits into from

Conversation

alrz
Copy link
Member

@alrz alrz commented Mar 28, 2021

Follow-up on #49369

See #49369 (comment)

@alrz alrz requested a review from a team as a code owner March 28, 2021 13:05
@@ -52,55 +52,47 @@ private BoundExpression BindIsPatternExpression(IsPatternExpressionSyntax node,
// Note that these labels are for the convenience of the compilation of patterns, and are not necessarily emitted into the lowered code.
LabelSymbol whenTrueLabel = new GeneratedLabelSymbol("isPatternSuccess");
LabelSymbol whenFalseLabel = new GeneratedLabelSymbol("isPatternFailure");

bool negated = pattern.IsNegated(out var innerPattern);
BoundDecisionDag decisionDag = DecisionDagBuilder.CreateDecisionDagForIsPattern(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is simply reverted to the state before #49369

@alrz alrz requested a review from cston March 28, 2021 13:07
@alrz alrz marked this pull request as draft March 28, 2021 23:33
Comment on lines +1374 to +1377
<!--
Required is true when bindings are used in the opposite branch and cannot be optimized away.
-->
<Field Name="Required" Type="bool"/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to need this for or pattern bindings when we split state for those as well.

Comment on lines 6541 to +6542
[InlineData("!(o is (41 or 42))")]
[InlineData("o is not (41 or 42)")]
public void IsNot_11(string pattern)
public void IsNot_11a(string pattern)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for different codegen is that for some of tests we actually use linear lowering.

Previously we did non-linear lowering for both cases.

@alrz alrz marked this pull request as ready for review March 29, 2021 03:47
@alrz
Copy link
Member Author

alrz commented Mar 29, 2021

@cston Can you please take a look, thanks.

@alrz
Copy link
Member Author

alrz commented Mar 29, 2021

On the second thought, this isn't necessary right now and can be done as part of dotnet/csharplang#4592 later.

@alrz alrz closed this Mar 29, 2021
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.

1 participant