[Mlir-commits] [mlir] 564a9de - Hide implementation details. NFC>

Benjamin Kramer llvmlistbot at llvm.org
Mon Feb 17 08:55:31 PST 2020


Author: Benjamin Kramer
Date: 2020-02-17T17:55:23+01:00
New Revision: 564a9de28ed432b0e758b691b6095e421969de60

URL: https://github.com/llvm/llvm-project/commit/564a9de28ed432b0e758b691b6095e421969de60
DIFF: https://github.com/llvm/llvm-project/commit/564a9de28ed432b0e758b691b6095e421969de60.diff

LOG: Hide implementation details. NFC>

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineSizeOpts.cpp
    llvm/lib/Transforms/IPO/Attributor.cpp
    mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
    mlir/lib/IR/AffineMap.cpp
    mlir/lib/IR/Attributes.cpp
    mlir/lib/Pass/PassRegistry.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineSizeOpts.cpp b/llvm/lib/CodeGen/MachineSizeOpts.cpp
index a181b540d180..29aabf1ad52e 100644
--- a/llvm/lib/CodeGen/MachineSizeOpts.cpp
+++ b/llvm/lib/CodeGen/MachineSizeOpts.cpp
@@ -24,6 +24,7 @@ extern cl::opt<bool> ForcePGSO;
 extern cl::opt<int> PgsoCutoffInstrProf;
 extern cl::opt<int> 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 e84f84bb6dd3..0c806eb8de15 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 c5fbea9d5802..9adc20c4a79e 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -241,7 +241,8 @@ template <typename GenericOpType>
 static LogicalResult verifyFuncArgs(GenericOpType op, FunctionType funType);
 
 template <typename GenericOpType>
-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 aae903edef0c..3204b0f79c80 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 <typename LoopTy>
-Optional<TiledLinalgOp>
-tileLinalgOpImpl(OpBuilder &b, LinalgOp op, ArrayRef<Value> tileSizes,
-                 ArrayRef<unsigned> permutation, OperationFolder *folder) {
+Optional<TiledLinalgOp> static tileLinalgOpImpl(OpBuilder &b, LinalgOp op,
+                                                ArrayRef<Value> tileSizes,
+                                                ArrayRef<unsigned> 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 72b9fa792fc2..53e69498ed7f 100644
--- a/mlir/lib/IR/AffineMap.cpp
+++ b/mlir/lib/IR/AffineMap.cpp
@@ -127,7 +127,7 @@ static void getMaxDimAndSymbol(ArrayRef<AffineExprContainer> exprsList,
 }
 
 template <typename AffineExprContainer>
-SmallVector<AffineMap, 4>
+static SmallVector<AffineMap, 4>
 inferFromExprList(ArrayRef<AffineExprContainer> 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 bf4d7330a7b6..229738aaa058 100644
--- a/mlir/lib/IR/Attributes.cpp
+++ b/mlir/lib/IR/Attributes.cpp
@@ -293,9 +293,10 @@ static LogicalResult verifyIntegerTypeInvariants(Optional<Location> loc,
   return emitOptionalError(loc, "expected integer or index type");
 }
 
-LogicalResult verifyConstructionInvariants(Optional<Location> loc,
-                                           MLIRContext *ctx, Type type,
-                                           int64_t value) {
+LogicalResult IntegerAttr::verifyConstructionInvariants(Optional<Location> 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 403bac944ec1..0ecf0266eb5a 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';


        


More information about the Mlir-commits mailing list