Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
0de71700
Commit
0de71700
authored
Jul 24, 2017
by
Tianqi Chen
Committed by
GitHub
Jul 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUGFIX] Fix CanonicalSimplify change type of int constant (#269)
parent
7e3d9da4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
.gitignore
+3
-1
src/arithmetic/canonical.cc
+2
-0
src/pass/storage_rewrite.cc
+7
-6
No files found.
.gitignore
View file @
0de71700
...
...
@@ -127,9 +127,11 @@ jvm/*/*/target/
!default.perspectivev3
xcuserdata/
.emscripten*
.m2
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
.DS_Store
src/arithmetic/canonical.cc
View file @
0de71700
...
...
@@ -113,6 +113,7 @@ struct BinaryExpr {
}
};
template
<
typename
T
>
inline
Expr
Binary_
(
const
T
*
op
,
const
Expr
&
e
,
...
...
@@ -282,6 +283,7 @@ class Canonical::Internal : public IRMutator {
}
// IntImm
Expr
Mutate_
(
const
IntImm
*
op
,
const
Expr
&
e
)
final
{
if
(
op
->
type
!=
Int
(
32
))
return
e
;
auto
it
=
cache_intimm_
.
find
(
op
->
value
);
if
(
it
!=
cache_intimm_
.
end
())
{
return
it
->
second
;
...
...
src/pass/storage_rewrite.cc
View file @
0de71700
...
...
@@ -239,17 +239,18 @@ class StoragePlanRewriter : public IRMutator {
const
Variable
*
buffer
=
op
->
args
[
1
].
as
<
Variable
>
();
auto
it
=
alloc_map_
.
find
(
buffer
);
if
(
it
==
alloc_map_
.
end
())
return
IRMutator
::
Mutate_
(
op
,
e
);
const
StorageEntry
*
e
=
it
->
second
;
const
StorageEntry
*
s
e
=
it
->
second
;
Expr
offset
=
Mutate
(
op
->
args
[
2
]);
Expr
extent
=
Mutate
(
op
->
args
[
3
]);
CHECK_EQ
(
e
->
elem_type
,
dtype
.
element_of
());
CHECK_EQ
(
e
->
elem_offset
%
dtype
.
lanes
(),
0
);
if
(
e
->
elem_offset
!=
0
)
{
offset
=
make_const
(
offset
.
type
(),
e
->
elem_offset
/
dtype
.
lanes
())
+
offset
;
CHECK_EQ
(
se
->
elem_type
,
dtype
.
element_of
())
<<
" buffer="
<<
buffer
->
name_hint
;
CHECK_EQ
(
se
->
elem_offset
%
dtype
.
lanes
(),
0
);
if
(
se
->
elem_offset
!=
0
)
{
offset
=
make_const
(
offset
.
type
(),
se
->
elem_offset
/
dtype
.
lanes
())
+
offset
;
}
return
Call
::
make
(
op
->
type
,
op
->
name
,
{
op
->
args
[
0
],
e
->
alloc_var
,
offset
,
extent
,
op
->
args
[
4
]},
{
op
->
args
[
0
],
s
e
->
alloc_var
,
offset
,
extent
,
op
->
args
[
4
]},
op
->
call_type
);
}
else
{
return
IRMutator
::
Mutate_
(
op
,
e
);
...
...
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