[Mlir-commits] [mlir] 247a177 - Give helpers internal linkage. NFC.
Benjamin Kramer
llvmlistbot at llvm.org
Tue Mar 10 10:27:58 PDT 2020
Author: Benjamin Kramer
Date: 2020-03-10T18:27:42+01:00
New Revision: 247a177cf78f0e9a51e351e630dd2a78c8f82859
URL: https://github.com/llvm/llvm-project/commit/247a177cf78f0e9a51e351e630dd2a78c8f82859
DIFF: https://github.com/llvm/llvm-project/commit/247a177cf78f0e9a51e351e630dd2a78c8f82859.diff
LOG: Give helpers internal linkage. NFC.
Added:
Modified:
clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp
llvm/lib/CodeGen/ReachingDefAnalysis.cpp
llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
llvm/lib/Transforms/Scalar/DivRemPairs.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopFusion.cpp
Removed:
################################################################################
diff --git a/clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp
index 6e276a5d6977..b712e77cf6d2 100644
--- a/clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp
@@ -24,6 +24,7 @@
using namespace clang;
using namespace ento;
+namespace {
class PutenvWithAutoChecker : public Checker<check::PostCall> {
private:
BugType BT{this, "'putenv' function should not be called with auto variables",
@@ -33,6 +34,7 @@ class PutenvWithAutoChecker : public Checker<check::PostCall> {
public:
void checkPostCall(const CallEvent &Call, CheckerContext &C) const;
};
+} // namespace
void PutenvWithAutoChecker::checkPostCall(const CallEvent &Call,
CheckerContext &C) const {
diff --git a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
index a1c0c21df912..60292503af17 100644
--- a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
+++ b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
@@ -21,23 +21,23 @@ char ReachingDefAnalysis::ID = 0;
INITIALIZE_PASS(ReachingDefAnalysis, DEBUG_TYPE, "ReachingDefAnalysis", false,
true)
-bool isValidReg(const MachineOperand &MO) {
+static bool isValidReg(const MachineOperand &MO) {
return MO.isReg() && MO.getReg();
}
-bool isValidRegUse(const MachineOperand &MO) {
+static bool isValidRegUse(const MachineOperand &MO) {
return isValidReg(MO) && MO.isUse();
}
-bool isValidRegUseOf(const MachineOperand &MO, int PhysReg) {
+static bool isValidRegUseOf(const MachineOperand &MO, int PhysReg) {
return isValidRegUse(MO) && MO.getReg() == PhysReg;
}
-bool isValidRegDef(const MachineOperand &MO) {
+static bool isValidRegDef(const MachineOperand &MO) {
return isValidReg(MO) && MO.isDef();
}
-bool isValidRegDefOf(const MachineOperand &MO, int PhysReg) {
+static bool isValidRegDefOf(const MachineOperand &MO, int PhysReg) {
return isValidRegDef(MO) && MO.getReg() == PhysReg;
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
index 86d10025d33c..05e323b18d80 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
@@ -441,7 +441,7 @@ const uint8_t MachO_x86_64_GOTAndStubsBuilder::StubContent[6] = {
0xFF, 0x25, 0x00, 0x00, 0x00, 0x00};
} // namespace
-Error optimizeMachO_x86_64_GOTAndStubs(LinkGraph &G) {
+static Error optimizeMachO_x86_64_GOTAndStubs(LinkGraph &G) {
LLVM_DEBUG(dbgs() << "Optimizing GOT entries and stubs:\n");
for (auto *B : G.blocks())
diff --git a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
index eaa699ede32f..e71ae23b38d5 100644
--- a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
@@ -26,7 +26,7 @@ struct TypesAndMemOps {
// Assumes power of 2 memory size. Subtargets that have only naturally-aligned
// memory access need to perform additional legalization here.
-bool isUnalignedMemmoryAccess(uint64_t MemSize, uint64_t AlignInBits) {
+static bool isUnalignedMemmoryAccess(uint64_t MemSize, uint64_t AlignInBits) {
assert(isPowerOf2_64(MemSize) && "Expected power of 2 memory size");
assert(isPowerOf2_64(AlignInBits) && "Expected power of 2 align");
if (MemSize > AlignInBits)
diff --git a/llvm/lib/Transforms/Scalar/DivRemPairs.cpp b/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
index 132dfc8f6da1..d434b6058cfc 100644
--- a/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
+++ b/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
@@ -71,6 +71,7 @@ static llvm::Optional<ExpandedMatch> matchExpandedRem(Instruction &I) {
return M;
}
+namespace {
/// A thin wrapper to store two values that we matched as div-rem pair.
/// We want this extra indirection to avoid dealing with RAUW'ing the map keys.
struct DivRemPairWorklistEntry {
@@ -111,6 +112,7 @@ struct DivRemPairWorklistEntry {
}
}
};
+} // namespace
using DivRemWorklistTy = SmallVector<DivRemPairWorklistEntry, 4>;
/// Find matching pairs of integer div/rem ops (they have the same numerator,
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index b26c084a4abe..68d063d191e2 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3228,10 +3228,9 @@ bool BoUpSLP::areAllUsersVectorized(Instruction *I) const {
});
}
-std::pair<unsigned, unsigned> getVectorCallCosts(CallInst *CI,
- VectorType *VecTy,
- TargetTransformInfo *TTI,
- TargetLibraryInfo *TLI) {
+static std::pair<unsigned, unsigned>
+getVectorCallCosts(CallInst *CI, VectorType *VecTy, TargetTransformInfo *TTI,
+ TargetLibraryInfo *TLI) {
Intrinsic::ID ID = getVectorIntrinsicIDForCall(CI, TLI);
// Calculate the cost of the scalar and vector calls.
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
index 9afdc553f367..de298487bea7 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
@@ -414,7 +414,7 @@ Optional<TiledLinalgOp> static tileLinalgOpImpl(OpBuilder &b, LinalgOp op,
}
template <typename LoopTy>
-Optional<TiledLinalgOp>
+static Optional<TiledLinalgOp>
tileLinalgOpImpl(OpBuilder &b, LinalgOp op, ArrayRef<int64_t> tileSizes,
ArrayRef<unsigned> permutation, OperationFolder *folder) {
assert(op.hasBufferSemantics() && "expected linalg op with buffer semantics");
diff --git a/mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopFusion.cpp b/mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopFusion.cpp
index f8ab86bbad16..98f8313d9ab7 100644
--- a/mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopFusion.cpp
+++ b/mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopFusion.cpp
@@ -46,13 +46,6 @@ static bool equalIterationSpaces(ParallelOp firstPloop,
matchOperands(firstPloop.step(), secondPloop.step());
}
-/// Returns true if the defining operation for the memref is inside the body
-/// of parallel loop.
-bool isDefinedInPloopBody(Value memref, ParallelOp ploop) {
- auto *memrefDef = memref.getDefiningOp();
- return memrefDef && ploop.getOperation()->isAncestor(memrefDef);
-}
-
/// Checks if the parallel loops have mixed access to the same buffers. Returns
/// `true` if the first parallel loop writes to the same indices that the second
/// loop reads.
More information about the Mlir-commits
mailing list