From 1c264a258be01623b8936657a32f2251ca2059c1 Mon Sep 17 00:00:00 2001 From: Léo Gourdin Date: Wed, 5 Jan 2022 15:22:22 +0100 Subject: ccomp profiling --- test/Makefile | 3 +++ test/abi/Makefile | 29 ++++++++++++++--------------- test/compression/Makefile | 8 +++++++- test/raytracer/Makefile | 6 ++++++ test/spass/Makefile | 6 ++++++ 5 files changed, 36 insertions(+), 16 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index b0010ea0..e998b52a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -17,6 +17,9 @@ endif all: set -e; for i in $(DIRS); do $(MAKE) CCOMPOPTS='$(CCOMPOPTS)' -C $$i all; done +all_s: + set -e; for i in $(DIRS); do $(MAKE) CCOMPOPTS='$(CCOMPOPTS)' -C $$i all_s; done + test: set -e; for i in $(DIRS); do $(MAKE) SIMU='$(SIMU)' -C $$i test; done diff --git a/test/abi/Makefile b/test/abi/Makefile index ef354e06..ee00d4de 100644 --- a/test/abi/Makefile +++ b/test/abi/Makefile @@ -1,7 +1,7 @@ include ../../Makefile.config CCOMP=../../ccomp -stdlib ../../runtime -CCOMPFLAGS= +CCOMPFLAGS=-fstruct-passing CFLAGS=-O -Wno-overflow -Wno-constant-conversion TESTS=fixed.compcert fixed.cc2compcert fixed.compcert2cc \ @@ -17,18 +17,6 @@ all_s: fixed_def_compcert.s fixed_use_compcert.s \ vararg_def_compcert.s vararg_use_compcert.s \ struct_def_compcert.s struct_use_compcert.s -test: - @set -e; for t in $(TESTS); do \ - SIMU='$(SIMU)' ARCH=$(ARCH) MODEL=$(MODEL) ABI=$(ABI) SYSTEM=$(SYSTEM) ./Runtest $$t; \ - done - @set -e; for t in layout staticlayout; do \ - $(SIMU) ./$$t.compcert > _compcert.log; \ - $(SIMU) ./$$t.cc > _cc.log; \ - if diff -a -u _cc.log _compcert.log; \ - then echo "$$t: CompCert and $CC agree"; rm _*.log; \ - else echo "$$t: CompCert and $CC DISAGREE"; exit 2; fi; \ - done - generator.exe: generator.ml ocamlopt -g -o $@ generator.ml @@ -72,7 +60,7 @@ endif layout.h: genlayout.exe ./genlayout.exe $(GENLAYOUT_OPTIONS) > layout.h -struct%.o: CCOMPFLAGS += -fstruct-passing -dclight +struct%.o: CCOMPFLAGS +=-dclight %_compcert.o: %.c $(CCOMP) $(CCOMPFLAGS) -c -o $@ $*.c @@ -80,7 +68,7 @@ struct%.o: CCOMPFLAGS += -fstruct-passing -dclight $(CC) $(CFLAGS) -c -o $@ $*.c %_compcert.s: %.c - $(CCOMP) -S -o $@ $*.c + $(CCOMP) $(CCOMPFLAGS) -S -o $@ $*.c %_cc.s: %.c $(CC) $(CFLAGS) -S -o $@ $*.c @@ -109,3 +97,14 @@ staticlayout.cc: staticlayout.c layout.h clean:: rm -f *.[os] *.compcert *.cc2compcert *.compcert2cc *.light.c +test: + @set -e; for t in $(TESTS); do \ + SIMU='$(SIMU)' ARCH=$(ARCH) MODEL=$(MODEL) ABI=$(ABI) SYSTEM=$(SYSTEM) ./Runtest $$t; \ + done + @set -e; for t in layout staticlayout; do \ + $(SIMU) ./$$t.compcert > _compcert.log; \ + $(SIMU) ./$$t.cc > _cc.log; \ + if diff -a -u _cc.log _compcert.log; \ + then echo "$$t: CompCert and $CC agree"; rm _*.log; \ + else echo "$$t: CompCert and $CC DISAGREE"; exit 2; fi; \ + done diff --git a/test/compression/Makefile b/test/compression/Makefile index ff7032d5..330c33af 100644 --- a/test/compression/Makefile +++ b/test/compression/Makefile @@ -3,7 +3,11 @@ include ../../Makefile.config SIMU=timeout --signal=SIGKILL 20s $(EXECUTE) CC=../../ccomp -CFLAGS=$(CCOMPOPTS) -U__GNUC__ -stdlib ../../runtime -dclight -dasm +ifeq ($(OCAML_LM_PROF),true) + override CCOMPOPTS+=-S +endif + +CFLAGS:=$(CCOMPOPTS) -U__GNUC__ -stdlib ../../runtime -dclight -dasm LIBS= TIME=ocaml unix.cma ../../tools/xtime.ml -mintime 2.0 -minruns 2 @@ -13,6 +17,8 @@ COMMON_OBJS=optlist.o bitfile.o all: $(EXE) +all_s: all + ARCODE_OBJS=$(COMMON_OBJS) arcode.o armain.o arcode: $(ARCODE_OBJS) diff --git a/test/raytracer/Makefile b/test/raytracer/Makefile index 24461bd1..c59bb21e 100644 --- a/test/raytracer/Makefile +++ b/test/raytracer/Makefile @@ -1,6 +1,10 @@ include ../../Makefile.config CC=../../ccomp +ifeq ($(OCAML_LM_PROF), true) + override CCOMPOPTS+=-S +endif + CFLAGS=$(CCOMPOPTS) -stdlib ../../runtime -dparse -dclight -dasm -fstruct-return LIBS=$(LIBMATH) TIME=ocaml unix.cma ../../tools/xtime.ml -mintime 2.0 -minruns 4 @@ -11,6 +15,8 @@ OBJS=memory.o gmllexer.o gmlparser.o eval.o \ all: render +all_s: all + render: $(OBJS) $(CC) $(CFLAGS) -o render $(OBJS) $(LIBS) diff --git a/test/spass/Makefile b/test/spass/Makefile index d512ea95..7b9b4f65 100644 --- a/test/spass/Makefile +++ b/test/spass/Makefile @@ -1,6 +1,10 @@ include ../../Makefile.config CC=../../ccomp +ifeq ($(OCAML_LM_PROF), true) + override CCOMPOPTS+=-S +endif + CFLAGS=$(CCOMPOPTS) -stdlib ../../runtime -dparse -dclight -dasm -fstruct-return SRCS=analyze.c clause.c clock.c closure.c cnf.c component.c \ @@ -14,6 +18,8 @@ SRCS=analyze.c clause.c clock.c closure.c cnf.c component.c \ all: spass +all_s: all + spass: $(SRCS:.c=.o) $(CC) $(CFLAGS) -o spass $(SRCS:.c=.o) $(LIBMATH) -- cgit