-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[IR] Allow fast math flags on calls with homogeneous FP struct types #110506
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
328357f
6881540
5cc741f
8d3353c
04b7d82
77479c6
1869ca2
6bfe0bc
98bd284
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1122,6 +1122,26 @@ define void @fastMathFlagsForArrayCalls([2 x float] %f, [2 x double] %d1, [2 x < | |
ret void | ||
} | ||
|
||
declare { float, float } @fmf_struct_f32() | ||
declare { double, double, double } @fmf_struct_f64() | ||
declare { <4 x double> } @fmf_struct_v4f64() | ||
|
||
; CHECK-LABEL: fastMathFlagsForStructCalls( | ||
define void @fastMathFlagsForStructCalls() { | ||
%call.fast = call fast { float, float } @fmf_struct_f32() | ||
; CHECK: %call.fast = call fast { float, float } @fmf_struct_f32() | ||
|
||
; Throw in some other attributes to make sure those stay in the right places. | ||
|
||
%call.nsz.arcp = notail call nsz arcp { double, double, double } @fmf_struct_f64() | ||
; CHECK: %call.nsz.arcp = notail call nsz arcp { double, double, double } @fmf_struct_f64() | ||
|
||
%call.nnan.ninf = tail call nnan ninf fastcc { <4 x double> } @fmf_struct_v4f64() | ||
; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc { <4 x double> } @fmf_struct_v4f64() | ||
|
||
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. What about struct of array? 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 can add a test, but it's not a supported case (as I don't currently see a need for it). 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. Can you also add a test with nofpclass attributes on the return / argument? The intent was it would be allowed for the same types as FPMathOperator 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.
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. Either way |
||
ret void | ||
} | ||
|
||
;; Type System | ||
%opaquety = type opaque | ||
define void @typesystem() { | ||
|
@@ -2077,9 +2097,14 @@ declare nofpclass(sub zero) float @nofpclass_sub_zero(float nofpclass(sub zero)) | |
; CHECK: declare nofpclass(inf sub) float @nofpclass_sub_inf(float nofpclass(inf sub)) | ||
declare nofpclass(sub inf) float @nofpclass_sub_inf(float nofpclass(sub inf)) | ||
|
||
; CHECK: declare nofpclass(nan) { float, float } @nofpclass_struct({ double } nofpclass(nan)) | ||
declare nofpclass(nan) { float, float } @nofpclass_struct({ double } nofpclass(nan)) | ||
|
||
declare float @unknown_fpclass_func(float) | ||
|
||
define float @nofpclass_callsites(float %arg) { | ||
declare { <4 x double>, <4 x double>, <4 x double> } @unknown_fpclass_struct_func({ float }) | ||
|
||
define float @nofpclass_callsites(float %arg, { float } %arg1) { | ||
; CHECK: %call0 = call nofpclass(nan) float @unknown_fpclass_func(float nofpclass(ninf) %arg) | ||
%call0 = call nofpclass(nan) float @unknown_fpclass_func(float nofpclass(ninf) %arg) | ||
|
||
|
@@ -2088,6 +2113,10 @@ define float @nofpclass_callsites(float %arg) { | |
|
||
; CHECK: %call2 = call nofpclass(zero) float @unknown_fpclass_func(float nofpclass(norm) %arg) | ||
%call2 = call nofpclass(zero) float @unknown_fpclass_func(float nofpclass(norm) %arg) | ||
|
||
; CHECK: %call3 = call nofpclass(pinf) { <4 x double>, <4 x double>, <4 x double> } @unknown_fpclass_struct_func({ float } nofpclass(all) %arg1) | ||
%call3 = call nofpclass(pinf) { <4 x double>, <4 x double>, <4 x double> } @unknown_fpclass_struct_func({ float } nofpclass(all) %arg1) | ||
|
||
%add0 = fadd float %call0, %call1 | ||
%add1 = fadd float %add0, %call2 | ||
ret float %add1 | ||
|
Uh oh!
There was an error while loading. Please reload this page.