Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-watermarker
Project
Project
Details
Activity
Releases
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
nagayama15
llvm-watermarker
Commits
7fb64c44
Commit
7fb64c44
authored
Jan 20, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
透かしによる実行速度変化のベンチマークを追加
parent
7f423559
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
63 deletions
+58
-63
Makefile
example/zlib/Makefile
+56
-61
aggregate.sh
scripts/aggregate.sh
+2
-2
No files found.
example/zlib/Makefile
View file @
7fb64c44
include
../../common.mk
WATERMARK
:=
77
CC
:=
clang
CXX
:=
clang++
...
...
@@ -42,85 +40,82 @@ SRCS := \
zlib/uncompr.c
\
zlib/zutil.c
OBJS
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib/%.o
}
OBJS_BWM
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib-block-wm/%.o
}
OBJS_IWM
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib-inst-wm/%.o
}
OBJS_WM
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib-wm/%.o
}
.PHONY
:
all test
# $(call watermark,<watermark>)
define
watermark
.PRECIOUS
:
\
$${SRCS:zlib/%.c=$${OBJ_DIR}/$1/%-block-wm.ll}
\
$${SRCS:zlib/%.c=$${OBJ_DIR}/$1/%-inst-wm.ll}
\
$${SRCS:zlib/%.c=$${OBJ_DIR}/$1/%-wm.ll}
all
:
\
${BIN_DIR}/benchmark
\
${BIN_DIR}/benchmark-block-wm
\
${BIN_DIR}/benchmark-inst-wm
\
${BIN_DIR}/benchmark-wm
$${BIN_DIR}/$1/benchmark-block-wm
\
$${BIN_DIR}/$1/benchmark-inst-wm
\
$${BIN_DIR}/$1/benchmark-wm
test
:
\
${BIN_DIR}/benchmark
\
${BIN_DIR}/benchmark-block-wm
\
${BIN_DIR}/benchmark-inst-wm
\
${BIN_DIR}/benchmark-wm
$${BIN_DIR}/$1/benchmark-block-wm
\
$${BIN_DIR}/$1/benchmark-inst-wm
\
$${BIN_DIR}/$1/benchmark-wm
benchmark
:
${
BIN_DIR
}
/benchmark |
tee
${
BIN_DIR
}
/benchmark.txt
${
BIN_DIR
}
/benchmark-block-wm |
tee
${
BIN_DIR
}
/benchmark-block-wm.txt
${
BIN_DIR
}
/benchmark-inst-wm |
tee
${
BIN_DIR
}
/benchmark-inst-wm.txt
${
BIN_DIR
}
/benchmark-wm |
tee
${
BIN_DIR
}
/benchmark-wm.txt
paste
-d
","
${
BIN_DIR
}
/benchmark.txt
${
BIN_DIR
}
/benchmark-block-wm.txt
${
BIN_DIR
}
/benchmark-inst-wm.txt
${
BIN_DIR
}
/benchmark-wm.txt
>
${
BIN_DIR
}
/benchmark.csv
benchmark
::
\
$${BIN_DIR}/$1/benchmark-block-wm
\
$${BIN_DIR}/$1/benchmark-inst-wm
\
$${BIN_DIR}/$1/benchmark-wm
$$
{
BIN_DIR
}
/
$1
/benchmark-block-wm |
tee
$$
{
BIN_DIR
}
/
$1
/benchmark-block-wm.txt
$$
{
BIN_DIR
}
/
$1
/benchmark-inst-wm |
tee
$$
{
BIN_DIR
}
/
$1
/benchmark-inst-wm.txt
$$
{
BIN_DIR
}
/
$1
/benchmark-wm |
tee
$$
{
BIN_DIR
}
/
$1
/benchmark-wm.txt
paste
-d
"
\t
"
$$
{
BIN_DIR
}
/benchmark.txt
$$
{
BIN_DIR
}
/
$1
/benchmark-block-wm.txt
$$
{
BIN_DIR
}
/
$1
/benchmark-inst-wm.txt
$$
{
BIN_DIR
}
/
$1
/benchmark-wm.txt
>
$$
{
BIN_DIR
}
/
$1
/benchmark.csv
${BIN_DIR}/libz.a
:
${OBJS}
${BIN_DIR}/libz-block-wm.a
:
${OBJS_BWM}
${BIN_DIR}/libz-inst-wm.a
:
${OBJS_IWM}
${BIN_DIR}/libz-wm.a
:
${OBJS_WM}
$${BIN_DIR}/$1/libz-block-wm.a
:
$${SRCS:zlib/%.c=$${OBJ_DIR}/$1/%-block-wm.o}
$${BIN_DIR}/$1/libz-inst-wm.a
:
$${SRCS:zlib/%.c=$${OBJ_DIR}/$1/%-inst-wm.o}
$${BIN_DIR}/$1/libz-wm.a
:
$${SRCS:zlib/%.c=$${OBJ_DIR}/$1/%-wm.o}
${BIN_DIR}/benchmark
:
${OBJ_DIR}/benchmark.o ${BIN_DIR}/libz.a
${BIN_DIR}/benchmark-block-wm
:
${OBJ_DIR}/benchmark.o ${BIN_DIR}/libz-block-wm.a
${BIN_DIR}/benchmark-inst-wm
:
${OBJ_DIR}/benchmark.o ${BIN_DIR}/libz-inst-wm.a
${BIN_DIR}/benchmark-wm
:
${OBJ_DIR}/benchmark.o ${BIN_DIR}/libz-wm.a
$${BIN_DIR}/$1/benchmark-%
:
$${OBJ_DIR}/benchmark.o $${BIN_DIR}/$1/libz-%.a
@
mkdir
-p
$$
{
@D
}
$$
{
CXX
}
$$
{
CXXFLAGS
}
-o
$$
@
$$
^
$$
{
LDFLAGS
}
$
{OBJ_DIR}/zlib/%.o
:
zlib/%.c
@
mkdir
-p
${
@D
}
${
CC
}
${
CFLAGS
}
-o
$@
-c
$<
$
${OBJ_DIR}/$1/%-block-wm.ll
:
$${OBJ_DIR}/%.ll
@
mkdir
-p
$
$
{
@D
}
opt
-load
=
$$
{
ROOT
}
/bin/
$$
{
BUILD_TYPE
}
/src/nykk.so
-block-wm
-watermark
=
"
$1
"
-S
-o
$$
@
$$
< 2>
$$
{
@:%.ll
=
%.txt
}
${OBJ_DIR}/zlib-block-wm/%.o
:
zlib/%.c
@
mkdir
-p
${
@D
}
clang
${
CFLAGS
}
-emit-llvm
-S
-o
${
@
:.o
=.ll
}
$<
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-block-wm.ll
}
${
@
:.o
=.ll
}
2>
${
@
:%.o
=%-block-wm.txt
}
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-block-wm.ll
}
$${OBJ_DIR}/$1/%-inst-wm.ll
:
$${OBJ_DIR}/%.ll
@
mkdir
-p
$$
{
@D
}
opt
-load
=
$$
{
ROOT
}
/bin/
$$
{
BUILD_TYPE
}
/src/nykk.so
-inst-wm
-watermark
=
"
$1
"
-S
-o
$$
@
$$
< 2>
$$
{
@:%.ll
=
%.txt
}
${OBJ_DIR}/zlib-inst-wm/%.o
:
zlib/%.c
@
mkdir
-p
${
@D
}
clang
${
CFLAGS
}
-emit-llvm
-S
-o
${
@
:.o
=.ll
}
$<
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-inst-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-inst-wm.ll
}
${
@
:.o
=.ll
}
2>
${
@
:%.o
=%-inst-wm.txt
}
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-inst-wm.ll
}
$${OBJ_DIR}/$1/%-wm.ll
:
$${OBJ_DIR}/$1/%-block-wm.ll
opt
-load
=
$$
{
ROOT
}
/bin/
$$
{
BUILD_TYPE
}
/src/nykk.so
-inst-wm
-watermark
=
"
$1
"
-S
-o
$$
@
$$
< 2> /dev/null
endef
${OBJ_DIR}/zlib-wm/%.o
:
zlib/%.c
@
mkdir
-p
${
@D
}
clang
${
CFLAGS
}
-emit-llvm
-S
-o
${
@
:.o
=.ll
}
$<
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-block-wm.ll
}
${
@
:.o
=.ll
}
2> /dev/null
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-inst-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-inst-wm.ll
}
${
@
:.o
=-block-wm.ll
}
2> /dev/null
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-inst-wm.ll
}
.PRECIOUS
:
${SRCS:zlib/%.c=${OBJ_DIR}/%.ll}
${OBJ_DIR}/benchmark.o
:
benchmark.cpp
@
mkdir
-p
${
@D
}
${
CXX
}
${
CXXFLAGS
}
-o
$@
-c
$<
all
:
${BIN_DIR}/benchmark
test
:
${BIN_DIR}/benchmark
${BIN_DIR}/benchmark
:
@
mkdir
-p
${
@D
}
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
benchmark
::
${BIN_DIR}/benchmark
${
BIN_DIR
}
/benchmark |
tee
${
BIN_DIR
}
/benchmark.txt
${BIN_DIR}/benchmark-block-wm
:
@
mkdir
-p
${
@D
}
${BIN_DIR}/libz.a
:
${SRCS:zlib/%.c=${OBJ_DIR}/%.o}
${BIN_DIR}/benchmark
:
${OBJ_DIR}/benchmark.o ${BIN_DIR}/libz.a
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
${
BIN_DIR}/benchmark-inst-wm
:
${
OBJ_DIR}/%.ll
:
zlib/%.c
@
mkdir
-p
${
@D
}
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
clang
${
CFLAGS
}
-S
-emit-llvm
-o
$@
-c
$<
${
BIN_DIR}/benchmark-wm
:
${
OBJ_DIR}/benchmark.o
:
benchmark.cpp
@
mkdir
-p
${
@D
}
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
${
CXX
}
${
CXXFLAGS
}
-o
$@
-c
$<
%.a
:
@
mkdir
-p
${
@D
}
${
AR
}
rcs
$@
$^
%.o
:
%.ll
clang
-o
$@
-c
$<
$(eval
$(call
watermark,zlib-watermark))
$(eval
$(call
watermark,92bb9dcfd3b9f053d35c77c4c8796c6a))
$(eval
$(call
watermark,48d92373664b84ba9399cb6072220ee5))
$(eval
$(call
watermark,28e2fb60e8dc7c19cf6f9a06a7582ef3))
#$(eval $(call watermark,e94d310dfb9d89a0f2dd50ce5132493d))
scripts/aggregate.sh
View file @
7fb64c44
...
...
@@ -47,7 +47,7 @@ h2() {
echo
"==== 8cc block-wm ===="
h1 obj/
$1
/example/8cc/stage1-wm/
*
-block-wm
.txt
echo
"==== zlib block-wm ===="
h1 obj/
$1
/example/zlib/zlib-
block-wm
/
*
-block-wm
.txt
h1 obj/
$1
/example/zlib/zlib-
watermark
/
*
-block-wm
.txt
echo
"==== lua block-wm ===="
h1 obj/
$1
/example/lua/
*
-block-wm
.txt
echo
"==== cJSON block-wm ===="
...
...
@@ -64,7 +64,7 @@ h1 obj/$1/example/numguess-rs/*-block-wm.txt
echo
"==== 8cc inst-wm ===="
h2 obj/
$1
/example/8cc/stage1-wm/
*
-inst-wm
.txt
echo
"==== zlib inst-wm ===="
h2 obj/
$1
/example/zlib/zlib-
inst-wm
/
*
-inst-wm
.txt
h2 obj/
$1
/example/zlib/zlib-
watermark
/
*
-inst-wm
.txt
echo
"==== lua inst-wm ===="
h2 obj/
$1
/example/lua/
*
-inst-wm
.txt
echo
"==== cJSON inst-wm ===="
...
...
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