diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-10-02 21:16:07 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-10-02 21:16:07 +0200 |
commit | b5101e0d9c21810bd40253e3676838f87558e879 (patch) | |
tree | 57f307cf4c5fc4020f4e8724be49877fe1ff0f2b | |
parent | 99d46d24e0282c3e4c5fe8765f4e755a1b3b0253 (diff) | |
parent | 043a6caa766bf1f3508b389cd3c7ae69d596eded (diff) | |
download | compcert-kvx-b5101e0d9c21810bd40253e3676838f87558e879.tar.gz compcert-kvx-b5101e0d9c21810bd40253e3676838f87558e879.zip |
Merge remote-tracking branch 'origin/kvx-work' into kvx-test-prepass
-rw-r--r-- | backend/Duplicateaux.ml | 11 | ||||
-rw-r--r-- | test/kvx/instr/Makefile | 10 | ||||
-rw-r--r-- | test/kvx/interop/Makefile | 6 | ||||
-rw-r--r-- | test/kvx/lib/Makefile | 6 | ||||
-rw-r--r-- | test/kvx/mmult/Makefile | 8 | ||||
-rw-r--r-- | test/kvx/prng/Makefile | 5 | ||||
-rw-r--r-- | test/kvx/sort/Makefile | 11 |
7 files changed, 38 insertions, 19 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml index 00819834..1297ec90 100644 --- a/backend/Duplicateaux.ml +++ b/backend/Duplicateaux.ml @@ -314,7 +314,9 @@ let get_directions code entrypoint = begin (* debug "\n"; *) List.iter (fun n -> match (get_some @@ PTree.get n code) with - | Icond (cond, lr, ifso, ifnot, _) -> + | Icond (cond, lr, ifso, ifnot, pred) -> + (match pred with Some _ -> debug "RTL node %d already has prediction information\n" (P.to_int n) + | None -> (* debug "Analyzing %d.." (P.to_int n); *) let heuristics = [ do_opcode_heuristic; do_return_heuristic; do_loop2_heuristic loop_info n; do_loop_heuristic; do_call_heuristic; @@ -333,6 +335,7 @@ let get_directions code entrypoint = begin | None -> debug "\tUNSURE\n"); debug "---------------------------------------\n" end + ) | _ -> () ) bfs_order; !directions @@ -340,7 +343,11 @@ let get_directions code entrypoint = begin end let update_direction direction = function -| Icond (cond, lr, n, n', _) -> Icond (cond, lr, n, n', direction) +| Icond (cond, lr, n, n', pred) -> + (* only update if there is no prior existing branch prediction *) + (match pred with + | None -> Icond (cond, lr, n, n', direction) + | Some _ -> Icond (cond, lr, n, n', pred) ) | i -> i let rec update_direction_rec directions = function diff --git a/test/kvx/instr/Makefile b/test/kvx/instr/Makefile index e4f964b3..fce32178 100644 --- a/test/kvx/instr/Makefile +++ b/test/kvx/instr/Makefile @@ -1,15 +1,15 @@ SHELL := /bin/bash -KVXC ?= k1-cos-gcc +KVXC ?= kvx-elf-gcc CC ?= gcc CCOMP ?= ccomp OPTIM ?= -O2 CFLAGS ?= $(OPTIM) CCOMPFLAGS ?= $(CFLAGS) -SIMU ?= k1-mppa +SIMU ?= kvx-mppa TIMEOUT ?= --signal=SIGTERM 120s DIFF ?= python2.7 floatcmp.py -reltol .00001 -HARDRUN ?= k1-jtag-runner +HARDRUN ?= kvx-jtag-runner DIR=./ SRCDIR=$(DIR) @@ -64,7 +64,7 @@ simutest: $(X86_GCC_OUT) $(GCC_SIMUOUT) x86out=$(OUTDIR)/$$test.x86-gcc.out;\ gccout=$(OUTDIR)/$$test.gcc.simu.out;\ if grep "__KVX__" -q $$test.c; then\ - printf "$(YELLOW)UNTESTED: $$test.c contains an \`#ifdef __KVX__\`\n";\ + printf "$(YELLOW)UNTESTED: $$test.c contains an \`#ifdef __KVX__\`\n$(NC)";\ elif $(DIFF) $$x86out $$gccout > /dev/null; test $${PIPESTATUS[0]} -ne 0; then\ >&2 printf "$(RED)ERROR: $$x86out and $$gccout differ$(NC)\n";\ else\ @@ -92,7 +92,7 @@ hardtest: $(X86_GCC_OUT) $(GCC_HARDOUT) x86out=$(OUTDIR)/$$test.x86-gcc.out;\ gccout=$(OUTDIR)/$$test.gcc.hard.out;\ if grep "__KVX__" -q $$test.c; then\ - printf "$(YELLOW)UNTESTED: $$test.c contains an \`#ifdef __KVX__\`\n";\ + printf "$(YELLOW)UNTESTED: $$test.c contains an \`#ifdef __KVX__\`\n$(NC)";\ elif $(DIFF) $$x86out $$gccout > /dev/null; test $${PIPESTATUS[0]} -ne 0; then\ >&2 printf "$(RED)ERROR: $$x86out and $$gccout differ$(NC)\n";\ else\ diff --git a/test/kvx/interop/Makefile b/test/kvx/interop/Makefile index a0d4d7da..aa018aac 100644 --- a/test/kvx/interop/Makefile +++ b/test/kvx/interop/Makefile @@ -1,12 +1,12 @@ SHELL := /bin/bash -KVXC ?= k1-cos-gcc +KVXC ?= kvx-elf-gcc CC ?= gcc CCOMP ?= ccomp CFLAGS ?= -O2 -Wno-varargs -SIMU ?= k1-mppa +SIMU ?= kvx-mppa TIMEOUT ?= --signal=SIGTERM 120s -HARDRUN ?= k1-jtag-runner +HARDRUN ?= kvx-jtag-runner DIR=./ SRCDIR=$(DIR) diff --git a/test/kvx/lib/Makefile b/test/kvx/lib/Makefile index 5a947bb3..7df7dd16 100644 --- a/test/kvx/lib/Makefile +++ b/test/kvx/lib/Makefile @@ -1,10 +1,10 @@ -KVXC ?= k1-cos-gcc -K1AR ?= k1-cos-ar +KVXC ?= kvx-elf-gcc +K1AR ?= kvx-elf-ar CC ?= gcc AR ?= gcc-ar CCOMP ?= ccomp CFLAGS ?= -O1 -Wl,--wrap=printf -SIMU ?= k1-mppa +SIMU ?= kvx-mppa TIMEOUT ?= --signal=SIGTERM 60s DIR=./ diff --git a/test/kvx/mmult/Makefile b/test/kvx/mmult/Makefile index e7cd890e..252f8911 100644 --- a/test/kvx/mmult/Makefile +++ b/test/kvx/mmult/Makefile @@ -1,8 +1,8 @@ -KVXC ?= k1-cos-gcc +KVXC ?= kvx-elf-gcc CC ?= gcc CCOMP ?= ccomp CFLAGS ?= -O2 -SIMU ?= k1-mppa +SIMU ?= kvx-mppa TIMEOUT ?= 10s KVXCPATH=$(shell which $(KVXC)) @@ -65,3 +65,7 @@ check: $(CCOMP_OUT) $(STUB_OUT) else\ echo "GOOD kvx: $< succeeded";\ fi + +.PHONY: +clean: + rm -f *.out mmult-test-ccomp-kvx mmult-test-gcc-kvx mmult-test-gcc-x86 diff --git a/test/kvx/prng/Makefile b/test/kvx/prng/Makefile index 68e5ffc9..b97f4aa4 100644 --- a/test/kvx/prng/Makefile +++ b/test/kvx/prng/Makefile @@ -1,8 +1,8 @@ -KVXC ?= k1-cos-gcc +KVXC ?= kvx-elf-gcc CC ?= gcc CCOMP ?= ccomp CFLAGS ?= -O2 -SIMU ?= k1-mppa +SIMU ?= kvx-mppa TIMEOUT ?= 10s KVXCPATH=$(shell which $(KVXC)) @@ -67,3 +67,4 @@ check: $(CCOMP_OUT) $(STUB_OUT) .PHONY: clean: rm -f prng-test-gcc-x86 prng-test-gcc-kvx prng-test-ccomp-kvx + rm -f *.out diff --git a/test/kvx/sort/Makefile b/test/kvx/sort/Makefile index c4090352..1afab6e9 100644 --- a/test/kvx/sort/Makefile +++ b/test/kvx/sort/Makefile @@ -1,8 +1,8 @@ -KVXC ?= k1-cos-gcc +KVXC ?= kvx-elf-gcc CC ?= gcc CCOMP ?= ccomp CFLAGS ?= -O2 -SIMU ?= k1-mppa +SIMU ?= kvx-mppa TIMEOUT ?= 10s KVXCPATH=$(shell which $(KVXC)) @@ -89,3 +89,10 @@ check: $(STUB_OUT) $(CCOMP_OUT) echo "GOOD kvx: $$test succeeded";\ fi;\ done + +.PHONY: +clean: + for test in insertion main merge selection; do\ + rm -f $$test-ccomp-kvx $$test-gcc-kvx $$test-gcc-x86;\ + done + rm -f *.out |