Repository navigation
ARM64: Fold shifted extensions into arithmetic and comparisons - #136715
NinoFloris wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 7 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. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
The two failing checks are from infra failures. Could somebody retry them? |
|
@NinoFloris failures look legitimate and are in the arm64 legs:
|
|
I see now, I needed to click through a few more times to get to the actual logs. On first sight it looks like infra failed to complete a job. Investigating. |
5055bbb to
25afb41
Compare
|
This was fixed in #136642. Rebased run should go green now. |
tannergooding
left a comment
There was a problem hiding this comment.
value == -((long)index << 2) could also do with a similar optimization for CMN which also looks to be missing similar handling.
|
Thanks @tannergooding. CMN looks to be a bit more involved to recognize, and I expect it won't have many hits. If you're interested I can make an attempt in a follow-up, otherwise I'll leave it for now. |
|
I'm fine with it being separate (and think it's probably better if it is). |
|
Yeah I do mean as a follow-up PR. Just asking if you'd be up for reviewing it. |
|
@dhartglassMSFT PTAL |
ARM64 can combine a sign/zero extension and a small left shift into an arithmetic or comparison instruction. The JIT already recognizes the combined expression as GT_BFIZ, but does not fold it into these consumers.
For example the single argument
Span<int>.Slice(start)currently computes its address with:This change allows:
Extend the existing cast-containment path to handle shifted extensions in ADD, SUB, and CMP, including flag-setting forms. This removes separate UBFIZ/SBFIZ instructions while retaining the existing overflow and evaluation-order restrictions.
@jonathandavies-arm