diff --git a/src/midend/Pass/Optimize/LargeArrayToGlobal.cpp b/src/midend/Pass/Optimize/LargeArrayToGlobal.cpp index 9f63dce..12f380e 100644 --- a/src/midend/Pass/Optimize/LargeArrayToGlobal.cpp +++ b/src/midend/Pass/Optimize/LargeArrayToGlobal.cpp @@ -52,14 +52,16 @@ bool LargeArrayToGlobalPass::runOnModule(Module *M, AnalysisManager &AM) { // Calculate the size of the allocated type unsigned size = calculateTypeSize(allocatedType); - - // Debug: print size information - std::cout << "LargeArrayToGlobalPass: Found alloca with size " << size + if(DEBUG){ + // Debug: print size information + std::cout << "LargeArrayToGlobalPass: Found alloca with size " << size << " for type " << typeToString(allocatedType) << std::endl; + } // Convert arrays of 1KB (1024 bytes) or larger to global variables if (size >= 1024) { - std::cout << "LargeArrayToGlobalPass: Converting array of size " << size << " to global" << std::endl; + if(DEBUG) + std::cout << "LargeArrayToGlobalPass: Converting array of size " << size << " to global" << std::endl; allocasToConvert.emplace_back(alloca, F); } }