[polly] r311360 - [ManagedMemoryRewrite] Print reasons for skipping global array to dbgs(). [NFC]

Siddharth Bhat via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 11:52:15 PDT 2017


Author: bollu
Date: Mon Aug 21 11:52:15 2017
New Revision: 311360

URL: http://llvm.org/viewvc/llvm-project?rev=311360&view=rev
Log:
[ManagedMemoryRewrite] Print reasons for skipping global array to dbgs(). [NFC]

Modified:
    polly/trunk/lib/CodeGen/ManagedMemoryRewrite.cpp

Modified: polly/trunk/lib/CodeGen/ManagedMemoryRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/ManagedMemoryRewrite.cpp?rev=311360&r1=311359&r2=311360&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/ManagedMemoryRewrite.cpp (original)
+++ polly/trunk/lib/CodeGen/ManagedMemoryRewrite.cpp Mon Aug 21 11:52:15 2017
@@ -208,12 +208,22 @@ replaceGlobalArray(Module &M, const Data
   const bool OnlyVisibleInsideModule = Array.hasPrivateLinkage() ||
                                        Array.hasInternalLinkage() ||
                                        IgnoreLinkageForGlobals;
-  if (!OnlyVisibleInsideModule)
+  if (!OnlyVisibleInsideModule) {
+    DEBUG(dbgs() << "Not rewriting " << Array
+                 << " to managed memory "
+                    "because it could be visible externally. To force rewrite, "
+                    "use -polly-acc-rewrite-ignore-linkage-for-globals.\n");
     return;
+  }
 
   if (!Array.hasInitializer() ||
-      !isa<ConstantAggregateZero>(Array.getInitializer()))
+      !isa<ConstantAggregateZero>(Array.getInitializer())) {
+    DEBUG(dbgs() << "Not rewriting " << Array
+                 << " to managed memory "
+                    "because it has an initializer which is "
+                    "not a zeroinitializer.\n");
     return;
+  }
 
   // At this point, we have committed to replacing this array.
   ReplacedGlobals.insert(&Array);




More information about the llvm-commits mailing list