|
|
|
@ -3,7 +3,7 @@ INCLUDE =include
|
|
|
|
|
_HX_FEAT?= -DFIXED_ROW_SIZE=24
|
|
|
|
|
|
|
|
|
|
CXXFLAGS?= -pipe -O3 -march=native
|
|
|
|
|
CXXFLAGS+= -flto -felide-constructors -fgraphite -fno-strict-aliasing
|
|
|
|
|
CXXFLAGS+= -flto -felide-constructors -fgraphite -fno-strict-aliasing -fno-exceptions -fomit-frame-pointer -fmerge-all-constants -fmodulo-sched -funswitch-loops -fsplit-loops
|
|
|
|
|
CXXFLAGS+= -Wall -pedantic --std=gnu++20 $(addprefix -I,$(INCLUDE))
|
|
|
|
|
LDFLAGS?= -O3 -flto
|
|
|
|
|
LDFLAGS+= -lfmt
|
|
|
|
@ -25,7 +25,7 @@ PROF_FLAGS = -fprofile-generate
|
|
|
|
|
###
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
|
all: dirs $(PROJ)
|
|
|
|
|
all: | dirs $(PROJ)
|
|
|
|
|
|
|
|
|
|
dirs:
|
|
|
|
|
@mkdir -p obj/src
|
|
|
|
@ -44,7 +44,7 @@ $(PROJ): $(OBJ)
|
|
|
|
|
pgo-generate: $(PGO_OBJ)
|
|
|
|
|
$(CXX) $^ $(CXXFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS)
|
|
|
|
|
|
|
|
|
|
pgo-profile: dirs pgo-generate
|
|
|
|
|
pgo-profile: pgo-generate
|
|
|
|
|
for i in {1..$(PGO_ITERATIONS)}; do \
|
|
|
|
|
dd if=/dev/urandom of=./pgo-test bs=1024 count=$(PGO_DATASET_SIZE) >> /dev/null 2>&1; \
|
|
|
|
|
printf "\rIteration $$i / $(PGO_ITERATIONS)"; \
|
|
|
|
@ -60,7 +60,9 @@ pgo-use: PROF_FLAGS = -fprofile-use -lgcov
|
|
|
|
|
pgo-use: $(PGO_OBJ)
|
|
|
|
|
$(CXX) $^ $(CXXFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS)
|
|
|
|
|
|
|
|
|
|
$(PROJ)-pgo: dirs pgo-profile pgo-use
|
|
|
|
|
$(PROJ)-pgo: | dirs pgo-profile
|
|
|
|
|
find ./profile -name \*.o -exec rm {} +
|
|
|
|
|
$(MAKE) pgo-use
|
|
|
|
|
mv pgo-use $@
|
|
|
|
|
strip $@
|
|
|
|
|
|
|
|
|
|