#!/bin/tcsh # Script to perform manually a 3 stage bootstrap which goal is to have a new compiler # compiled with the new code generation and test it on itself. # stage 1: ec generates ec_stage1 that will generate code with new code generation # stage 2: ec_stage1 generates ec_stage2 that is generated with new code generation # and that will generate code with new code generation. # stage 3: verification `ec_stage3' and `ec_stage2' should be identical, but time # used to build ec_stage2 should be different from time to build ec_stage3. # Usually it should be shorter to generate ec_stage3, in which case we have # improved the performance of the compiler. set target = "batch" set ec_name = "ecb" set options = "-gc_stats $*" set assertions = "" #set assertions = "-keep" #set target = "bench" #set ec_name = "ec" set compile_type=F_code set secondary_compile_type=W_code #set compile_type=W_code #set secondary_compile_type=F_code # Remove old compilations \rm -rf EIFGENs \rm -f ec_stage1 \rm -f ec_stage2 \rm -f ec_stage3 \rm -rf $compile_type \rm -rf $secondary_compile_type mkdir $compile_type mkdir $secondary_compile_type #First stage of bootstrap echo "Stage 1:" (time $ec_name -local -finalize $assertions -config ec.ecf -target $target -batch $options -clean >& e_comp1 )>> e_comp1 echo " Size is: `du -sh EIFGENs/$target/COMP`" echo " Epr size is: `du -sh EIFGENs/$target/project.epr`" echo " Time is: `tail -1 e_comp1`" chdir EIFGENs/$target/$compile_type echo " Launching C compilation" (time finish_freezing >& ../../../c_comp1 )>> ../../../c_comp1 echo " ec size is: `du -sh $ec_name`" mv $ec_name ../../../ec_stage1 chdir .. mv $compile_type ../../$compile_type/stage1 mv $secondary_compile_type ../../$secondary_compile_type/stage1 chdir ../.. #If first stage succeeded, let's go for Second stage of bootstrap if ( -e ec_stage1 ) then \rm -rf EIFGENs echo "Stage 2:" (time ./ec_stage1 -local -finalize $assertions -config ec.ecf -target $target -batch $options -clean >& e_comp2 )>> e_comp2 echo " Size is: `du -sh EIFGENs/$target/COMP`" echo " Epr size is: `du -sh EIFGENs/$target/project.epr`" echo " Time is: `tail -1 e_comp2`" chdir EIFGENs/$target/$compile_type echo " Launching C compilation" (time finish_freezing >& ../../../c_comp2)>> ../../../c_comp2 echo " ec size is: `du -sh $ec_name`" mv $ec_name ../../../ec_stage2 chdir .. mv $compile_type ../../$compile_type/stage2 mv $secondary_compile_type ../../$secondary_compile_type/stage2 chdir ../.. #if second stage succeeded, let's go for Third and final stage of bootstrap if ( -e ec_stage2 ) then \rm -rf EIFGENs echo "Stage 3:" (time ./ec_stage2 -local -finalize $assertions -config ec.ecf -target $target -batch $options -clean >& e_comp3 )>> e_comp3 echo " Size is: `du -sh EIFGENs/$target/COMP`" echo " Epr size is: `du -sh EIFGENs/$target/project.epr`" echo " Time is: `tail -1 e_comp3`" chdir EIFGENs/$target/$compile_type echo " Launching C compilation" (time finish_freezing >& ../../../c_comp3)>> ../../../c_comp3 echo " ec size is: `du -sh $ec_name`" mv $ec_name ../../../ec_stage3 chdir .. mv $compile_type ../../$compile_type/stage3 mv $secondary_compile_type ../../$secondary_compile_type/stage3 chdir ../.. endif endif