Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
tilelang
Commits
5f7bfeab
Commit
5f7bfeab
authored
Apr 17, 2025
by
Zhengju Tang
Committed by
LeiWang1999
Apr 17, 2025
Browse files
[BugFix] Conditions Robustness in dynamic vectorize (#404)
parent
c091668f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
src/transform/loop_vectorize_dynamic.cc
src/transform/loop_vectorize_dynamic.cc
+11
-4
No files found.
src/transform/loop_vectorize_dynamic.cc
View file @
5f7bfeab
...
...
@@ -396,9 +396,12 @@ private:
VectorizedConditionMutator
condition_mutator
(
inner_var
,
vector_size_
);
// Adaptively set vectorized variable to the min/max value of the extent
PrimExpr
condition_bound
=
condition_mutator
(
conditions
[
0
]);
for
(
int
i
=
1
;
i
<
conditions
.
size
();
++
i
)
{
condition_bound
=
condition_bound
&&
condition_mutator
(
conditions
[
i
]);
PrimExpr
condition_bound
;
if
(
conditions
.
size
()
>
0
)
{
condition_bound
=
condition_mutator
(
conditions
[
0
]);
for
(
int
i
=
1
;
i
<
conditions
.
size
();
++
i
)
{
condition_bound
=
condition_bound
&&
condition_mutator
(
conditions
[
i
]);
}
}
if
(
!
disable_dynamic_tail_split
)
{
...
...
@@ -411,7 +414,11 @@ private:
For
vectorize_for
=
For
(
inner_var
,
0
,
vector_size_
,
ForKind
::
kVectorized
,
vectorize_body
);
For
serial_for
=
For
(
inner_var
,
0
,
vector_size_
,
ForKind
::
kSerial
,
body
);
body
=
IfThenElse
(
condition_bound
,
vectorize_for
,
serial_for
);
if
(
conditions
.
size
()
>
0
)
{
body
=
IfThenElse
(
condition_bound
,
vectorize_for
,
serial_for
);
}
else
{
body
=
vectorize_for
;
}
body
=
For
(
outer_var
,
0
,
extent
/
vector_size_
,
fnode
->
kind
,
body
,
fnode
->
thread_binding
,
fnode
->
annotations
,
fnode
->
span
);
return
body
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment