Bug 226849 - Air ARM64 sub32 opcode should indicate that it zero-extends its result
Summary: Air ARM64 sub32 opcode should indicate that it zero-extends its result
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yijia Huang
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-09 13:43 PDT by Saam Barati
Modified: 2021-06-11 11:28 PDT (History)
6 users (show)

See Also:


Attachments
Patch (232 bytes, patch)
2021-06-09 17:24 PDT, Yijia Huang
no flags Details | Formatted Diff | Diff
Patch (232 bytes, patch)
2021-06-09 17:42 PDT, Yijia Huang
no flags Details | Formatted Diff | Diff
Patch (548 bytes, patch)
2021-06-10 13:55 PDT, Yijia Huang
no flags Details | Formatted Diff | Diff
Patch (1.30 KB, patch)
2021-06-10 14:10 PDT, Yijia Huang
no flags Details | Formatted Diff | Diff
Patch (1.97 KB, patch)
2021-06-10 15:27 PDT, Yijia Huang
no flags Details | Formatted Diff | Diff
Patch (2.16 KB, patch)
2021-06-10 15:52 PDT, Yijia Huang
no flags Details | Formatted Diff | Diff
Patch (2.16 KB, patch)
2021-06-10 15:57 PDT, Yijia Huang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2021-06-09 13:43:10 PDT
...
Comment 1 Yijia Huang 2021-06-09 17:24:51 PDT
Created attachment 431030 [details]
Patch
Comment 2 Yijia Huang 2021-06-09 17:42:37 PDT
Created attachment 431034 [details]
Patch
Comment 3 Yijia Huang 2021-06-10 13:55:30 PDT
Created attachment 431124 [details]
Patch
Comment 4 Mark Lam 2021-06-10 14:09:30 PDT
Comment on attachment 431124 [details]
Patch

This patch needs a ChangeLog.
Comment 5 Yijia Huang 2021-06-10 14:10:10 PDT
Created attachment 431127 [details]
Patch
Comment 6 Mark Lam 2021-06-10 14:15:57 PDT
Comment on attachment 431127 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431127&action=review

> Source/JavaScriptCore/ChangeLog:8
> +        * b3/air/AirOpcode.opcodes: Zero def the destination of arm64 sub32 

This description is not accurate.  You're not defining the destination register as zero.  Instead, you're indicating that the opcode will zero extend the 32-bit result to full register length in the destination.

Please also fix the title accordingly.  Also to provide context for this patch, I indicate that this is in Air opcode.  For example, something like "Air ARM64 sub32 opcode should indicate that it zero-extends its result".
Comment 7 Yijia Huang 2021-06-10 15:27:54 PDT
Created attachment 431143 [details]
Patch
Comment 8 Saam Barati 2021-06-10 15:38:13 PDT
Comment on attachment 431143 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431143&action=review

> Source/JavaScriptCore/ChangeLog:9
> +        When the result of sub32 needs to be stored to a 64-sized register, 
> +        the current Air optimizer will generate an extra Move32 instruction.

I'd be more precise here. Maybe something like this:

"Sub32 was previously not saying that its result is zero defined. However, sub32 on arm64 architectures zero defines its result, so the top 32 bits are zeroed. The issue with this is what we were not eliding provably redundant zero extend operations."

> Source/JavaScriptCore/ChangeLog:19
> +        // Optimized Air IR

I'd say that this is the "Old optimized Air IR"

> Source/JavaScriptCore/ChangeLog:25
> +        To remove that redundant instruction (Move32), Air arm64 sub32 opcode 
> +        should indicate that it zero-extends its result.

"To remove that redundant instruction (Move32)" => "To remove that redundant zero extend instruction (Move32)"

> Source/JavaScriptCore/ChangeLog:26
> +

maybe also show what the new Optimized IR is here:

> Source/JavaScriptCore/ChangeLog:28
> +        * b3/air/AirOpcode.opcodes: Changed "D:G:32" to "ZD:G:32" in Air ARM64
> +        sub32 opcode.

No need for this here. We typically don't say "what" a patch does for a simple patch like this, since if you look at the file below, it already says that.
Comment 9 Yijia Huang 2021-06-10 15:52:53 PDT
Created attachment 431150 [details]
Patch
Comment 10 Yijia Huang 2021-06-10 15:57:30 PDT
Created attachment 431151 [details]
Patch
Comment 11 Saam Barati 2021-06-10 17:37:15 PDT
Comment on attachment 431151 [details]
Patch

NIce. r=me
Comment 12 EWS 2021-06-11 11:27:04 PDT
Committed r278769 (238728@main): <https://commits.webkit.org/238728@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431151 [details].
Comment 13 Radar WebKit Bug Importer 2021-06-11 11:28:20 PDT
<rdar://problem/79208100>