aarch64: skip the extend of a scalar comparison's result - #14082
Open
fitzgen wants to merge 2 commits into
Open
Conversation
`icmp` and `fcmp` on scalars both lower through `lower_cond_result_bool`, whose every arm already clears upper bits, so extending it is a no-op. This removes ~18,000 `uxtb` instructions emitted from a PCA-based subset of Sightglass (this is ~87% of `uxtb` instructions emitted and 0.220% of *all* instructions emitted). It also results in an average 0.42% faster execution (significant) in terms of cycles.
Member
|
We've generally tried to avoid lowering rules like this historically where correctness relies on other lowering rules in the system, although we also have some already for x64 so it's not the most principled stance per se. I'd be surprised though if this uextend+icmp showed up too too often in terms of materializing the result of a comparison vs feeding the uextend+icmp into a branch/select/trap/etc. Is this perhaps something where we could get the lion's share of the benefit by shifting around these rules to where conditions are lowered or similar? |
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.
icmpandfcmpon scalars both lower throughlower_cond_result_bool, whose every arm already clears upper bits, so extending it is a no-op.This removes ~18,000
uxtbinstructions emitted from a PCA-based subset of Sightglass (this is ~87% ofuxtbinstructions emitted and 0.220% of all instructions emitted). It also results in an average 0.42% faster execution (significant) in terms of cycles.