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
da22f505
Commit
da22f505
authored
Jul 09, 2014
by
Jan Hubicka
Committed by
Jan Hubicka
Jul 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lto-streamer-out.c (hash_scc): Avoid quadratic hashing loop.
From-SVN: r212404
parent
63dfbb95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
24 deletions
+14
-24
gcc/ChangeLog
+4
-0
gcc/lto-streamer-out.c
+10
-24
No files found.
gcc/ChangeLog
View file @
da22f505
2014
-
07
-
08
Jan
Hubicka
<
hubicka
@
ucw
.
cz
>
*
lto
-
streamer
-
out
.
c
(
hash_scc
):
Avoid
quadratic
hashing
loop
.
2014
-
07
-
08
Jan
Hubicka
<
hubicka
@
ucw
.
cz
>
Revert
:
*
stor
-
layout
.
c
(
finish_builtin_struct
):
Copy
fields
into
the
variants
.
...
...
gcc/lto-streamer-out.c
View file @
da22f505
...
...
@@ -1131,32 +1131,18 @@ hash_scc (struct streamer_tree_cache_d *cache, unsigned first, unsigned size)
/* Sort the SCC of type, hash pairs so that when we mix in
all members of the SCC the hash value becomes independent on
the order we visited the SCC. Disregard hashes equal to
the hash of the tree we mix into because we cannot guarantee
a stable sort for those across different TUs. */
the order we visited the SCC. Produce hash of the whole SCC as
combination of hashes of individual elements. Then combine that hash into
hash of each element, so othewise identically looking elements from two
different SCCs are distinguished. */
qsort
(
&
sccstack
[
first
],
size
,
sizeof
(
scc_entry
),
scc_entry_compare
);
hashval_t
*
tem
=
XALLOCAVEC
(
hashval_t
,
size
);
for
(
unsigned
i
=
0
;
i
<
size
;
++
i
)
{
hashval_t
hash
=
sccstack
[
first
+
i
].
hash
;
hashval_t
orig_hash
=
hash
;
unsigned
j
;
/* Skip same hashes. */
for
(
j
=
i
+
1
;
j
<
size
&&
sccstack
[
first
+
j
].
hash
==
orig_hash
;
++
j
)
;
for
(;
j
<
size
;
++
j
)
hash
=
iterative_hash_hashval_t
(
sccstack
[
first
+
j
].
hash
,
hash
);
for
(
j
=
0
;
sccstack
[
first
+
j
].
hash
!=
orig_hash
;
++
j
)
hash
=
iterative_hash_hashval_t
(
sccstack
[
first
+
j
].
hash
,
hash
);
tem
[
i
]
=
hash
;
}
hashval_t
scc_hash
=
0
;
hashval_t
scc_hash
=
sccstack
[
first
].
hash
;
for
(
unsigned
i
=
1
;
i
<
size
;
++
i
)
scc_hash
=
iterative_hash_hashval_t
(
scc_hash
,
sccstack
[
first
+
i
].
hash
);
for
(
unsigned
i
=
0
;
i
<
size
;
++
i
)
{
sccstack
[
first
+
i
].
hash
=
tem
[
i
];
scc_hash
=
iterative_hash_hashval_t
(
tem
[
i
],
scc_hash
);
}
sccstack
[
first
+
i
].
hash
=
iterative_hash_hashval_t
(
sccstack
[
first
+
i
].
hash
,
scc_hash
);
return
scc_hash
;
}
...
...
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