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"
else:
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 = []
targets = []
sde_targets = []
dbg_begin = 0
dbg_total = 2
# parsing option only, update parameters of run
if "-O2" in only:
opts.append(False)
if "-O0" in only:
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):
archs.append("x86")
if "x86-64" in only:
@@ -589,6 +595,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
R = [[[],[]],[[],[]],[[],[]],[[],[]]]
print_debug("\n" + common.get_host_name() + "\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)):
R_tmp = [[[],[]],[[],[]],[[],[]],[[],[]]]
print_version = 2
@@ -613,8 +620,12 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
arch = archs
for i1 in range(0,len(arch)):
for i2 in range(0,len(opts)):
for i3 in range(dbg_begin,dbg_total):
stability.arch = arch[i1]
stability.no_opt = opts[i2]
stability.ispc_flags = ispc_flags_tmp
if (i3 != 0):
stability.ispc_flags += " -g"
try:
execute_stability(stability, R_tmp, print_version)
except:
@@ -625,8 +636,12 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
stability.wrapexe = os.environ["SDE_HOME"] + "/sde " + sde_targets[j][0] + " -- "
for i1 in range(0,len(archs)):
for i2 in range(0,len(opts)):
for i3 in range(dbg_begin,dbg_total):
stability.arch = archs[i1]
stability.no_opt = opts[i2]
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
@@ -780,7 +795,7 @@ def Main():
if os.environ.get("SMTP_ISPC") == None:
error("you have no SMTP_ISPC in your environment for option notify", 1)
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(" ")
for iterator in test_only:
if not (" " + iterator + " " in test_only_r):
@@ -929,8 +944,9 @@ if __name__ == '__main__':
help='display time of testing', default=False, action='store_true')
run_group.add_option('--only', dest='only',
help='set types of tests. Possible values:\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).',
'-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),\n' +
'current (do not rebuild ISPC), debug (only with debug info), nodebug (only without debug info).',
default="")
run_group.add_option('--perf_LLVM', dest='perf_llvm',
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 !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
// it without a mask parameter and without name mangling so that
// the application can call it
@@ -568,17 +557,6 @@ Function::GenerateIR() {
emitCode(&ec, appFunction, firstStmtPos);
if (m->errorCount == 0) {
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
if (g->target->getISA() == Target::NVPTX)

View File

@@ -1100,6 +1100,12 @@ Module::writeOutput(OutputType outputType, const char *outFileName,
}
#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
// file being created seem to mismatch. This can help catch missing
// command-line arguments specifying the output file type.