Lines 142-148
static llvm::Pass *CreateFixBooleanSelectPass();
Link Here
|
142 |
getenv("FUNC"), strlen(getenv("FUNC")))))) { \ |
142 |
getenv("FUNC"), strlen(getenv("FUNC")))))) { \ |
143 |
fprintf(stderr, "Start of " NAME "\n"); \ |
143 |
fprintf(stderr, "Start of " NAME "\n"); \ |
144 |
fprintf(stderr, "---------------\n"); \ |
144 |
fprintf(stderr, "---------------\n"); \ |
145 |
bb.dump(); \ |
145 |
bb.print(llvm::outs(), false); \ |
146 |
fprintf(stderr, "---------------\n\n"); \ |
146 |
fprintf(stderr, "---------------\n\n"); \ |
147 |
} else /* eat semicolon */ |
147 |
} else /* eat semicolon */ |
148 |
|
148 |
|
Lines 152-158
static llvm::Pass *CreateFixBooleanSelectPass();
Link Here
|
152 |
getenv("FUNC"), strlen(getenv("FUNC")))))) { \ |
152 |
getenv("FUNC"), strlen(getenv("FUNC")))))) { \ |
153 |
fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \ |
153 |
fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \ |
154 |
fprintf(stderr, "---------------\n"); \ |
154 |
fprintf(stderr, "---------------\n"); \ |
155 |
bb.dump(); \ |
155 |
bb.print(llvm::outs(), false); \ |
156 |
fprintf(stderr, "---------------\n\n"); \ |
156 |
fprintf(stderr, "---------------\n\n"); \ |
157 |
} else /* eat semicolon */ |
157 |
} else /* eat semicolon */ |
158 |
#else |
158 |
#else |
Lines 453-459
void Optimize(llvm::Module *module, int optLevel) {
Link Here
|
453 |
#ifndef ISPC_NO_DUMPS |
453 |
#ifndef ISPC_NO_DUMPS |
454 |
if (g->debugPrint) { |
454 |
if (g->debugPrint) { |
455 |
printf("*** Code going into optimization ***\n"); |
455 |
printf("*** Code going into optimization ***\n"); |
456 |
module->dump(); |
456 |
module->print(llvm::outs(), nullptr); |
457 |
} |
457 |
} |
458 |
#endif |
458 |
#endif |
459 |
DebugPassManager optPM; |
459 |
DebugPassManager optPM; |
Lines 666-672
void Optimize(llvm::Module *module, int optLevel) {
Link Here
|
666 |
#ifndef ISPC_NO_DUMPS |
666 |
#ifndef ISPC_NO_DUMPS |
667 |
if (g->debugPrint) { |
667 |
if (g->debugPrint) { |
668 |
printf("\n*****\nFINAL OUTPUT\n*****\n"); |
668 |
printf("\n*****\nFINAL OUTPUT\n*****\n"); |
669 |
module->dump(); |
669 |
module->print(llvm::outs(), nullptr); |
670 |
} |
670 |
} |
671 |
#endif |
671 |
#endif |
672 |
} |
672 |
} |
Lines 4256-4262
char DebugPass::ID = 0;
Link Here
|
4256 |
bool DebugPass::runOnModule(llvm::Module &module) { |
4256 |
bool DebugPass::runOnModule(llvm::Module &module) { |
4257 |
fprintf(stderr, "%s", str_output); |
4257 |
fprintf(stderr, "%s", str_output); |
4258 |
fflush(stderr); |
4258 |
fflush(stderr); |
4259 |
module.dump(); |
4259 |
module.print(llvm::outs(), nullptr); |
4260 |
return true; |
4260 |
return true; |
4261 |
} |
4261 |
} |
4262 |
|
4262 |
|
Lines 4303-4309
void DebugPassFile::run(llvm::Module &module, bool init) {
Link Here
|
4303 |
snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str()); |
4303 |
snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str()); |
4304 |
llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None); |
4304 |
llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None); |
4305 |
Assert(!EC && "IR dump file creation failed!"); |
4305 |
Assert(!EC && "IR dump file creation failed!"); |
4306 |
module.print(OS, 0); |
4306 |
module.print(OS, nullptr); |
4307 |
} |
4307 |
} |
4308 |
|
4308 |
|
4309 |
bool DebugPassFile::runOnModule(llvm::Module &module) { |
4309 |
bool DebugPassFile::runOnModule(llvm::Module &module) { |