Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Generate branchless IL for
(b ? 1 : 0)
#67191Generate branchless IL for
(b ? 1 : 0)
#67191Changes from 3 commits
26b944a
e2c3f4d
01f7f64
333d1aa
1fe26ef
87a5313
bb482c5
513097c
62cc9d9
50d7ae7
f5bda52
270c816
6344f0c
97e88fa
3f19b46
9bee6a7
3270493
853b7bf
49e600c
435381b
9c45b18
08e5bf0
3a4b3c4
4e09301
ff8b135
65e3db4
857b0c4
1f0cc3a
e9aca83
f2c8d13
be1432c
d202e2b
c3e6928
72b4890
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
nit: I don't love the single-letter variable names, but in this code it's not too bad (each is only used once). But consider naming this one
i
;-) #ClosedThere 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.
Correctness_Rebuild
fails with weird errors (AzDo build).It crashes with OOM (repeatedly - can even reproduce that locally).
Details:
Before it crashes,
BuildValidator.exe
also reports different IL after rebuild in test classes - seems exactly the test classes that this PR touches. Constants are emitted differently, I have no idea why.Details:
For example, in
PatternSwitchTests.DuplicateDouble
:In
AttributeTests.TestAttributesOnPropertyAndGetSet
: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.
Let me try debugging that this morning and see if I come up with anything.
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.
Okay I figured out the OOM issue. The OOM is coming from a call to
AllocHGlobal
deep inside thePEStream
loading code. The problem withAllocHGlobal
is that it's a native memory allocation function and hence doesn't represent any type of pressure to the GC. While we have memory available here, it's just not collected, there isn't enough to satisfy the 41MB request that happens because allocating native memory doesn't pressure the GC to do a collect.I believe this is happening in your case because the earlier failures in the execution cause more memory to get loaded (to dump XML, MDV, etc ...). That pushes us over the limit and causes a crash.
Short term I fixed this by just making the app run as 64 bit locally. Still looking at the actual errors.
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.
Pushed a test change to your PR and yes that fixed the issue. Will open a separate PR for that but will keep it here so it's not blocking you.
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.
Thanks for fixing the OOM. I see that the BuildValidator doesn't report any IL differences anymore - is that expected? I thought those two failures were unrelated, but maybe not.