Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
tilelang
Commits
722c2a8c
Unverified
Commit
722c2a8c
authored
Jul 25, 2025
by
Lei Wang
Committed by
GitHub
Jul 25, 2025
Browse files
[Bugfix] Consider buffer data type into indices provably disjoint analysis (#664)
parent
a16f0cf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
src/transform/thread_storage_sync.cc
src/transform/thread_storage_sync.cc
+19
-9
No files found.
src/transform/thread_storage_sync.cc
View file @
722c2a8c
...
@@ -273,20 +273,29 @@ private:
...
@@ -273,20 +273,29 @@ private:
}
}
for
(
size_t
i
=
0
;
i
<
prev
.
buffer_indices
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
prev
.
buffer_indices
.
size
();
i
++
)
{
auto
prev_dtype
=
prev
.
dtype
;
auto
curr_dtype
=
curr
.
dtype
;
const
auto
&
prev_indice
=
prev
.
buffer_indices
[
i
];
const
auto
&
prev_indice
=
prev
.
buffer_indices
[
i
];
const
auto
&
curr_indice
=
curr
.
buffer_indices
[
i
];
const
auto
&
curr_indice
=
curr
.
buffer_indices
[
i
];
if
(
!
ExprDeepEqual
()(
prev_indice
,
curr_indice
))
{
if
(
!
ExprDeepEqual
()(
prev_indice
,
curr_indice
))
{
auto
prev_indice_bytes
=
analyzer_
.
Simplify
(
prev_indice
*
prev_dtype
.
bytes
());
auto
curr_indice_bytes
=
analyzer_
.
Simplify
(
curr_indice
*
curr_dtype
.
bytes
());
has_same_index
=
false
;
has_same_index
=
false
;
// If both are const, we can check if they are disjoint
// If both are const, we can check if they are disjoint
// by checking if the bounds are disjoint
// by checking if the bounds are disjoint
// [1024, 2048], [2048, 3072] are disjoint
// [1024, 2048], [2048, 3072] are disjoint
// [1024, 2048], [1024, 1024] are not disjoint
// [1024, 2048], [1024, 1024] are not disjoint
auto
prev_bound
=
analyzer_
.
const_int_bound
(
prev_indice
);
auto
prev_bound
=
analyzer_
.
const_int_bound
(
prev_indice
_bytes
);
auto
curr_bound
=
analyzer_
.
const_int_bound
(
curr_indice
);
auto
curr_bound
=
analyzer_
.
const_int_bound
(
curr_indice
_bytes
);
if
(
prev_bound
.
defined
()
&&
curr_bound
.
defined
())
{
if
(
prev_bound
.
defined
()
&&
curr_bound
.
defined
())
{
if
(
prev_bound
->
min_value
>
curr_bound
->
max_value
||
if
(
(
prev_bound
->
min_value
)
>
(
curr_bound
->
max_value
)
||
curr_bound
->
min_value
>
prev_bound
->
max_value
)
{
(
curr_bound
->
min_value
)
>
(
prev_bound
->
max_value
)
)
{
range_is_overlap
=
false
;
range_is_overlap
=
false
;
break
;
break
;
}
}
...
@@ -294,17 +303,18 @@ private:
...
@@ -294,17 +303,18 @@ private:
// if we can prove prev_indice < curr_indice or prev_indice >
// if we can prove prev_indice < curr_indice or prev_indice >
// curr_indice, then they are not overlap
// curr_indice, then they are not overlap
auto
prev_dtype
=
prev_indice
.
dtype
();
auto
prev_
indices_
dtype
=
prev_indice
.
dtype
();
auto
curr_dtype
=
curr_indice
.
dtype
();
auto
curr_
indices_
dtype
=
curr_indice
.
dtype
();
if
(
prev_dtype
.
lanes
()
!=
curr_dtype
.
lanes
())
{
if
(
prev_
indices_
dtype
.
lanes
()
!=
curr_
indices_
dtype
.
lanes
())
{
// can not support different lanes binary op like <, >, <=, >=
// can not support different lanes binary op like <, >, <=, >=
// skip otherwise it will lead to error
// skip otherwise it will lead to error
continue
;
continue
;
}
}
bool
provably_disjoint
=
bool
provably_disjoint
=
analyzer_
.
CanProve
(
prev_indice
<
curr_indice
,
analyzer_
.
CanProve
(
prev_indice
_bytes
<
curr_indice
_bytes
,
arith
::
ProofStrength
::
kSymbolicBound
)
||
arith
::
ProofStrength
::
kSymbolicBound
)
||
analyzer_
.
CanProve
(
prev_indice
>
curr_indice
,
analyzer_
.
CanProve
(
prev_indice
_bytes
>
curr_indice
_bytes
,
arith
::
ProofStrength
::
kSymbolicBound
);
arith
::
ProofStrength
::
kSymbolicBound
);
if
(
provably_disjoint
)
{
if
(
provably_disjoint
)
{
...
...
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