-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[DAGCombiner] Enable constant folding of (bitcast int_c0) -> fp_c0 #82289
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 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 |
|---|---|---|
|
|
@@ -320,7 +320,8 @@ define <3 x double> @extvselectsetcc_crash(<2 x double> %x) { | |
| ; X64-LABEL: extvselectsetcc_crash: | ||
| ; X64: # %bb.0: | ||
| ; X64-NEXT: vcmpeqpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1 | ||
| ; X64-NEXT: vmovsd {{.*#+}} xmm2 = [1.0E+0,0.0E+0] | ||
| ; X64-NEXT: movabsq $4607182418800017408, %rax # imm = 0x3FF0000000000000 | ||
|
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. I'm not an expert on X86 assembly, but this test change and the one above seem to produce more instructions so is that a regression?
Contributor
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. Its an optimization to save a load, I'm not 100% sure if the optimization is sound, but think it should be addressed there not here.
Collaborator
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. vector loads vs rematerialization vs scalar constants has never been ideal on x86 |
||
| ; X64-NEXT: vmovq %rax, %xmm2 | ||
| ; X64-NEXT: vandpd %xmm2, %xmm1, %xmm1 | ||
| ; X64-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0 | ||
| ; X64-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,3,3] | ||
|
|
||
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.
This TODO can be removed I guess - did you investigate the history behind this?
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.
https://reviews.llvm.org/D58884, adding what I think is the necessary check.
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.
AFAICT, the intermediate types for the
floatversion are just integers, so if we are allowing integers seems the same as allowing FP. @topperc any reason this is buggy?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.
@topperc any comment?