aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddharth Bhat <siddu.druid@gmail.com>2017-08-21 18:52:15 +0000
committerSiddharth Bhat <siddu.druid@gmail.com>2017-08-21 18:52:15 +0000
commit557ce3a8b0f132784cf2a81ba71df79858dad85c (patch)
treecbbb5cd77c5eaaafd4fd521458c6bffa983b4e0b /polly/lib/CodeGen/ManagedMemoryRewrite.cpp
parentRevert "Introduce FuzzMutate library" (diff)
downloadllvm-project-557ce3a8b0f132784cf2a81ba71df79858dad85c.tar.gz
llvm-project-557ce3a8b0f132784cf2a81ba71df79858dad85c.tar.bz2
llvm-project-557ce3a8b0f132784cf2a81ba71df79858dad85c.zip
[ManagedMemoryRewrite] Print reasons for skipping global array to dbgs(). [NFC]
llvm-svn: 311360
Diffstat (limited to 'polly/lib/CodeGen/ManagedMemoryRewrite.cpp')
-rw-r--r--polly/lib/CodeGen/ManagedMemoryRewrite.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
index 3ddd6081262b..055f1a26c524 100644
--- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
+++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
@@ -208,12 +208,22 @@ replaceGlobalArray(Module &M, const DataLayout &DL, GlobalVariable &Array,
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);