-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[X86] Attempt to canonicalize vXf64 SHUFPD shuffle masks with undef elts to improve further folding #116419
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
[X86] Attempt to canonicalize vXf64 SHUFPD shuffle masks with undef elts to improve further folding #116419
Changes from all commits
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 |
---|---|---|
|
@@ -1667,13 +1667,13 @@ define <8 x float> @broadcast_v8f32_v2f32_u1uu0uEu(ptr %vp, <8 x float> %default | |
; X86: # %bb.0: | ||
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax | ||
; X86-NEXT: vbroadcastsd (%eax), %ymm1 | ||
; X86-NEXT: vshufpd {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[2],ymm0[3] | ||
; X86-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[3],ymm0[3] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uops shows the TP of vunpckhpd is worse than vshufpd. Is this expected? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, it's only for Alder Lake-P. But others like SKX, ZEN4 don't have difference between both. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC X86FixupInstTunings should handle these cases for us based off the sched models - CC @goldsteinn |
||
; X86-NEXT: retl | ||
; | ||
; X64-LABEL: broadcast_v8f32_v2f32_u1uu0uEu: | ||
; X64: # %bb.0: | ||
; X64-NEXT: vbroadcastsd (%rdi), %ymm1 | ||
; X64-NEXT: vshufpd {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[2],ymm0[3] | ||
; X64-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[3],ymm0[3] | ||
; X64-NEXT: retq | ||
%vec = load <2 x float>, ptr %vp | ||
%shuf = shufflevector <2 x float> %vec, <2 x float> undef, <8 x i32> <i32 undef, i32 1, i32 undef, i32 undef, i32 0, i32 2, i32 3, i32 undef> | ||
|
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.
There's no further folding showing in test cases. Does it need a follow up patch?
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.
There are a number of test cases which now further fold to
VBLENDPD/S
(allowing commutation yay!) orVUNPCK?PD
- the only further fold that leads to an actual instruction reduction so far is theadd_v4f64_024u_135u_reverse
test in vector-shuffle-256-v4.ll