Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
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
Chen Yisong
swiftshader
Commits
3d5e08dc
Commit
3d5e08dc
authored
Mar 01, 2016
by
Jim Stichnoth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subzero: Print constant pool info with --szstats.
BUG= none R=eholk@chromium.org, jpp@chromium.org Review URL:
https://codereview.chromium.org/1747333002
.
parent
b82d79aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
IceGlobalContext.cpp
src/IceGlobalContext.cpp
+20
-4
IceGlobalContext.h
src/IceGlobalContext.h
+1
-1
No files found.
src/IceGlobalContext.cpp
View file @
3d5e08dc
...
...
@@ -160,6 +160,7 @@ public:
std
::
sort
(
Constants
.
begin
(),
Constants
.
end
(),
KeyCompareLess
<
ValueType
>
());
return
Constants
;
}
size_t
size
()
const
{
return
Pool
.
size
();
}
private
:
// Use the default hash function, and a custom key comparison function. The
...
...
@@ -215,9 +216,11 @@ public:
UndefPool
Undefs
;
};
void
GlobalContext
::
CodeStats
::
dump
(
const
IceString
&
Name
,
Ostream
&
Str
)
{
void
GlobalContext
::
CodeStats
::
dump
(
const
IceString
&
Name
,
GlobalContext
*
Ctx
)
{
if
(
!
BuildDefs
::
dump
())
return
;
OstreamLocker
_
(
Ctx
);
Ostream
&
Str
=
Ctx
->
getStrDump
();
#define X(str, tag) \
Str << "|" << Name << "|" str "|" << Stats[CS_##tag] << "\n";
CODESTATS_TABLE
...
...
@@ -230,6 +233,20 @@ void GlobalContext::CodeStats::dump(const IceString &Name, Ostream &Str) {
else
Str
<<
"(requires '-track-memory')"
;
Str
<<
"
\n
"
;
Str
<<
"|"
<<
Name
<<
"|CPool Sizes "
;
{
auto
Pool
=
Ctx
->
getConstPool
();
Str
<<
"|f32="
<<
Pool
->
Floats
.
size
();
Str
<<
"|f64="
<<
Pool
->
Doubles
.
size
();
Str
<<
"|i1="
<<
Pool
->
Integers1
.
size
();
Str
<<
"|i8="
<<
Pool
->
Integers8
.
size
();
Str
<<
"|i16="
<<
Pool
->
Integers16
.
size
();
Str
<<
"|i32="
<<
Pool
->
Integers32
.
size
();
Str
<<
"|i64="
<<
Pool
->
Integers64
.
size
();
Str
<<
"|Rel="
<<
Pool
->
Relocatables
.
size
();
Str
<<
"|ExtRel="
<<
Pool
->
ExternRelocatables
.
size
();
}
Str
<<
"
\n
"
;
}
GlobalContext
::
GlobalContext
(
Ostream
*
OsDump
,
Ostream
*
OsEmit
,
Ostream
*
OsError
,
...
...
@@ -997,11 +1014,10 @@ EmitterWorkItem *GlobalContext::emitQueueBlockingPop() {
void
GlobalContext
::
dumpStats
(
const
IceString
&
Name
,
bool
Final
)
{
if
(
!
getFlags
().
getDumpStats
())
return
;
OstreamLocker
OL
(
this
);
if
(
Final
)
{
getStatsCumulative
()
->
dump
(
Name
,
getStrDump
()
);
getStatsCumulative
()
->
dump
(
Name
,
this
);
}
else
{
ICE_TLS_GET_FIELD
(
TLS
)
->
StatsFunction
.
dump
(
Name
,
getStrDump
()
);
ICE_TLS_GET_FIELD
(
TLS
)
->
StatsFunction
.
dump
(
Name
,
this
);
}
}
...
...
src/IceGlobalContext.h
View file @
3d5e08dc
...
...
@@ -99,7 +99,7 @@ class GlobalContext {
for
(
uint32_t
i
=
0
;
i
<
Stats
.
size
();
++
i
)
Stats
[
i
]
+=
Other
.
Stats
[
i
];
}
void
dump
(
const
IceString
&
Name
,
Ostream
&
Str
);
void
dump
(
const
IceString
&
Name
,
GlobalContext
*
Ctx
);
private
:
std
::
array
<
uint32_t
,
CS_NUM
>
Stats
;
...
...
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