Fixed ISPC debug info generator, added debug tests

This commit is contained in:
Andrey Guskov
2015-03-27 14:52:18 +03:00
parent ef826603a7
commit dd567654e7
3 changed files with 37 additions and 37 deletions

View File

@@ -430,7 +430,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)
''' '''
@@ -515,12 +515,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 = 2
# 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 and not ("nodebug" in only):
dbg_begin = 1
if "nodebug" in only and not ("debug" in only):
dbg_total = 1
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:
@@ -589,6 +595,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
@@ -613,22 +620,30 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
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)): for i1 in range(0,len(archs)):
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 = archs[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)
@@ -780,7 +795,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):
@@ -929,8 +944,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="")
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.