Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
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
lvzhengyang
riscv-gcc-1
Commits
71a6fe66
Commit
71a6fe66
authored
Jan 21, 2009
by
Bingfeng Mei
Committed by
Revital Eres
Jan 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check alias sets in add_inter_loop_mem_dep
From-SVN: r143540
parent
954a782e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
0 deletions
+139
-0
gcc/ChangeLog
+11
-0
gcc/alias.c
+37
-0
gcc/alias.h
+1
-0
gcc/ddg.c
+4
-0
gcc/testsuite/ChangeLog
+5
-0
gcc/testsuite/gcc.dg/sms-6.c
+40
-0
gcc/testsuite/gcc.dg/sms-7.c
+41
-0
No files found.
gcc/ChangeLog
View file @
71a6fe66
2009-01-21 Bingfeng Mei <bmei@broadcom.com>
* alias.c (walk_mems_1, walk_mems_2, insn_alias_sets_conflict_p):
Check whether two instructions have memory references that
belong to conflicting alias sets. walk_mems_1 and walk_mems_2
are helper functions for traversing.
* alias.h (insn_alias_sets_confilict_p): New prototypes.
* ddg.c (add_inter_loop_mem_dep): Call insn_alias_sets_conflict_p
not to draw dependency edge for instructions with non-conflicting
alias sets.
2009-01-20 Joseph Myers <joseph@codesourcery.com>
PR other/38758
...
...
gcc/alias.c
View file @
71a6fe66
...
...
@@ -344,6 +344,43 @@ alias_sets_conflict_p (alias_set_type set1, alias_set_type set2)
return
0
;
}
static
int
walk_mems_2
(
rtx
*
x
,
rtx
mem
)
{
if
(
MEM_P
(
*
x
))
{
if
(
alias_sets_conflict_p
(
MEM_ALIAS_SET
(
*
x
),
MEM_ALIAS_SET
(
mem
)))
return
1
;
return
-
1
;
}
return
0
;
}
static
int
walk_mems_1
(
rtx
*
x
,
rtx
*
pat
)
{
if
(
MEM_P
(
*
x
))
{
/* Visit all MEMs in *PAT and check indepedence. */
if
(
for_each_rtx
(
pat
,
(
rtx_function
)
walk_mems_2
,
*
x
))
/* Indicate that dependence was determined and stop traversal. */
return
1
;
return
-
1
;
}
return
0
;
}
/* Return 1 if two specified instructions have mem expr with conflict alias sets*/
bool
insn_alias_sets_conflict_p
(
rtx
insn1
,
rtx
insn2
)
{
/* For each pair of MEMs in INSN1 and INSN2 check their independence. */
return
for_each_rtx
(
&
PATTERN
(
insn1
),
(
rtx_function
)
walk_mems_1
,
&
PATTERN
(
insn2
));
}
/* Return 1 if the two specified alias sets will always conflict. */
int
...
...
gcc/alias.h
View file @
71a6fe66
...
...
@@ -41,6 +41,7 @@ extern int alias_sets_conflict_p (alias_set_type, alias_set_type);
extern
int
alias_sets_must_conflict_p
(
alias_set_type
,
alias_set_type
);
extern
int
objects_must_conflict_p
(
tree
,
tree
);
extern
int
nonoverlapping_memrefs_p
(
const_rtx
,
const_rtx
);
extern
bool
insn_alias_sets_conflict_p
(
rtx
,
rtx
);
/* This alias set can be used to force a memory to conflict with all
other memories, creating a barrier across which no memory reference
...
...
gcc/ddg.c
View file @
71a6fe66
...
...
@@ -345,6 +345,10 @@ build_inter_loop_deps (ddg_ptr g)
static
void
add_inter_loop_mem_dep
(
ddg_ptr
g
,
ddg_node_ptr
from
,
ddg_node_ptr
to
)
{
if
(
!
insn_alias_sets_conflict_p
(
from
->
insn
,
to
->
insn
))
/* Do not create edge if memory references have disjoint alias sets. */
return
;
if
(
mem_write_insn_p
(
from
->
insn
))
{
if
(
mem_read_insn_p
(
to
->
insn
))
...
...
gcc/testsuite/ChangeLog
View file @
71a6fe66
2009-01-21 Bingfeng Mei <bmei@broadcom.com>
* gcc.dg/sms-6.c: New test.
* gcc.dg/sms-7.c: Likewise.
2009-01-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/38907
...
...
gcc/testsuite/gcc.dg/sms-6.c
0 → 100644
View file @
71a6fe66
/* { dg-do run } */
/* { dg-options "-O2 -fmodulo-sched " } */
extern
void
abort
(
void
);
void
foo
(
int
*
__restrict__
a
,
int
*
__restrict__
b
,
int
*
__restrict__
c
)
{
int
i
;
for
(
i
=
0
;
i
<
100
;
i
+=
4
)
{
a
[
i
]
=
b
[
i
]
*
c
[
i
];
a
[
i
+
1
]
=
b
[
i
+
1
]
*
c
[
i
+
1
];
a
[
i
+
2
]
=
b
[
i
+
2
]
*
c
[
i
+
2
];
a
[
i
+
3
]
=
b
[
i
+
3
]
*
c
[
i
+
3
];
}
}
int
a
[
100
],
b
[
100
],
c
[
100
];
int
main
()
{
int
i
,
res
;
for
(
i
=
0
;
i
<
100
;
i
++
)
{
b
[
i
]
=
c
[
i
]
=
i
;
}
foo
(
a
,
b
,
c
);
res
=
0
;
for
(
i
=
0
;
i
<
100
;
i
++
)
{
res
+=
a
[
i
];
}
if
(
res
!=
328350
)
abort
();
return
0
;
}
gcc/testsuite/gcc.dg/sms-7.c
0 → 100644
View file @
71a6fe66
/* { dg-do run } */
/* { dg-options "-O2 -fmodulo-sched -fstrict-aliasing " } */
extern
void
abort
(
void
);
void
foo
(
int
*
a
,
short
*
__restrict__
b
,
short
*
__restrict__
c
)
{
int
i
;
for
(
i
=
0
;
i
<
100
;
i
+=
4
)
{
a
[
i
]
=
b
[
i
]
*
c
[
i
];
a
[
i
+
1
]
=
b
[
i
+
1
]
*
c
[
i
+
1
];
a
[
i
+
2
]
=
b
[
i
+
2
]
*
c
[
i
+
2
];
a
[
i
+
3
]
=
b
[
i
+
3
]
*
c
[
i
+
3
];
}
}
int
a
[
100
];
short
b
[
100
],
c
[
100
];
int
main
()
{
int
i
,
res
;
for
(
i
=
0
;
i
<
100
;
i
++
)
{
b
[
i
]
=
c
[
i
]
=
i
;
}
foo
(
a
,
b
,
c
);
res
=
0
;
for
(
i
=
0
;
i
<
100
;
i
++
)
{
res
+=
a
[
i
];
}
if
(
res
!=
328350
)
abort
();
return
0
;
}
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