-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[SLP] Fix cost estimation of external uses with wrong VF #148185
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 |
---|---|---|
|
@@ -31,3 +31,34 @@ define void @test() { | |
store double %res4, ptr getelementptr inbounds ([8 x double], ptr @dst, i32 0, i64 3), align 8 | ||
ret void | ||
} | ||
|
||
; Same as above, but %a7 is also used as a scalar and must be extracted from | ||
; the wide load. (Or in this case, kept as a scalar load). | ||
define double @test_with_extract() { | ||
; CHECK-LABEL: @test_with_extract( | ||
; CHECK-NEXT: [[TMP1:%.*]] = load <8 x double>, ptr @src, align 8 | ||
; CHECK-NEXT: [[A7:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 7), align 8 | ||
|
||
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <8 x double> [[TMP1]], <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> | ||
; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <8 x double> [[TMP1]], <8 x double> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> | ||
; CHECK-NEXT: [[TMP4:%.*]] = fsub fast <4 x double> [[TMP2]], [[TMP3]] | ||
; CHECK-NEXT: store <4 x double> [[TMP4]], ptr @dst, align 8 | ||
; CHECK-NEXT: ret double [[A7]] | ||
; | ||
%a0 = load double, ptr @src, align 8 | ||
%a1 = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 1), align 8 | ||
%a2 = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 2), align 8 | ||
%a3 = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 3), align 8 | ||
%a4 = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 4), align 8 | ||
%a5 = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 5), align 8 | ||
%a6 = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 6), align 8 | ||
%a7 = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 7), align 8 | ||
%res1 = fsub fast double %a0, %a1 | ||
%res2 = fsub fast double %a2, %a3 | ||
%res3 = fsub fast double %a4, %a5 | ||
%res4 = fsub fast double %a6, %a7 | ||
store double %res1, ptr @dst, align 8 | ||
store double %res2, ptr getelementptr inbounds ([8 x double], ptr @dst, i32 0, i64 1), align 8 | ||
store double %res3, ptr getelementptr inbounds ([8 x double], ptr @dst, i32 0, i64 2), align 8 | ||
store double %res4, ptr getelementptr inbounds ([8 x double], ptr @dst, i32 0, i64 3), align 8 | ||
ret double %a7 | ||
} |
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.
Hi @gbossu
I've seen these new debug printouts crash here when "EU.User" is null.
Unfortunately I don't have a reproducer to share.
Should this never happen or should the debug printout be fixed?
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.
And now I realize that it's been fixed already in 4784ce9. Thanks @alexey-bataev
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.
When I wrote that code, I was under the impression that
EU.User
cannot be null, because well, it's an external use we have identified and we want to cost. It also triggered no test failure, so I guess we are lacking some coverage. But looking at the code gathering external users, it is obvious thatEU.User
is sometimes set tonullptr
. My bad. And thanks Alexey for fixing this quickly.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 no tests for debug messages (do not mess with remarks, they are tested), we never actually tested it