swr/rast: Optimize DumpToFile output size
authorGeorge Kyriazis <george.kyriazis@intel.com>
Wed, 24 Jan 2018 20:15:02 +0000 (14:15 -0600)
committerGeorge Kyriazis <george.kyriazis@intel.com>
Thu, 25 Jan 2018 19:26:49 +0000 (13:26 -0600)
Modify DumpToFile to only dump the function, not the entire module.
Reduces file sizes and speeds up the dumping.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp

index 675438be72f947579fac732c8f236faf52905ff4..71057660eb28380628b8013ddd87741f4211f5db 100644 (file)
@@ -421,8 +421,7 @@ void JitManager::DumpToFile(Function *f, const char *fileName)
         sprintf(fName, "%s.%s.ll", funcName, fileName);
 #endif
         raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
-        Module* pModule = f->getParent();
-        pModule->print(fd, nullptr);
+        f->print(fd, nullptr);
 
 #if defined(_WIN32)
         sprintf(fName, "%s\\cfg.%s.%s.dot", outDir.c_str(), funcName, fileName);