-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Reapply "Fold "X relop 0" in assertprop" (#110129) #110142
Conversation
This reverts commit da9381e.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
if (curAssertion->IsConstantInt32Assertion() && (curAssertion->op1.kind == O1K_LCLVAR) && | ||
(curAssertion->op1.vn == treeVN)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why must the first operand be a LCLVAR to allow using these assertions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakobbotsch because O1K_ARR_BND
is a weird assertion (when used with OAK_EQUAL/OAK_NOT_EQUAL
). See here
e.g. when we have if (arr.Length == 0)
we create an assertion op1 OAK_NOT_EQUAL 0
(inside true
edge). To be fair, I think this one should be removed completely and be replaced with O1K_LCLVAR
(not sure it works for trees not being GT_LCLVAR
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, I think this one should be removed completely
Yeah, it seems like it's just creating wrong assertions that the rest of assertion prop then needs to compensate for? Definitely looks odd that you have to dig into the operands and then the entire assertion changes meaning depending on what the first operand is.
/azp run runtime-coreclr libraries-pgo |
Azure Pipelines successfully started running 1 pipeline(s). |
This reverts commit da9381e.
The bug was in
optAssertionProp_RangeProperties
, when we checkFirst, analyze possible X ==/!= CNS assertions.
assertions we need to make sure it'sO1K_LCLVAR
assertion, not e.g.O1K_ARR_BND