-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[X86] SimplifyDemandedBitsForTargetNode - add handling for X86ISD::FAND/FOR #136618
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -252,28 +252,22 @@ define double @PR136368(double %x) { | |
| ; SSE-LABEL: PR136368: | ||
| ; SSE: # %bb.0: | ||
| ; SSE-NEXT: movapd {{.*#+}} xmm1 = [NaN,NaN] | ||
| ; SSE-NEXT: movapd %xmm0, %xmm2 | ||
| ; SSE-NEXT: andpd %xmm1, %xmm2 | ||
| ; SSE-NEXT: movsd {{.*#+}} xmm3 = [1.5707963267948966E+0,0.0E+0] | ||
| ; SSE-NEXT: movapd %xmm3, %xmm4 | ||
| ; SSE-NEXT: cmpltsd %xmm2, %xmm4 | ||
| ; SSE-NEXT: andpd %xmm3, %xmm4 | ||
| ; SSE-NEXT: andpd %xmm1, %xmm4 | ||
| ; SSE-NEXT: andnpd %xmm0, %xmm1 | ||
| ; SSE-NEXT: orpd %xmm4, %xmm1 | ||
| ; SSE-NEXT: movapd %xmm1, %xmm0 | ||
| ; SSE-NEXT: andpd %xmm0, %xmm1 | ||
| ; SSE-NEXT: movsd {{.*#+}} xmm2 = [1.5707963267948966E+0,0.0E+0] | ||
| ; SSE-NEXT: movapd %xmm2, %xmm3 | ||
| ; SSE-NEXT: cmpltsd %xmm1, %xmm3 | ||
| ; SSE-NEXT: andpd %xmm2, %xmm3 | ||
| ; SSE-NEXT: andpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 | ||
|
Contributor
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. We are loading extra 128-bit constant?
Collaborator
Author
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. yes - its not a bitselect pattern so canonicalizeBitSelect doesn't match, we just happen to have 0x80...0 and 0x7f...f in codegen.
Contributor
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. This doesn't look good. We just reducing one |
||
| ; SSE-NEXT: orpd %xmm3, %xmm0 | ||
| ; SSE-NEXT: retq | ||
| ; | ||
| ; AVX-LABEL: PR136368: | ||
| ; AVX: # %bb.0: | ||
| ; AVX-NEXT: vmovddup {{.*#+}} xmm1 = [NaN,NaN] | ||
| ; AVX-NEXT: # xmm1 = mem[0,0] | ||
| ; AVX-NEXT: vandpd %xmm1, %xmm0, %xmm2 | ||
| ; AVX-NEXT: vmovsd {{.*#+}} xmm3 = [1.5707963267948966E+0,0.0E+0] | ||
| ; AVX-NEXT: vcmpltsd %xmm2, %xmm3, %xmm2 | ||
| ; AVX-NEXT: vandpd %xmm3, %xmm2, %xmm2 | ||
| ; AVX-NEXT: vandnpd %xmm0, %xmm1, %xmm0 | ||
| ; AVX-NEXT: vandpd %xmm1, %xmm2, %xmm1 | ||
| ; AVX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1 | ||
| ; AVX-NEXT: vmovsd {{.*#+}} xmm2 = [1.5707963267948966E+0,0.0E+0] | ||
| ; AVX-NEXT: vcmpltsd %xmm1, %xmm2, %xmm1 | ||
| ; AVX-NEXT: vandpd %xmm2, %xmm1, %xmm1 | ||
| ; AVX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 | ||
| ; AVX-NEXT: vorpd %xmm0, %xmm1, %xmm0 | ||
| ; AVX-NEXT: retq | ||
| %fabs = tail call double @llvm.fabs.f64(double %x) | ||
|
|
||
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 there's no X86ISD::AND/OR in this function?
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.
X86ISD::AND/OR are scalar (RESULT,EFLAGS) nodes - not relevant to this (I'm not sure we have any tests that need them yet either).