Skip to content

Commit d6cbc1a

Browse files
committed
Add a compatibility feature to suppress WLOGMIXUP
1 parent c3171ad commit d6cbc1a

File tree

9 files changed

+67
-6
lines changed

9 files changed

+67
-6
lines changed

RELEASENOTES.docu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,5 +1797,9 @@ extern typedef struct { } my_type_t;</pre> </add-note></build-id>
17971797
for the identifier <bug number="SIMICS-22472"/>.</add-note></build-id>
17981798
<build-id _6="next" _7="next"><add-note> Added the warning <tt>WBIGUNROLL</tt>
17991799
which is emitted when a <tt>#select</tt> or <tt>#foreach</tt> statement is
1800-
compiled to a large unrolled loop.</add-note></build-id>
1800+
compiled to a large unrolled loop.
1801+
This warning is only enabled by default with Simics API version 8 or
1802+
above. With version 7 and below it must be explicitly enabledby passing
1803+
either <tt>--no-compat=suppress_WBIGUNROLL</tt> or
1804+
<tt>--warn=WBIGUNROLL</tt> to DMLC.</add-note></build-id>
18011805
</rn>

lib/1.2/dml-builtins.dml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ template device {
215215
parameter _compat_io_memory auto;
216216
parameter _compat_shared_logs_on_device auto;
217217
parameter _compat_suppress_WLOGMIXUP auto;
218+
parameter _compat_suppress_WBIGUNROLL auto;
218219
parameter _compat_legacy_attributes auto;
219220
parameter _compat_lenient_typechecking auto;
220221
parameter _compat_dml12_inline auto;

lib/1.4/dml-builtins.dml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ template device {
561561
param _compat_io_memory auto;
562562
param _compat_shared_logs_on_device auto;
563563
param _compat_suppress_WLOGMIXUP auto;
564+
param _compat_suppress_WBIGUNROLL auto;
564565
param _compat_legacy_attributes auto;
565566
param _compat_lenient_typechecking auto;
566567
param _compat_dml12_inline auto;

py/dml/compat.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,30 @@ class suppress_WLOGMIXUP(CompatFeature):
198198
short = "Suppress the warning 'WLOGMIXUP' by default"
199199
last_api_version = api_6
200200

201+
@feature
202+
class suppress_WBIGUNROLL(CompatFeature):
203+
'''This compatibility feature makes it so the warning `WBIGUNROLL` is
204+
suppressed by default. `WBIGUNROLL` warns about `#foreach` and `#select`
205+
statements that compile to large unrolled loops &mdash; for more
206+
information, see the documentation of `WBIGUNROLL` in the
207+
[Messages](messages.html) section.
208+
209+
`WBIGUNROLL` is suppressed by default below Simics API version 8 in order
210+
to avoid overwhelming users with warnings. Addressing occurences of large
211+
unrolled loops should be done before or as part of migration to Simics API
212+
version 8.
213+
214+
Passing `--no-compat=suppress_WBUGUNROLL` to DMLC has almost the same effect
215+
as passing `--warn=WBIGUNROLL`; either will cause DMLC to report the warning
216+
even when the Simics API version in use is below 8. The only difference
217+
between these two options is that if `--no-compat=suppress_WBIGUNROLL` is
218+
used (and `--warn=WBIGUNROLL` is not), then `WBIGUNROLL` may still be
219+
explicitly suppressed via `--no-warn=WBIGUNROLL`. In contrast,
220+
`--warn=WBIGUNROLL` doesn't allow for `WBIGUNROLL` to be suppressed at
221+
all.'''
222+
short = "Suppress the warning 'WBIGUNROLL' by default"
223+
last_api_version = api_7
224+
201225
@feature
202226
class legacy_attributes(CompatFeature):
203227
'''This compatibility feature makes DMLC register all attributes using the

py/dml/dmlc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ def main(argv):
599599

600600
if compat.suppress_WLOGMIXUP in dml.globals.enabled_compat:
601601
ignore_warning('WLOGMIXUP')
602+
if compat.suppress_WBIGUNROLL in dml.globals.enabled_compat:
603+
ignore_warning('WBIGUNROLL')
602604

603605
for w in options.disabled_warnings:
604606
if not is_warning_tag(w):

py/dml/messages.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,6 +2309,9 @@ class WBIGUNROLL(DMLWarning):
23092309
list instead as a `session` array or an `extern`ed C array, and iterate
23102310
through it using traditional `for` loops. For more information, see [the
23112311
various answers to this Stack Overflow question.](https://stackoverflow.com/questions/75073681/cannot-use-variable-index-in-a-constant-list)
2312+
2313+
This warning is only enabled by default with Simics API version 8 or above
2314+
(due to the compatibility feature `suppress_WBIGUNROLL`.)
23122315
"""
23132316
fmt = ("This '%s' statement compiles to an unrolled loop where the loop "
23142317
+ "body is studied and generated %s times. This may dramatically "
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
© 2024 Intel Corporation
3+
SPDX-License-Identifier: MPL-2.0
4+
*/
5+
dml 1.2;
6+
7+
device test;
8+
9+
/// COMPILE-ONLY
10+
/// NO-CC
11+
12+
/// DMLC-FLAG --no-compat=suppress_WBIGUNROLL
13+
14+
/// SCAN-FOR-TAGS suppress_WBIGUNROLL.dml
15+
import "suppress_WBIGUNROLL.dml";
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
© 2024 Intel Corporation
3+
SPDX-License-Identifier: MPL-2.0
4+
*/
5+
dml 1.2;
6+
7+
device test;
8+
9+
/// COMPILE-ONLY
10+
/// NO-CC
11+
12+
/// DMLC-FLAG --simics-api=7
13+
14+
import "suppress_WBIGUNROLL.dml";

test/1.2/errors/T_WBIGUNROLL.dml renamed to test/1.2/legacy/suppress_WBIGUNROLL.dml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
/*
2-
© 2023 Intel Corporation
2+
© 2024 Intel Corporation
33
SPDX-License-Identifier: MPL-2.0
44
*/
55
dml 1.2;
66

7-
device test;
8-
9-
/// COMPILE-ONLY
10-
/// NO-CC
7+
// expectations in this file are selectively enabled using SCAN-FOR-TAGS
118

129
data int zero = 0;
1310

0 commit comments

Comments
 (0)