Esempio n. 1
0
    def run(self, cwd, args):
        # save current Directory
        self.currentDir = os.getcwd()
        os.chdir(_benchmarksDirectory())

        f = open(os.devnull, 'w')

        mx_sulong.ensureLLVMBinariesExist()
        benchmarkDir = args[0]

        # enter benchmark dir
        os.chdir(benchmarkDir)

        # create directory for executable of this vm
        if not os.path.exists(self.name()):
            os.makedirs(self.name())
        os.chdir(self.name())

        if os.path.exists('bench'):
            os.remove('bench')

        env = os.environ.copy()
        env['CFLAGS'] = ' '.join(_env_flags + ['-lm', '-lgmp'])
        env['LLVM_COMPILER'] = 'clang'
        env['CC'] = 'wllvm'
        env['VPATH'] = '..'

        cmdline = ['make', '-f', '../Makefile']

        mx.run(cmdline, out=f, err=f, env=env)
        mx.run(['extract-bc', 'bench'], out=f, err=f)
        mx_sulong.opt(['-o', 'bench.bc', 'bench.bc'] + [
            '-mem2reg', '-globalopt', '-simplifycfg', '-constprop',
            '-instcombine', '-dse', '-loop-simplify', '-reassociate', '-licm',
            '-gvn'
        ],
                      out=f,
                      err=f)

        suTruffleOptions = [
            '-Dgraal.TruffleBackgroundCompilation=false',
            '-Dgraal.TruffleTimeThreshold=1000000',
            '-Dgraal.TruffleInliningMaxCallerSize=10000',
            '-Dgraal.TruffleCompilationExceptionsAreFatal=true',
            mx_subst.path_substitutions.substitute(
                '-Dpolyglot.llvm.libraryPath=<path:SULONG_LIBS>'),
            '-Dpolyglot.llvm.libraries=libgmp.so.10'
        ]
        sulongCmdLine = suTruffleOptions + mx_sulong.getClasspathOptions() + [
            '-XX:-UseJVMCIClassLoader',
            "com.oracle.truffle.llvm.launcher.LLVMLauncher"
        ] + ['bench.bc']
        result = self.host_vm().run(cwd, sulongCmdLine + args)

        # reset current Directory
        os.chdir(self.currentDir)

        return result
    def run(self, cwd, args):
        # save current Directory
        self.currentDir = os.getcwd()
        os.chdir(_benchmarksDirectory())

        f = open(os.devnull, 'w')

        mx_sulong.ensureLLVMBinariesExist()
        benchmarkDir = args[0]

        # enter benchmark dir
        os.chdir(benchmarkDir)

        # create directory for executable of this vm
        if not os.path.exists(self.name()):
            os.makedirs(self.name())
        os.chdir(self.name())

        if os.path.exists('bench'):
            os.remove('bench')

        env = os.environ.copy()
        env['CFLAGS'] = ' '.join(_env_flags + ['-lm', '-lgmp'])
        env['LLVM_COMPILER'] = 'clang'
        env['CC'] = 'wllvm'
        env['VPATH'] = '..'

        cmdline = ['make', '-f', '../Makefile']

        mx.run(cmdline, out=f, err=f, env=env)
        mx.run(['extract-bc', 'bench'], out=f, err=f)
        mx_sulong.opt(['-o', 'bench.bc', 'bench.bc'] +
                      mx_sulong.getStandardLLVMOptFlags(),
                      out=f,
                      err=f)

        suTruffleOptions = [
            '-Dgraal.TruffleBackgroundCompilation=false',
            '-Dgraal.TruffleTimeThreshold=1000000',
            '-Dgraal.TruffleInliningMaxCallerSize=10000',
            '-Dgraal.TruffleCompilationExceptionsAreFatal=true',
        ]
        sulongCmdLine = suTruffleOptions + [
            mx_sulong.getSearchPathOption()
        ] + mx_sulong.getBitcodeLibrariesOption(
        ) + mx_sulong.getClasspathOptions() + [
            '-XX:-UseJVMCIClassLoader', "com.oracle.truffle.llvm.Sulong"
        ] + ['bench.bc']
        result = self.host_vm().run(cwd, sulongCmdLine + args)

        # reset current Directory
        os.chdir(self.currentDir)

        return result
Esempio n. 3
0
    def run(self, cwd, args):
        # save current Directory
        self.currentDir = os.getcwd()
        os.chdir(_benchmarksDirectory())

        f = open(os.devnull, 'w')

        mx_sulong.ensureLLVMBinariesExist()
        benchmarkDir = args[0]

        # enter benchmark dir
        os.chdir(benchmarkDir)

        # create directory for executable of this vm
        if not os.path.exists(self.name()):
            os.makedirs(self.name())
        os.chdir(self.name())

        if os.path.exists('bench'):
            os.remove('bench')

        env = os.environ.copy()
        env['CFLAGS'] = ' '.join(_env_flags + ['-lm', '-lgmp'])
        env['LLVM_COMPILER'] = 'clang'
        env['CC'] = 'wllvm'
        env['VPATH'] = '..'

        cmdline = ['make', '-f', '../Makefile']

        mx.run(cmdline, out=f, err=f, env=env)
        mx.run(['extract-bc', 'bench'], out=f, err=f)
        mx_sulong.opt(['-o', 'bench.bc', 'bench.bc'] + ['-mem2reg', '-globalopt', '-simplifycfg', '-constprop', '-instcombine', '-dse', '-loop-simplify', '-reassociate', '-licm', '-gvn'], out=f, err=f)

        suTruffleOptions = [
            '-Dgraal.TruffleBackgroundCompilation=false',
            '-Dgraal.TruffleTimeThreshold=1000000',
            '-Dgraal.TruffleInliningMaxCallerSize=10000',
            '-Dgraal.TruffleCompilationExceptionsAreFatal=true',
            mx_subst.path_substitutions.substitute('-Dpolyglot.llvm.libraryPath=<path:SULONG_LIBS>'),
            '-Dpolyglot.llvm.libraries=libgmp.so.10']
        sulongCmdLine = suTruffleOptions + mx_sulong.getClasspathOptions() + ['-XX:-UseJVMCIClassLoader', "com.oracle.truffle.llvm.launcher.LLVMLauncher"] + ['bench.bc']
        result = self.host_vm().run(cwd, sulongCmdLine + args)

        # reset current Directory
        os.chdir(self.currentDir)

        return result