Repository navigation
Conversation
|
Azure Pipelines: Successfully started running 8 pipeline(s). 8 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Member
Author
This was referenced Oct 13, 2026
Closed
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #135647
Adding or subtracting a compare result currently materializes it with
setcc/csetbefore the add/sub. Use the flags set by the comparedirectly instead:
a == 0anda != 0are handled asa <u 1anda >=u 1, anda <=u c/a >u casa <u c+1/a >=u c+1. An added constant,x +/- (cond + k), is folded into the carry op's immediate where thetarget has one (xarch, arm32). This does not rely on bools being
normalized to 0/1, so for example
num - (r ? 0 : 1)becomescmp r, 1; sbb num, 0on x64.GT_ADD_HI/GT_SUB_HI, previously only defined for long decompositionon 32-bit targets, are now defined for all targets, like the other
flags consuming nodes (
GT_JCC,GT_SETCC,GT_SELECTCC). Thetransformation lives in common lowering (
TryLowerAddSubOfCompare);each target's
TryGetCarryOpdecides which add/subtract with carry, ifany, computes the result:
adcadds the borrow andsbbsubtracts it, any constant.adcadds the carry (the inverse of the borrow) andsbcsubtracts the borrow; arm64 has no immediate form, so onlywithout a constant. Remaining additions on arm64 use
cinc(
TryLowerAddOfCompareToCinc), which works for any condition.Diffs
SuperPMI asmdiffs on the
benchmarkscollections:num - (r ? 0 : 1):Note
This description was generated with AI assistance.