-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT ARM64-SVE: Allow LCL_VARs to store as mask #99608
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
Changes from 5 commits
6628904
ed574f9
02fa227
2e2e174
fcdb18a
687af37
1fc8d5b
9dbfe63
85f09bf
7945d51
bd5d951
ce61a40
b5502a6
39c02d0
d8dea0e
8ec8e38
3ec441c
f569512
0110170
ec05e34
71bcb48
24cd68b
5b995ae
3a82d5d
8baee38
b22755a
bd8db6e
e359c93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6419,6 +6419,17 @@ void Compiler::impImportBlockCode(BasicBlock* block) | |
| impSpillSideEffects(false, CHECK_SPILL_ALL DEBUGARG("Spill before store to pinned local")); | ||
| } | ||
|
|
||
| #if defined(TARGET_ARM64) && defined(FEATURE_MASKED_HW_INTRINSICS) | ||
| // Masks must be converted to vectors before being stored to memory. | ||
| // But, for local stores we can optimise away the conversion | ||
| if (op1->OperIsHWIntrinsic() && op1->AsHWIntrinsic()->GetHWIntrinsicId() == NI_Sve_ConvertMaskToVector) | ||
a74nh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| op1 = op1->AsHWIntrinsic()->Op(1); | ||
| lvaTable[lclNum].lvType = TYP_MASK; | ||
|
||
| lclTyp = lvaGetActualType(lclNum); | ||
| } | ||
|
||
| #endif // TARGET_ARM64 && FEATURE_MASKED_HW_INTRINSICS | ||
|
|
||
| op1 = gtNewStoreLclVarNode(lclNum, op1); | ||
|
|
||
| // TODO-ASG: delete this zero-diff quirk. Requires some forward substitution work. | ||
|
|
||
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.
Why does this pass down
UNPREDICATEDrather than doing the inverse?That is, I imagine most instructions we encounter will end up unpredicated (or effectively unpredicated by using a
TrueMask), so I'd expect we end up with overall less checks if we simply saidif (varTypeUsesMaskReg(targetType)) { insOpts |= INS_SCALABLE_OPTS_PREDICATED; }Otherwise, we end up having to special case every single instruction that has a predicated and unpredicated form and additionally check if they use a mask register or not.
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.
That's because the emit function is inconveniently the wrong way around. I was going to fix the emit function up in this PR, but, once register allocation is working we can get rid the enum and get rid of all these checks.
Given the register allocation work is going to take some time, then maybe I should fix up the emit code in this PR.
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.
Sounds good to me. Just wanted to get clarification as it did seem backwards
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.
Switched this around. It no longer matches some of the other emit_R_R_etc functions, but that's ok because it'll all vanish eventually.