From 4d0e2d73ea442d6bcd96f1d4d2a3445ff33352e0 Mon Sep 17 00:00:00 2001 From: rain2133 <1370973498@qq.com> Date: Sun, 10 Aug 2025 17:32:45 +0800 Subject: [PATCH] =?UTF-8?q?[midend-LATG]=E5=B0=86=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=94=B9=E4=B8=BADEBUG=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/midend/Pass/Optimize/LargeArrayToGlobal.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); } }