|
|
@ -19,7 +19,7 @@ LDFLAGS+= $(FEAT_LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
# PGO specific vars
|
|
|
|
# PGO specific vars
|
|
|
|
|
|
|
|
|
|
|
|
PROF_ITERATIONS=1000
|
|
|
|
PROF_ITERATIONS=10
|
|
|
|
PROF_LARGE_BOUND= $$(( 1024 * 1024 * 10 ))
|
|
|
|
PROF_LARGE_BOUND= $$(( 1024 * 1024 * 10 ))
|
|
|
|
PROF_SMALL_BOUND= $$(( 1024 * 10 ))
|
|
|
|
PROF_SMALL_BOUND= $$(( 1024 * 10 ))
|
|
|
|
PROF_LOCATION?=/tmp/fcmp-pgo
|
|
|
|
PROF_LOCATION?=/tmp/fcmp-pgo
|
|
|
@ -59,26 +59,30 @@ $(PROJECT)-debug: LDFLAGS := $(DEBUG_LDFLAGS) $(LDFLAGS)
|
|
|
|
$(PROJECT)-debug: $(OBJ)
|
|
|
|
$(PROJECT)-debug: $(OBJ)
|
|
|
|
$(CC) $^ $(CFLAGS) -o $@ $(LDFLAGS)
|
|
|
|
$(CC) $^ $(CFLAGS) -o $@ $(LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pgo-generate: CFLAGS := $(RELEASE_CFLAGS) $(CFLAGS)
|
|
|
|
|
|
|
|
pgo-generate: LDFLAGS := $(RELEASE_LDFLAGS) $(LDFLAGS)
|
|
|
|
pgo-generate: $(PGO_OBJ)
|
|
|
|
pgo-generate: $(PGO_OBJ)
|
|
|
|
$(CC) -c $< $(CFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS)
|
|
|
|
$(CC) $^ $(CFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
pgo-reset:
|
|
|
|
pgo-reset:
|
|
|
|
find ./prof -name \*.gcda -exec rm {} +
|
|
|
|
find ./prof -name \*.gcda -exec rm {} +
|
|
|
|
|
|
|
|
|
|
|
|
pgo-profile: | pgo-reset pgo-generate
|
|
|
|
pgo-profile: pgo-reset pgo-generate
|
|
|
|
@mkdir -p $(PROF_LOCATION)/{large,small}
|
|
|
|
|
|
|
|
#./profile/gen $(PROF_LARGE_BOUND) "$(PROF_LOCATION)/large"
|
|
|
|
#./profile/gen $(PROF_LARGE_BOUND) "$(PROF_LOCATION)/large"
|
|
|
|
#./profile/gen $(PROF_SMALL_BOUND) "$(PROF_LOCATION)/small"
|
|
|
|
#./profile/gen $(PROF_SMALL_BOUND) "$(PROF_LOCATION)/small"
|
|
|
|
for i in {1..$(PROF_ITERATIONS)}; do \
|
|
|
|
for i in {1..$(PROF_ITERATIONS)}; do \
|
|
|
|
./profile/gen $(PROF_LARGE_BOUND) "$(PROF_LOCATION)/large"; \
|
|
|
|
rm -rf $(PROF_LOCATION); \
|
|
|
|
./profile/gen $(PROF_SMALL_BOUND) "$(PROF_LOCATION)/small"; \
|
|
|
|
mkdir -p $(PROF_LOCATION)/{large,small}; \
|
|
|
|
./pgo-generate $(PROF_LOCATION)/large/matching > $(PROF_LOCATION)/stdout; \
|
|
|
|
printf "Iteration $$i of $(PROF_ITERATIONS)\r"; \
|
|
|
|
./pgo-generate $(PROF_LOCATION)/large/unmatching > $(PROF_LOCATION)/stdout; \
|
|
|
|
./profile/gen $(PROF_LARGE_BOUND) "$(PROF_LOCATION)/large" >> /dev/null; \
|
|
|
|
./pgo-generate $(PROF_LOCATION)/small/matching > $(PROF_LOCATION)/stdout; \
|
|
|
|
./profile/gen $(PROF_SMALL_BOUND) "$(PROF_LOCATION)/small" >> /dev/null; \
|
|
|
|
./pgo-generate $(PROF_LOCATION)/small/unmatching > $(PROF_LOCATION)/stdout; \
|
|
|
|
./pgo-generate $(PROF_LOCATION)/large/matching/* > $(PROF_LOCATION)/stdout; \
|
|
|
|
#TODO: More combinations
|
|
|
|
./pgo-generate $(PROF_LOCATION)/large/unmatching/* > $(PROF_LOCATION)/stdout; \
|
|
|
|
rm -rf $(PROF_LOCATION)/{large,small} \
|
|
|
|
./pgo-generate $(PROF_LOCATION)/small/matching/* > $(PROF_LOCATION)/stdout; \
|
|
|
|
|
|
|
|
./pgo-generate $(PROF_LOCATION)/small/unmatching/* > $(PROF_LOCATION)/stdout; \
|
|
|
|
|
|
|
|
rm -rf $(PROF_LOCATION)/{large,small}; \
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
@echo ""
|
|
|
|
rm -rf $(PROF_LOCATION)
|
|
|
|
rm -rf $(PROF_LOCATION)
|
|
|
|
rm pgo-generate
|
|
|
|
rm pgo-generate
|
|
|
|
|
|
|
|
|
|
|
@ -86,7 +90,7 @@ pgo-use: CFLAGS := $(RELEASE_CFLAGS) $(CFLAGS)
|
|
|
|
pgo-use: LDFLAGS := $(RELEASE_LDFLAGS) $(LDFLAGS)
|
|
|
|
pgo-use: LDFLAGS := $(RELEASE_LDFLAGS) $(LDFLAGS)
|
|
|
|
pgo-use: PROF_FLAGS = -fprofile-use
|
|
|
|
pgo-use: PROF_FLAGS = -fprofile-use
|
|
|
|
pgo-use: $(PGO_OBJ)
|
|
|
|
pgo-use: $(PGO_OBJ)
|
|
|
|
$(CC) -c $< $(CFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS)
|
|
|
|
$(CC) $^ $(CFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(PROJECT)-pgo: CFLAGS := $(RELEASE_CFLAGS) $(CFLAGS)
|
|
|
|
$(PROJECT)-pgo: CFLAGS := $(RELEASE_CFLAGS) $(CFLAGS)
|
|
|
|
$(PROJECT)-pgo: LDFLAGS := $(RELEASE_LDFLAGS) $(LDFLAGS)
|
|
|
|
$(PROJECT)-pgo: LDFLAGS := $(RELEASE_LDFLAGS) $(LDFLAGS)
|
|
|
@ -98,4 +102,4 @@ $(PROJECT)-pgo: pgo-profile
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
clean:
|
|
|
|
rm -rf {obj,prof}
|
|
|
|
rm -rf {obj,prof}
|
|
|
|
rm -f $(PROJECT)-{release,debug}
|
|
|
|
rm -f $(PROJECT)-{release,debug,pgo}
|
|
|
|