diff --git a/llvm/lib/CodeGen/MachineSizeOpts.cpp b/llvm/lib/CodeGen/MachineSizeOpts.cpp index a181b540d18048..29aabf1ad52ebe 100644 --- a/llvm/lib/CodeGen/MachineSizeOpts.cpp +++ b/llvm/lib/CodeGen/MachineSizeOpts.cpp @@ -24,6 +24,7 @@ extern cl::opt ForcePGSO; extern cl::opt PgsoCutoffInstrProf; extern cl::opt PgsoCutoffSampleProf; +namespace { namespace machine_size_opts_detail { /// Like ProfileSummaryInfo::isColdBlock but for MachineBasicBlock. @@ -91,7 +92,6 @@ bool isFunctionHotInCallGraphNthPercentile( } } // namespace machine_size_opts_detail -namespace { struct MachineBasicBlockBFIAdapter { static bool isFunctionColdInCallGraph(const MachineFunction *MF, ProfileSummaryInfo *PSI, diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index e84f84bb6dd326..0c806eb8de1534 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -736,6 +736,8 @@ void IRPosition::verify() { } } +namespace { + /// Helper function to clamp a state \p S of type \p StateType with the /// information in \p R and indicate/return if \p S did change (as-in update is /// required to be run again). @@ -6091,6 +6093,8 @@ void AAMemoryBehaviorFloating::analyzeUseIn(Attributor &A, const Use *U, removeAssumedBits(NO_WRITES); } +} // namespace + /// -------------------- Memory Locations Attributes --------------------------- /// Includes read-none, argmemonly, inaccessiblememonly, /// inaccessiblememorargmemonly @@ -6123,6 +6127,8 @@ std::string AAMemoryLocation::getMemoryLocationsAsStr( return S; } +namespace { + struct AAMemoryLocationImpl : public AAMemoryLocation { AAMemoryLocationImpl(const IRPosition &IRP) : AAMemoryLocation(IRP) {} @@ -7066,6 +7072,8 @@ struct AAValueConstantRangeCallSiteArgument : AAValueConstantRangeFloating { STATS_DECLTRACK_CSARG_ATTR(value_range) } }; + +} // namespace /// ---------------------------------------------------------------------------- /// Attributor /// ---------------------------------------------------------------------------- diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp index c5fbea9d58025a..9adc20c4a79e79 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -241,7 +241,8 @@ template static LogicalResult verifyFuncArgs(GenericOpType op, FunctionType funType); template -LogicalResult verifyFuncArgsGeneric(GenericOpType op, FunctionType funType) { +static LogicalResult verifyFuncArgsGeneric(GenericOpType op, + FunctionType funType) { auto res = verifyFuncArgs(op, funType); if (failed(res)) return res; diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp index aae903edef0c40..3204b0f79c80c1 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -327,9 +327,10 @@ makeTiledViews(OpBuilder &b, Location loc, LinalgOp linalgOp, } template -Optional -tileLinalgOpImpl(OpBuilder &b, LinalgOp op, ArrayRef tileSizes, - ArrayRef permutation, OperationFolder *folder) { +Optional static tileLinalgOpImpl(OpBuilder &b, LinalgOp op, + ArrayRef tileSizes, + ArrayRef permutation, + OperationFolder *folder) { assert(op.hasBufferSemantics() && "expected linalg op with buffer semantics"); // 1. Enforce the convention that "tiling by zero" skips tiling a particular // dimension. This convention is significantly simpler to handle instead of diff --git a/mlir/lib/IR/AffineMap.cpp b/mlir/lib/IR/AffineMap.cpp index 72b9fa792fc2dd..53e69498ed7fb0 100644 --- a/mlir/lib/IR/AffineMap.cpp +++ b/mlir/lib/IR/AffineMap.cpp @@ -127,7 +127,7 @@ static void getMaxDimAndSymbol(ArrayRef exprsList, } template -SmallVector +static SmallVector inferFromExprList(ArrayRef exprsList) { int64_t maxDim = -1, maxSym = -1; getMaxDimAndSymbol(exprsList, maxDim, maxSym); diff --git a/mlir/lib/IR/Attributes.cpp b/mlir/lib/IR/Attributes.cpp index bf4d7330a7b69c..229738aaa05801 100644 --- a/mlir/lib/IR/Attributes.cpp +++ b/mlir/lib/IR/Attributes.cpp @@ -293,9 +293,10 @@ static LogicalResult verifyIntegerTypeInvariants(Optional loc, return emitOptionalError(loc, "expected integer or index type"); } -LogicalResult verifyConstructionInvariants(Optional loc, - MLIRContext *ctx, Type type, - int64_t value) { +LogicalResult IntegerAttr::verifyConstructionInvariants(Optional loc, + MLIRContext *ctx, + Type type, + int64_t value) { return verifyIntegerTypeInvariants(loc, type); } diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp index 403bac944ec135..0ecf0266eb5a76 100644 --- a/mlir/lib/Pass/PassRegistry.cpp +++ b/mlir/lib/Pass/PassRegistry.cpp @@ -36,8 +36,8 @@ buildDefaultRegistryFn(const PassAllocatorFunction &allocator) { } /// Utility to print the help string for a specific option. -void printOptionHelp(StringRef arg, StringRef desc, size_t indent, - size_t descIndent, bool isTopLevel) { +static void printOptionHelp(StringRef arg, StringRef desc, size_t indent, + size_t descIndent, bool isTopLevel) { size_t numSpaces = descIndent - indent - 4; llvm::outs().indent(indent) << "--" << llvm::left_justify(arg, numSpaces) << "- " << desc << '\n';