From c11ebfea6d4d99a28d3b746a5a416e3ab81a858c Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 27 Sep 2021 23:10:27 -0400 Subject: [PATCH] [OpenMP][NFC] Fix linting messages in OpenMPOpt Summary: This patch addresses some linting messages I keep getting in my editor when working on OpenMPOpt. --- llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp index 6b2677a..7e9dced 100644 --- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp +++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp @@ -365,7 +365,7 @@ struct OMPInformationCache : public InformationCache { if (F->arg_size() != RTFArgTypes.size()) return false; - auto RTFTyIt = RTFArgTypes.begin(); + auto *RTFTyIt = RTFArgTypes.begin(); for (Argument &Arg : F->args()) { if (Arg.getType() != *RTFTyIt) return false; @@ -1613,8 +1613,8 @@ private: return true; if (CB.getArgOperand(0)->getType() != OMPInfoCache.OMPBuilder.IdentPtr) return false; - for (unsigned u = 1; u < NumArgs; ++u) - if (isa(CB.getArgOperand(u))) + for (unsigned U = 1; U < NumArgs; ++U) + if (isa(CB.getArgOperand(U))) return false; return true; }; @@ -1740,8 +1740,8 @@ private: // Transitively search for more arguments by looking at the users of the // ones we know already. During the search the GTIdArgs vector is extended // so we cannot cache the size nor can we use a range based for. - for (unsigned u = 0; u < GTIdArgs.size(); ++u) - AddUserArgs(*GTIdArgs[u]); + for (unsigned U = 0; U < GTIdArgs.size(); ++U) + AddUserArgs(*GTIdArgs[U]); } /// Kernel (=GPU) optimizations and utility functions @@ -3562,8 +3562,8 @@ struct AAKernelInfoFunction : AAKernelInfo { // Now that we have most of the CFG skeleton it is time for the if-cascade // that checks the function pointer we got from the runtime against the // parallel regions we expect, if there are any. - for (int i = 0, e = ReachedKnownParallelRegions.size(); i < e; ++i) { - auto *ParallelRegion = ReachedKnownParallelRegions[i]; + for (int I = 0, E = ReachedKnownParallelRegions.size(); I < E; ++I) { + auto *ParallelRegion = ReachedKnownParallelRegions[I]; BasicBlock *PRExecuteBB = BasicBlock::Create( Ctx, "worker_state_machine.parallel_region.execute", Kernel, StateMachineEndParallelBB); @@ -3579,7 +3579,7 @@ struct AAKernelInfoFunction : AAKernelInfo { // Check if we need to compare the pointer at all or if we can just // call the parallel region function. Value *IsPR; - if (i + 1 < e || !ReachedUnknownParallelRegions.empty()) { + if (I + 1 < E || !ReachedUnknownParallelRegions.empty()) { Instruction *CmpI = ICmpInst::Create( ICmpInst::ICmp, llvm::CmpInst::ICMP_EQ, WorkFnCast, ParallelRegion, "worker.check_parallel_region", StateMachineIfCascadeCurrentBB); @@ -4101,9 +4101,8 @@ struct AAFoldRuntimeCallCallSiteReturned : AAFoldRuntimeCall { return OR << "Replacing OpenMP runtime call " << CB->getCalledFunction()->getName() << " with " << ore::NV("FoldedValue", C->getZExtValue()) << "."; - else - return OR << "Replacing OpenMP runtime call " - << CB->getCalledFunction()->getName() << "."; + return OR << "Replacing OpenMP runtime call " + << CB->getCalledFunction()->getName() << "."; }; if (CB && EnableVerboseRemarks) -- 2.7.4