diff options
-rw-r--r-- | .gitlab-ci.yml | 22 | ||||
-rw-r--r-- | driver/Clflags.ml | 2 | ||||
-rw-r--r-- | scheduling/BTLScheduleraux.ml | 2 | ||||
-rw-r--r-- | test/gourdinl/postpass_alternate_str.c | 11 | ||||
-rw-r--r-- | test/monniaux/csmith/Makefile | 95 | ||||
-rw-r--r-- | test/monniaux/csmith/Makefile.old | 23 |
6 files changed, 131 insertions, 24 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 28311ddc..1ecdafdf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ check-admitted: - if: '$CI_COMMIT_BRANCH == "master"' when: always - when: manual - + build_x86_64: stage: build image: coqorg/coq:8.12.2-ocaml-4.11.2-flambda @@ -34,6 +34,7 @@ build_x86_64: - make -j "$NJOBS" - make -C test all test - ulimit -s65536 && make -C test/monniaux/yarpgen + - ulimit -s65536 && make -C test/monniaux/csmith rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -59,6 +60,7 @@ build_ia32: - make -j "$NJOBS" - make -C test all test - ulimit -s65536 && make -C test/monniaux/yarpgen BITS=32 TARGET_CC='gcc -m32' + - ulimit -s65536 && make -C test/monniaux/csmith TARGET_CC='gcc -m32' rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -83,7 +85,8 @@ build_aarch64: - ./config_aarch64.sh - make -j "$NJOBS" - make -C test SIMU='qemu-aarch64 -L /usr/aarch64-linux-gnu' EXECUTE='qemu-aarch64 -L /usr/aarch64-linux-gnu' all test - - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='aarch64-linux-gnu-gcc' EXECUTE='qemu-aarch64 -L /usr/aarch64-linux-gnu' CCOMPOPTS='-static' TARGET_CFLAGS='-static' + - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='aarch64-linux-gnu-gcc' EXECUTE='qemu-aarch64 -L /usr/aarch64-linux-gnu' + - ulimit -s65536 && make -C test/monniaux/csmith TARGET_CC='aarch64-linux-gnu-gcc' EXECUTE='timeout 10s qemu-aarch64 -L /usr/aarch64-linux-gnu' CCOMPOPTS='-static' TARGET_CFLAGS='-static' rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -108,7 +111,8 @@ build_arm: - ./config_arm.sh - make -j "$NJOBS" - make -C test SIMU='qemu-arm -L /usr/arm-linux-gnueabi' EXECUTE='qemu-arm -L /usr/arm-linux-gnueabi' all test - - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='arm-linux-gnueabi-gcc' EXECUTE='qemu-arm -L /usr/arm-linux-gnueabi' CCOMPOPTS='-static' TARGET_CFLAGS='-static' BITS=32 + - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='arm-linux-gnueabi-gcc' EXECUTE='qemu-arm -L /usr/arm-linux-gnueabi' BITS=32 + - ulimit -s65536 && make -C test/monniaux/csmith TARGET_CC='arm-linux-gnueabi-gcc' EXECUTE='timeout 10s qemu-arm -L /usr/arm-linux-gnueabi' CCOMPOPTS='-static' TARGET_CFLAGS='-static' BITS=32 rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -134,7 +138,8 @@ build_armhf: - ./config_armhf.sh - make -j "$NJOBS" - make -C test SIMU='qemu-arm -L /usr/arm-linux-gnueabihf' EXECUTE='qemu-arm -L /usr/arm-linux-gnueabihf' all test - - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='arm-linux-gnueabihf-gcc' EXECUTE='qemu-arm -L /usr/arm-linux-gnueabihf' CCOMPOPTS='-static' TARGET_CFLAGS='-static' BITS=32 + - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='arm-linux-gnueabihf-gcc' EXECUTE='qemu-arm -L /usr/arm-linux-gnueabihf' BITS=32 + - ulimit -s65536 && make -C test/monniaux/csmith TARGET_CC='arm-linux-gnueabihf-gcc' EXECUTE='timeout 10s qemu-arm -L /usr/arm-linux-gnueabihf' CCOMPOPTS='-static' TARGET_CFLAGS='-static' BITS=32 rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -164,6 +169,7 @@ build_ppc: - qemu-ppc --version - make -C test SIMU='qemu-ppc -L /usr/powerpc-linux-gnu -cpu 7400' EXECUTE='qemu-ppc -L /usr/powerpc-linux-gnu -cpu 7400' all test - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='powerpc-linux-gnu-gcc' EXECUTE='qemu-ppc -L /usr/powerpc-linux-gnu -cpu 7400' BITS=32 + - ulimit -s65536 && make -C test/monniaux/csmith TARGET_CC='powerpc-linux-gnu-gcc' EXECUTE='timeout 10s qemu-ppc -L /usr/powerpc-linux-gnu -cpu 7400' rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -187,8 +193,8 @@ build_ppc64: script: - ./config_ppc64.sh - make -j "$NJOBS" - #- make -C test SIMU='qemu-ppc64 -L /usr/powerpc64-linux-gnu -cpu 7400' EXECUTE='qemu-ppc64 -L /usr/powerpc64-linux-gnu -cpu 7400' all test - #- ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='powerpc64-linux-gnu-gcc' EXECUTE='qemu-ppc64 -L /usr/powerpc64-linux-gnu -cpu 7400' BITS=32 + # - make -C test SIMU='qemu-ppc64 -L /usr/powerpc64-linux-gnu -cpu 7400' EXECUTE='qemu-ppc64 -L /usr/powerpc64-linux-gnu -cpu 7400' all test + # - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='powerpc64-linux-gnu-gcc' EXECUTE='qemu-ppc64 -L /usr/powerpc64-linux-gnu -cpu 7400' BITS=32 rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -213,7 +219,8 @@ build_rv64: - ./config_rv64.sh - make -j "$NJOBS" - make -C test SIMU='qemu-riscv64 -L /usr/riscv64-linux-gnu' EXECUTE='qemu-riscv64 -L /usr/riscv64-linux-gnu' all test - - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='riscv64-linux-gnu-gcc' EXECUTE='qemu-riscv64 -L /usr/riscv64-linux-gnu' CCOMPOPTS='-static' TARGET_CFLAGS='-static' + - ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='riscv64-linux-gnu-gcc' EXECUTE='qemu-riscv64 -L /usr/riscv64-linux-gnu' + - ulimit -s65536 && make -C test/monniaux/csmith TARGET_CC='riscv64-linux-gnu-gcc' EXECUTE='timeout 10s qemu-riscv64 -L /usr/riscv64-linux-gnu' CCOMPOPTS='-static' TARGET_CFLAGS='-static' rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always @@ -266,6 +273,7 @@ build_kvx: - source /opt/kalray/accesscore/kalray.sh && make -j "$NJOBS" - source /opt/kalray/accesscore/kalray.sh && make -C test CCOMPOPTS=-static SIMU='kvx-cluster -- ' EXECUTE='kvx-cluster -- ' all test - source /opt/kalray/accesscore/kalray.sh && ulimit -s65536 && make -C test/monniaux/yarpgen TARGET_CC='kvx-cos-gcc' EXECUTE='kvx-cluster -- ' CCOMPOPTS='-static' TARGET_CFLAGS='-static' + - source /opt/kalray/accesscore/kalray.sh && ulimit -s65536 && make -C test/monniaux/csmith TARGET_CC='kvx-cos-gcc' EXECUTE='timeout 10s kvx-cluster -- ' CCOMPOPTS='-static' TARGET_CFLAGS='-static' rules: - if: '$CI_COMMIT_BRANCH == "kvx-work"' when: always diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 25bd2c78..bcbf0668 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -109,7 +109,7 @@ let option_fexpanse_rtlcond = ref false let option_fexpanse_others = ref false let option_fforward_moves = ref false let option_fmove_loop_invariants = ref false -let option_fnontrap_loads = ref true +let option_fnontrap_loads = ref false let option_all_loads_nontrap = ref false let option_inline_auto_threshold = ref 0 let option_profile_arcs = ref false diff --git a/scheduling/BTLScheduleraux.ml b/scheduling/BTLScheduleraux.ml index 75672243..0e682c4c 100644 --- a/scheduling/BTLScheduleraux.ml +++ b/scheduling/BTLScheduleraux.ml @@ -272,7 +272,7 @@ let schedule_blk n ibf btl = | None -> btl let turn_all_loads_nontrap n ibf btl = - if not !config.has_non_trapping_loads then btl + if not !config.has_non_trapping_loads || not !Clflags.option_fnontrap_loads then btl else let rec traverse_rec ib = match ib with diff --git a/test/gourdinl/postpass_alternate_str.c b/test/gourdinl/postpass_alternate_str.c new file mode 100644 index 00000000..99c50d7d --- /dev/null +++ b/test/gourdinl/postpass_alternate_str.c @@ -0,0 +1,11 @@ +long a; +short *b; +void c() { + long d = &a; + char e = 0; + long f[4] = {&e}; + if (*b) + if (c) { + long g = &d; + } +} diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index 56313452..aa4eccab 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -1,23 +1,88 @@ -CSMITH?=/local/monniaux/packages/csmith-2.3.0/bin/csmith -MAX=1000 +INCLUDES=-I csmith/include/csmith-2.3.0/ +TARGET_CCOMP=../../../ccomp +TARGET_CC=gcc -include ../rules.mk -KVX_CCOMPFLAGS+=-I/local/monniaux/packages/csmith-2.3.0/include/csmith-2.3.0 -fstruct-passing -fbitfields +ifndef EXECUTE +EXECUTE=timeout 2s +endif -TARGETS_S=$(shell seq --format src%06.f.ccomp.kvx.s 0 $(MAX)) -TARGETS_C=$(shell seq --format src%06.f.c 0 $(MAX)) -TARGETS_O=$(shell seq --format src%06.f.ccomp.kvx.o 0 $(MAX)) +CFLAGS += -Wno-incompatible-pointer-types -all: c s o +ifndef CSMITH +CSMITH=csmith/bin/csmith +endif -s: $(TARGETS_S) -c: $(TARGETS_C) -o: $(TARGETS_O) +MAX=300 +PREFIX=ran%06.f -src%.c : - $(CSMITH) --output $@ --seed $* +CCOMPOTS=-static +CCOMPFLAGS+= -fstruct-passing -fbitfields -fno-cse2 -stdlib ../../../runtime + +TESTS_C=$(shell seq --format $(PREFIX)/source.c 1 $(MAX)) + +TESTS_CCOMP_TARGET_S=$(TEST_C:.c=.ccomp.target.s) +TESTS_GCC_TARGET_S=$(TEST_C:.c=.gcc.target.s) +TESTS_GCC_HOST_S=$(TEST_C:.c=.gcc.host.s) +TESTS_CCOMP_TARGET_OUT=$(shell seq --format $(PREFIX)/example.ccomp.target.out 1 $(MAX)) +TESTS_GCC_TARGET_OUT=$(shell seq --format $(PREFIX)/example.gcc.target.out 1 $(MAX)) +TESTS_GCC_HOST_OUT=$(shell seq --format $(PREFIX)/example.gcc.host.out 1 $(MAX)) +TESTS_CMP=$(shell seq --format $(PREFIX)/example.target.cmp 1 $(MAX)) # $(shell seq --format $(PREFIX)/example.host_target.cmp 1 $(MAX)) + + +all: $(TESTS_CCOMP_TARGET_OUT) $(TESTS_GCC_TARGET_OUT) $(TESTS_CCOMP_TARGET_S) $(TESTS_GCC_TARGET_S) $(TESTS_CMP) $(TESTS_C) + +$(TESTS_C): $(CSMITH) + +tests_c: $(TESTS_C) + +tests_s: $(TESTS_CCOMP_TARGET_S) + +%.ccomp.target.s : %.c + $(TARGET_CCOMP) $(INCLUDES) $(CCOMPOPTS) $(CCOMPFLAGS) -S -o $@ $< + +%.gcc.target.s : %.c + $(TARGET_CC) $(INCLUDES) $(CFLAGS) -S -o $@ $< + +%.gcc.host.s : %.c + $(CC) $(INCLUDES) $(CFLAGS) -S -o $@ $< + +%.target.o : %.target.s + $(TARGET_CC) -c -o $@ $< + +%.host.o : %.host.s + $(CC) $(CFLAGS) -c -o $@ $< + +%.target.out : %.target + $(EXECUTE) $< | tee $@ + +%.host.out : %.host + ./$< | tee $@ + +ran%/example.ccomp.target: ran%/source.ccomp.target.o + $(TARGET_CCOMP) $(CCOMPOPTS) $(CCOMPFLAGS) $+ -o $@ + +ran%/example.gcc.target: ran%/source.gcc.target.o + $(TARGET_CC) $(TARGET_CFLAGS) $+ -o $@ + +ran%/example.gcc.host: ran%/source.gcc.host.o + $(CC) $(CFLAGS) $+ -o $@ + +ran%/source.c: + mkdir -p ran$* + $(CSMITH) --seed $* --output ran$*/source.c + +ran%/example.target.cmp : ran%/example.gcc.target.out ran%/example.ccomp.target.out + cmp $+ > $@ + +ran%/example.host_target.cmp : ran%/example.gcc.host.out ran%/example.ccomp.target.out + cmp $+ > $@ + +.PHONY: all clean tests_c tests_c clean: - -rm -f $(TARGETS_C) $(TARGETS_S) $(TARGETS_O) + -rm -rf ran* -.PHONY: s c o clean +csmith/bin/csmith: + curl -L -o csmith-2.3.0.tar.gz https://embed.cs.utah.edu/csmith/csmith-2.3.0.tar.gz + tar xfz csmith-2.3.0.tar.gz + WD=`pwd` && cd csmith-2.3.0 && ./configure --prefix=$$WD/csmith && make install diff --git a/test/monniaux/csmith/Makefile.old b/test/monniaux/csmith/Makefile.old new file mode 100644 index 00000000..56313452 --- /dev/null +++ b/test/monniaux/csmith/Makefile.old @@ -0,0 +1,23 @@ +CSMITH?=/local/monniaux/packages/csmith-2.3.0/bin/csmith +MAX=1000 + +include ../rules.mk +KVX_CCOMPFLAGS+=-I/local/monniaux/packages/csmith-2.3.0/include/csmith-2.3.0 -fstruct-passing -fbitfields + +TARGETS_S=$(shell seq --format src%06.f.ccomp.kvx.s 0 $(MAX)) +TARGETS_C=$(shell seq --format src%06.f.c 0 $(MAX)) +TARGETS_O=$(shell seq --format src%06.f.ccomp.kvx.o 0 $(MAX)) + +all: c s o + +s: $(TARGETS_S) +c: $(TARGETS_C) +o: $(TARGETS_O) + +src%.c : + $(CSMITH) --output $@ --seed $* + +clean: + -rm -f $(TARGETS_C) $(TARGETS_S) $(TARGETS_O) + +.PHONY: s c o clean |