diff options
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r-- | polly/lib/CodeGen/CodeGeneration.cpp | 4 | ||||
-rw-r--r-- | polly/lib/CodeGen/CodegenCleanup.cpp | 7 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslAst.cpp | 7 | ||||
-rw-r--r-- | polly/lib/CodeGen/ManagedMemoryRewrite.cpp | 29 | ||||
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 34 |
5 files changed, 42 insertions, 39 deletions
diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index d7e6c4361ab..1169d769dc6 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -100,7 +100,7 @@ static void verifyGeneratedFunction(Scop &S, Function &F, IslAstInfo &AI) { if (!Verify || !verifyFunction(F, &errs())) return; - DEBUG({ + LLVM_DEBUG({ errs() << "== ISL Codegen created an invalid function ==\n\n== The " "SCoP ==\n"; errs() << S; @@ -196,7 +196,7 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT, // DependenceInfo or IslAstInfo around. IslAst &Ast = AI.getIslAst(); if (Ast.getSharedIslCtx() != S.getSharedIslCtx()) { - DEBUG(dbgs() << "Got an IstAst for a different Scop/isl_ctx\n"); + LLVM_DEBUG(dbgs() << "Got an IstAst for a different Scop/isl_ctx\n"); return false; } diff --git a/polly/lib/CodeGen/CodegenCleanup.cpp b/polly/lib/CodeGen/CodegenCleanup.cpp index efa8ec10376..2e54dfd4dda 100644 --- a/polly/lib/CodeGen/CodegenCleanup.cpp +++ b/polly/lib/CodeGen/CodegenCleanup.cpp @@ -119,12 +119,13 @@ public: virtual bool runOnFunction(llvm::Function &F) override { if (!F.hasFnAttribute("polly-optimized")) { - DEBUG(dbgs() << F.getName() - << ": Skipping cleanup because Polly did not optimize it."); + LLVM_DEBUG( + dbgs() << F.getName() + << ": Skipping cleanup because Polly did not optimize it."); return false; } - DEBUG(dbgs() << F.getName() << ": Running codegen cleanup..."); + LLVM_DEBUG(dbgs() << F.getName() << ": Running codegen cleanup..."); return FPM->run(F); } //@} diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index 7e8739de8a2..c0ad889bd26 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -767,7 +767,7 @@ void IslAstInfo::print(raw_ostream &OS) { auto *Schedule = S.getScheduleTree().release(); - DEBUG({ + LLVM_DEBUG({ dbgs() << S.getContextStr() << "\n"; dbgs() << stringFromIslObj(Schedule); }); @@ -807,14 +807,15 @@ bool IslAstInfoWrapperPass::runOnScop(Scop &Scop) { getAnalysis<DependenceInfo>().getDependences(Dependences::AL_Statement); if (D.getSharedIslCtx() != Scop.getSharedIslCtx()) { - DEBUG(dbgs() << "Got dependence analysis for different SCoP/isl_ctx\n"); + LLVM_DEBUG( + dbgs() << "Got dependence analysis for different SCoP/isl_ctx\n"); Ast.reset(); return false; } Ast.reset(new IslAstInfo(Scop, D)); - DEBUG(printScop(dbgs(), Scop)); + LLVM_DEBUG(printScop(dbgs(), Scop)); return false; } diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp index a8240140809..e14da1dbdb9 100644 --- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp +++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp @@ -124,8 +124,8 @@ static void expandConstantExpr(ConstantExpr *Cur, PollyIRBuilder &Builder, Instruction *I = Cur->getAsInstruction(); assert(I && "unable to convert ConstantExpr to Instruction"); - DEBUG(dbgs() << "Expanding ConstantExpression: (" << *Cur - << ") in Instruction: (" << *I << ")\n";); + LLVM_DEBUG(dbgs() << "Expanding ConstantExpression: (" << *Cur + << ") in Instruction: (" << *I << ")\n";); // Invalidate `Cur` so that no one after this point uses `Cur`. Rather, // they should mutate `I`. @@ -209,19 +209,20 @@ replaceGlobalArray(Module &M, const DataLayout &DL, GlobalVariable &Array, Array.hasInternalLinkage() || IgnoreLinkageForGlobals; 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"); + LLVM_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())) { - DEBUG(dbgs() << "Not rewriting (" << Array - << ") to managed memory " - "because it has an initializer which is " - "not a zeroinitializer.\n"); + LLVM_DEBUG(dbgs() << "Not rewriting (" << Array + << ") to managed memory " + "because it has an initializer which is " + "not a zeroinitializer.\n"); return; } @@ -288,14 +289,14 @@ static void getAllocasToBeManaged(Function &F, auto *Alloca = dyn_cast<AllocaInst>(&I); if (!Alloca) continue; - DEBUG(dbgs() << "Checking if (" << *Alloca << ") may be captured: "); + LLVM_DEBUG(dbgs() << "Checking if (" << *Alloca << ") may be captured: "); if (PointerMayBeCaptured(Alloca, /* ReturnCaptures */ false, /* StoreCaptures */ true)) { Allocas.insert(Alloca); - DEBUG(dbgs() << "YES (captured).\n"); + LLVM_DEBUG(dbgs() << "YES (captured).\n"); } else { - DEBUG(dbgs() << "NO (not captured).\n"); + LLVM_DEBUG(dbgs() << "NO (not captured).\n"); } } } @@ -303,7 +304,7 @@ static void getAllocasToBeManaged(Function &F, static void rewriteAllocaAsManagedMemory(AllocaInst *Alloca, const DataLayout &DL) { - DEBUG(dbgs() << "rewriting: (" << *Alloca << ") to managed mem.\n"); + LLVM_DEBUG(dbgs() << "rewriting: (" << *Alloca << ") to managed mem.\n"); Module *M = Alloca->getModule(); assert(M && "Alloca does not have a module"); diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index b5ef638c2e1..d59d9a374ca 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -2205,7 +2205,7 @@ void GPUNodeBuilder::finalizeKernelArguments(ppcg_kernel *Kernel) { /// memory store or at least before each kernel barrier. if (Kernel->n_block != 0 || Kernel->n_grid != 0) { BuildSuccessful = 0; - DEBUG( + LLVM_DEBUG( dbgs() << getUniqueScopName(&S) << " has a store to a scalar value that" " would be undefined to run in parallel. Bailing out.\n";); @@ -2440,10 +2440,10 @@ void GPUNodeBuilder::addCUDALibDevice() { std::string GPUNodeBuilder::finalizeKernelFunction() { if (verifyModule(*GPUModule)) { - DEBUG(dbgs() << "verifyModule failed on module:\n"; - GPUModule->print(dbgs(), nullptr); dbgs() << "\n";); - DEBUG(dbgs() << "verifyModule Error:\n"; - verifyModule(*GPUModule, &dbgs());); + LLVM_DEBUG(dbgs() << "verifyModule failed on module:\n"; + GPUModule->print(dbgs(), nullptr); dbgs() << "\n";); + LLVM_DEBUG(dbgs() << "verifyModule Error:\n"; + verifyModule(*GPUModule, &dbgs());); if (FailOnVerifyModuleFailure) llvm_unreachable("VerifyModule failed."); @@ -3230,8 +3230,8 @@ public: if (!has_permutable || has_permutable < 0) { Schedule = isl_schedule_free(Schedule); - DEBUG(dbgs() << getUniqueScopName(S) - << " does not have permutable bands. Bailing out\n";); + LLVM_DEBUG(dbgs() << getUniqueScopName(S) + << " does not have permutable bands. Bailing out\n";); } else { const bool CreateTransferToFromDevice = !PollyManagedMemory; Schedule = map_to_device(PPCGGen, Schedule, CreateTransferToFromDevice); @@ -3409,8 +3409,8 @@ public: // Look for (<func-type>*) among operands of Inst if (auto PtrTy = dyn_cast<PointerType>(Op->getType())) { if (isa<FunctionType>(PtrTy->getElementType())) { - DEBUG(dbgs() << Inst - << " has illegal use of function in kernel.\n"); + LLVM_DEBUG(dbgs() + << Inst << " has illegal use of function in kernel.\n"); return true; } } @@ -3488,9 +3488,9 @@ public: auto *SplitBBTerm = Builder.GetInsertBlock()->getTerminator(); SplitBBTerm->setOperand(0, FalseI1); - DEBUG(dbgs() << "preloading invariant loads failed in function: " + - S->getFunction().getName() + - " | Scop Region: " + S->getNameStr()); + LLVM_DEBUG(dbgs() << "preloading invariant loads failed in function: " + + S->getFunction().getName() + + " | Scop Region: " + S->getNameStr()); // adjust the dominator tree accordingly. auto *ExitingBlock = StartBlock->getUniqueSuccessor(); assert(ExitingBlock); @@ -3550,8 +3550,8 @@ public: DL = &S->getRegion().getEntry()->getModule()->getDataLayout(); RI = &getAnalysis<RegionInfoPass>().getRegionInfo(); - DEBUG(dbgs() << "PPCGCodeGen running on : " << getUniqueScopName(S) - << " | loop depth: " << S->getMaxLoopDepth() << "\n"); + LLVM_DEBUG(dbgs() << "PPCGCodeGen running on : " << getUniqueScopName(S) + << " | loop depth: " << S->getMaxLoopDepth() << "\n"); // We currently do not support functions other than intrinsics inside // kernels, as code generation will need to offload function calls to the @@ -3560,7 +3560,7 @@ public: // address of an intrinsic function to send to the kernel. if (containsInvalidKernelFunction(CurrentScop, Architecture == GPUArch::NVPTX64)) { - DEBUG( + LLVM_DEBUG( dbgs() << getUniqueScopName(S) << " contains function which cannot be materialised in a GPU " "kernel. Bailing out.\n";); @@ -3575,8 +3575,8 @@ public: generateCode(isl_ast_node_copy(PPCGGen->tree), PPCGProg); CurrentScop.markAsToBeSkipped(); } else { - DEBUG(dbgs() << getUniqueScopName(S) - << " has empty PPCGGen->tree. Bailing out.\n"); + LLVM_DEBUG(dbgs() << getUniqueScopName(S) + << " has empty PPCGGen->tree. Bailing out.\n"); } freeOptions(PPCGScop); |