Merge branch 'knl-support' of https://github.com/ncos/ispc into knl-support

This commit is contained in:
Anton Mitrokhin
2015-04-02 12:42:29 +03:00
3 changed files with 50 additions and 40 deletions

View File

@@ -434,7 +434,7 @@ def execute_stability(stability, R, print_version):
str_time = " " + time + "\n" str_time = " " + time + "\n"
else: else:
str_time = "\n" str_time = "\n"
print_debug(temp[4][1:-3] + str_fails + str_new_fails + str_new_passes + str_time, False, stability_log) print_debug(temp[4][1:-3] + stability1.ispc_flags + str_fails + str_new_fails + str_new_passes + str_time, False, stability_log)
''' '''
@@ -519,12 +519,18 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
LLVM = [] LLVM = []
targets = [] targets = []
sde_targets = [] sde_targets = []
dbg_begin = 0
dbg_total = 1
# parsing option only, update parameters of run # parsing option only, update parameters of run
if "-O2" in only: if "-O2" in only:
opts.append(False) opts.append(False)
if "-O0" in only: if "-O0" in only:
opts.append(True) opts.append(True)
if "debug" in only:
if not ("nodebug" in only):
dbg_begin = 1
dbg_total = 2
if "x86" in only and not ("x86-64" in only): if "x86" in only and not ("x86-64" in only):
archs.append("x86") archs.append("x86")
if "x86-64" in only: if "x86-64" in only:
@@ -585,6 +591,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
LLVM = [newest_LLVM, "trunk"] LLVM = [newest_LLVM, "trunk"]
gen_archs = ["x86-64"] gen_archs = ["x86-64"]
knc_archs = ["x86-64"] knc_archs = ["x86-64"]
knl_archs = ["x86-64"]
need_LLVM = check_LLVM(LLVM) need_LLVM = check_LLVM(LLVM)
for i in range(0,len(need_LLVM)): for i in range(0,len(need_LLVM)):
build_LLVM(need_LLVM[i], "", "", "", False, False, False, True, False, make, options.gcc_toolchain_path) build_LLVM(need_LLVM[i], "", "", "", False, False, False, True, False, make, options.gcc_toolchain_path)
@@ -593,6 +600,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
R = [[[],[]],[[],[]],[[],[]],[[],[]]] R = [[[],[]],[[],[]],[[],[]],[[],[]]]
print_debug("\n" + common.get_host_name() + "\n", False, stability_log) print_debug("\n" + common.get_host_name() + "\n", False, stability_log)
print_debug("\n_________________________STABILITY REPORT_________________________\n", False, stability_log) print_debug("\n_________________________STABILITY REPORT_________________________\n", False, stability_log)
ispc_flags_tmp = stability.ispc_flags
for i in range(0,len(LLVM)): for i in range(0,len(LLVM)):
R_tmp = [[[],[]],[[],[]],[[],[]],[[],[]]] R_tmp = [[[],[]],[[],[]],[[],[]],[[],[]]]
print_version = 2 print_version = 2
@@ -605,34 +613,50 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
# sometimes clang++ is not avaluable. if --ispc-build-compiler = gcc we will pass in g++ compiler # sometimes clang++ is not avaluable. if --ispc-build-compiler = gcc we will pass in g++ compiler
if options.ispc_build_compiler == "gcc": if options.ispc_build_compiler == "gcc":
stability.compiler_exe = "g++" stability.compiler_exe = "g++"
# but 'knc' target is supported only by icpc, so set explicitly # but 'knc/knl' target is supported only by icpc, so set explicitly
if "knc" in targets[j]: if ("knc" in targets[j]) or ("knl" in targets[j]):
stability.compiler_exe = "icpc" stability.compiler_exe = "icpc"
# now set archs for targets # now set archs for targets
if "generic" in targets[j]: if "generic" in targets[j]:
arch = gen_archs arch = gen_archs
elif "knc" in targets[j]: elif "knc" in targets[j]:
arch = knc_archs arch = knc_archs
elif "knl" in targets[j]:
arch = knl_archs
else: else:
arch = archs arch = archs
for i1 in range(0,len(arch)): for i1 in range(0,len(arch)):
for i2 in range(0,len(opts)): for i2 in range(0,len(opts)):
stability.arch = arch[i1] for i3 in range(dbg_begin,dbg_total):
stability.no_opt = opts[i2] stability.arch = arch[i1]
try: stability.no_opt = opts[i2]
execute_stability(stability, R_tmp, print_version) stability.ispc_flags = ispc_flags_tmp
except: if (i3 != 0):
print_debug("ERROR: Exception in execute_stability - maybe some test subprocess terminated before it should have\n", False, stability_log) stability.ispc_flags += " -g"
print_version = 0 try:
execute_stability(stability, R_tmp, print_version)
except:
print_debug("ERROR: Exception in execute_stability - maybe some test subprocess terminated before it should have\n", False, stability_log)
print_version = 0
for j in range(0,len(sde_targets)): for j in range(0,len(sde_targets)):
stability.target = sde_targets[j][1] stability.target = sde_targets[j][1]
stability.wrapexe = os.environ["SDE_HOME"] + "/sde " + sde_targets[j][0] + " -- " stability.wrapexe = os.environ["SDE_HOME"] + "/sde " + sde_targets[j][0] + " -- "
for i1 in range(0,len(archs)): if "knc" in stability.target:
arch = knc_archs
elif "knl" in stability.target:
arch = knl_archs
else:
arch = archs
for i1 in range(0,len(arch)):
for i2 in range(0,len(opts)): for i2 in range(0,len(opts)):
stability.arch = archs[i1] for i3 in range(dbg_begin,dbg_total):
stability.no_opt = opts[i2] stability.arch = arch[i1]
execute_stability(stability, R_tmp, print_version) stability.no_opt = opts[i2]
print_version = 0 stability.ispc_flags = ispc_flags_tmp
if (i3 != 0):
stability.ispc_flags += " -g"
execute_stability(stability, R_tmp, print_version)
print_version = 0
# Output testing results separate for each tested LLVM version # Output testing results separate for each tested LLVM version
R = concatenate_test_results(R, R_tmp) R = concatenate_test_results(R, R_tmp)
output_test_results(R_tmp) output_test_results(R_tmp)
@@ -784,7 +808,7 @@ def Main():
if os.environ.get("SMTP_ISPC") == None: if os.environ.get("SMTP_ISPC") == None:
error("you have no SMTP_ISPC in your environment for option notify", 1) error("you have no SMTP_ISPC in your environment for option notify", 1)
if options.only != "": if options.only != "":
test_only_r = " 3.2 3.3 3.4 3.5 3.6 trunk current build stability performance x86 x86-64 -O0 -O2 native " test_only_r = " 3.2 3.3 3.4 3.5 3.6 trunk current build stability performance x86 x86-64 -O0 -O2 native debug nodebug "
test_only = options.only.split(" ") test_only = options.only.split(" ")
for iterator in test_only: for iterator in test_only:
if not (" " + iterator + " " in test_only_r): if not (" " + iterator + " " in test_only_r):
@@ -829,6 +853,7 @@ def Main():
error("It's forbidden to run alloy two times in a second, logs are in ./logs", 1) error("It's forbidden to run alloy two times in a second, logs are in ./logs", 1)
os.rename(f_date, date_name) os.rename(f_date, date_name)
print_debug("Logs are in " + date_name + "\n", False, "") print_debug("Logs are in " + date_name + "\n", False, "")
exit(0)
###Main### ###Main###
from optparse import OptionParser from optparse import OptionParser
@@ -933,8 +958,9 @@ if __name__ == '__main__':
help='display time of testing', default=False, action='store_true') help='display time of testing', default=False, action='store_true')
run_group.add_option('--only', dest='only', run_group.add_option('--only', dest='only',
help='set types of tests. Possible values:\n' + help='set types of tests. Possible values:\n' +
'-O0, -O2, x86, x86-64, stability (test only stability), performance (test only performance)\n' + '-O0, -O2, x86, x86-64, stability (test only stability), performance (test only performance),\n' +
'build (only build with different LLVM), 3.2, 3.3, 3.4, 3.5, 3.6, trunk, native (do not use SDE), current (do not rebuild ISPC).', 'build (only build with different LLVM), 3.2, 3.3, 3.4, 3.5, 3.6, trunk, native (do not use SDE),\n' +
'current (do not rebuild ISPC), debug (only with debug info), nodebug (only without debug info, default).',
default="") default="")
run_group.add_option('--perf_LLVM', dest='perf_llvm', run_group.add_option('--perf_LLVM', dest='perf_llvm',
help='compare LLVM 3.6 with "--compare-with", default trunk', default=False, action='store_true') help='compare LLVM 3.6 with "--compare-with", default trunk', default=False, action='store_true')

View File

@@ -505,17 +505,6 @@ Function::GenerateIR() {
} }
if (m->errorCount == 0) { if (m->errorCount == 0) {
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) // LLVM 3.5+
if (llvm::verifyFunction(*function) == true) {
#else
if (llvm::verifyFunction(*function, llvm::ReturnStatusAction) == true) {
#endif
if (g->debugPrint)
function->dump();
FATAL("Function verificication failed");
}
// If the function is 'export'-qualified, emit a second version of // If the function is 'export'-qualified, emit a second version of
// it without a mask parameter and without name mangling so that // it without a mask parameter and without name mangling so that
// the application can call it // the application can call it
@@ -568,17 +557,6 @@ Function::GenerateIR() {
emitCode(&ec, appFunction, firstStmtPos); emitCode(&ec, appFunction, firstStmtPos);
if (m->errorCount == 0) { if (m->errorCount == 0) {
sym->exportedFunction = appFunction; sym->exportedFunction = appFunction;
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) // LLVM 3.5+
if (llvm::verifyFunction(*appFunction) == true) {
#else
if (llvm::verifyFunction(*appFunction,
llvm::ReturnStatusAction) == true) {
#endif
if (g->debugPrint)
appFunction->dump();
FATAL("Function verificication failed");
}
} }
#ifdef ISPC_NVPTX_ENABLED #ifdef ISPC_NVPTX_ENABLED
if (g->target->getISA() == Target::NVPTX) if (g->target->getISA() == Target::NVPTX)

View File

@@ -1100,6 +1100,12 @@ Module::writeOutput(OutputType outputType, const char *outFileName,
} }
#endif #endif
// SIC! (verifyModule() == TRUE) means "failed", see llvm-link code.
if ((outputType != Header) && (outputType != Deps)
&& (outputType != HostStub) && (outputType != DevStub)
&& module && llvm::verifyModule(*module))
FATAL("Resulting module verification failed!");
// First, issue a warning if the output file suffix and the type of // First, issue a warning if the output file suffix and the type of
// file being created seem to mismatch. This can help catch missing // file being created seem to mismatch. This can help catch missing
// command-line arguments specifying the output file type. // command-line arguments specifying the output file type.