You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[OpenMP] Delay more diagnostics of potentially non-emitted code
Even code in target and declare target regions might not be emitted.
With this patch we delay more diagnostics and use laziness and linkage
to determine if a function is emitted (for the device). Note that we
still eagerly emit diagnostics for target regions, unfortunately, see
the TODO for the reason.
This hopefully fixes PR48933.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D95928
// expected-error@+1 {{'ld_arg1a' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
109
103
voidld_arg1a(longdouble ld) {}
110
104
111
-
// TODO: We should diagnose the return type and argument type here.
112
105
typedeflongdouble ld_ty;
113
106
// expected-note@+2 {{'ld_return1b' defined here}}
114
107
// expected-error@+1 {{'ld_return1b' requires 128 bit size 'ld_ty' (aka 'long double') type support, but device 'nvptx64-unknown-unknown' does not support it}}
// expected-error@+1 {{'ld_arg1b' requires 128 bit size 'ld_ty' (aka 'long double') type support, but device 'nvptx64-unknown-unknown' does not support it}}
118
111
voidld_arg1b(ld_ty ld) {}
119
112
120
-
// TODO: These errors should not be emitted.
121
-
// expected-note@+2 {{'ld_return1c' defined here}}
122
-
// expected-error@+1 {{'ld_return1c' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
123
113
staticlongdoubleld_return1c() { return0; }
124
-
// expected-note@+2 {{'ld_arg1c' defined here}}
125
-
// expected-error@+1 {{'ld_arg1c' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
126
114
staticvoidld_arg1c(longdouble ld) {}
127
115
128
-
// TODO: These errors should not be emitted.
129
-
// expected-note@+2 {{'ld_return1d' defined here}}
130
-
// expected-error@+1 {{'ld_return1d' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
131
116
inlinelongdoubleld_return1d() { return0; }
132
-
// expected-note@+2 {{'ld_arg1d' defined here}}
133
-
// expected-error@+1 {{'ld_arg1d' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
134
117
inlinevoidld_arg1d(longdouble ld) {}
135
118
136
-
// expected-error@+2 {{'ld_return1e' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
137
119
// expected-note@+1 {{'ld_return1e' defined here}}
138
120
staticlongdoubleld_return1e() { return0; }
139
-
// expected-error@+2 {{'ld_arg1e' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
140
121
// expected-note@+1 {{'ld_arg1e' defined here}}
141
122
staticvoidld_arg1e(longdouble ld) {}
142
123
143
-
// expected-error@+2 {{'ld_return1f' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
144
124
// expected-note@+1 {{'ld_return1f' defined here}}
145
125
inlinelongdoubleld_return1f() { return0; }
146
-
// expected-error@+2 {{'ld_arg1f' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
147
126
// expected-note@+1 {{'ld_arg1f' defined here}}
148
127
inlinevoidld_arg1f(longdouble ld) {}
149
128
150
129
inlinevoidld_use1() {
151
-
// expected-note@+1 {{'ld' defined here}}
152
130
longdouble ld = 0;
153
-
// TODO: We should not diagnose this as the function is dead.
154
-
// expected-error@+1 {{'ld' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
155
131
ld += 1;
156
132
}
157
133
staticvoidld_use2() {
158
-
// expected-note@+1 {{'ld' defined here}}
159
134
longdouble ld = 0;
160
-
// TODO: We should not diagnose this as the function is dead.
161
-
// expected-error@+1 {{'ld' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
162
135
ld += 1;
163
136
}
164
137
@@ -176,11 +149,18 @@ static void ld_use4() {
176
149
}
177
150
178
151
voidexternal() {
152
+
// expected-error@+1 {{'ld_return1e' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
179
153
void *p1 = reinterpret_cast<void*>(&ld_return1e);
154
+
// expected-error@+1 {{'ld_arg1e' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
180
155
void *p2 = reinterpret_cast<void*>(&ld_arg1e);
156
+
// expected-error@+1 {{'ld_return1f' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
181
157
void *p3 = reinterpret_cast<void*>(&ld_return1f);
158
+
// expected-error@+1 {{'ld_arg1f' requires 128 bit size 'long double' type support, but device 'nvptx64-unknown-unknown' does not support it}}
182
159
void *p4 = reinterpret_cast<void*>(&ld_arg1f);
160
+
// TODO: The error message "called by" is not great.
0 commit comments