summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp2
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp4
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp23
-rw-r--r--llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/LoopRotation.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp2
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp2
7 files changed, 25 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 8cce0efb32d..27ee96dfedf 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2731,7 +2731,7 @@ void SelectionDAGBuilder::visitFCmp(const User &I) {
// Check if the condition of the select has one use or two users that are both
// selects with the same condition.
-bool hasOnlySelectUsers(const Value *Cond) {
+static bool hasOnlySelectUsers(const Value *Cond) {
return std::all_of(Cond->user_begin(), Cond->user_end(), [](const Value *V) {
return isa<SelectInst>(V);
});
diff --git a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
index 28250c588ff..ec807a29a03 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
@@ -80,8 +80,8 @@ struct DbiStream::HeaderInfo {
};
template <typename ContribType>
-Error loadSectionContribs(FixedStreamArray<ContribType> &Output,
- StreamReader &Reader) {
+static Error loadSectionContribs(FixedStreamArray<ContribType> &Output,
+ StreamReader &Reader) {
if (Reader.bytesRemaining() % sizeof(ContribType) != 0)
return make_error<RawError>(
raw_error_code::corrupt_file,
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 2fbf7475268..b902b6056fc 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -3720,9 +3720,13 @@ SDValue ARMTargetLowering::getCMOV(const SDLoc &dl, EVT VT, SDValue FalseVal,
}
}
-bool isGTorGE(ISD::CondCode CC) { return CC == ISD::SETGT || CC == ISD::SETGE; }
+static bool isGTorGE(ISD::CondCode CC) {
+ return CC == ISD::SETGT || CC == ISD::SETGE;
+}
-bool isLTorLE(ISD::CondCode CC) { return CC == ISD::SETLT || CC == ISD::SETLE; }
+static bool isLTorLE(ISD::CondCode CC) {
+ return CC == ISD::SETLT || CC == ISD::SETLE;
+}
// See if a conditional (LHS CC RHS ? TrueVal : FalseVal) is lower-saturating.
// All of these conditions (and their <= and >= counterparts) will do:
@@ -3730,9 +3734,9 @@ bool isLTorLE(ISD::CondCode CC) { return CC == ISD::SETLT || CC == ISD::SETLE; }
// x > k ? x : k
// k < x ? x : k
// k > x ? k : x
-bool isLowerSaturate(const SDValue LHS, const SDValue RHS,
- const SDValue TrueVal, const SDValue FalseVal,
- const ISD::CondCode CC, const SDValue K) {
+static bool isLowerSaturate(const SDValue LHS, const SDValue RHS,
+ const SDValue TrueVal, const SDValue FalseVal,
+ const ISD::CondCode CC, const SDValue K) {
return (isGTorGE(CC) &&
((K == LHS && K == TrueVal) || (K == RHS && K == FalseVal))) ||
(isLTorLE(CC) &&
@@ -3740,9 +3744,9 @@ bool isLowerSaturate(const SDValue LHS, const SDValue RHS,
}
// Similar to isLowerSaturate(), but checks for upper-saturating conditions.
-bool isUpperSaturate(const SDValue LHS, const SDValue RHS,
- const SDValue TrueVal, const SDValue FalseVal,
- const ISD::CondCode CC, const SDValue K) {
+static bool isUpperSaturate(const SDValue LHS, const SDValue RHS,
+ const SDValue TrueVal, const SDValue FalseVal,
+ const ISD::CondCode CC, const SDValue K) {
return (isGTorGE(CC) &&
((K == RHS && K == TrueVal) || (K == LHS && K == FalseVal))) ||
(isLTorLE(CC) &&
@@ -3762,7 +3766,8 @@ bool isUpperSaturate(const SDValue LHS, const SDValue RHS,
//
// It returns true if the conversion can be done, false otherwise.
// Additionally, the variable is returned in parameter V and the constant in K.
-bool isSaturatingConditional(const SDValue &Op, SDValue &V, uint64_t &K) {
+static bool isSaturatingConditional(const SDValue &Op, SDValue &V,
+ uint64_t &K) {
SDValue LHS1 = Op.getOperand(0);
SDValue RHS1 = Op.getOperand(1);
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 7f82596ae54..ed58a87ae1a 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -1050,6 +1050,7 @@ PreservedAnalyses DSEPass::run(Function &F, FunctionAnalysisManager &AM) {
return PA;
}
+namespace {
/// A legacy pass for the legacy pass manager that wraps \c DSEPass.
class DSELegacyPass : public FunctionPass {
public:
@@ -1084,6 +1085,7 @@ public:
static char ID; // Pass identification, replacement for typeid
};
+} // end anonymous namespace
char DSELegacyPass::ID = 0;
INITIALIZE_PASS_BEGIN(DSELegacyPass, "dse", "Dead Store Elimination", false,
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index 549248fbf73..7a06a25a707 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
@@ -49,6 +49,7 @@ static cl::opt<unsigned> DefaultRotationThreshold(
STATISTIC(NumRotated, "Number of loops rotated");
+namespace {
/// A simple loop rotation transformation.
class LoopRotate {
const unsigned MaxHeaderSize;
@@ -70,6 +71,7 @@ private:
bool rotateLoop(Loop *L, bool SimplifiedLatch);
bool simplifyLoopLatch(Loop *L);
};
+} // end anonymous namespace
/// RewriteUsesOfClonedInstructions - We just cloned the instructions from the
/// old header into the preheader. If there were uses of the values produced by
diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
index 0a86920efba..30261b75500 100644
--- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
+++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
@@ -93,6 +93,7 @@ using namespace llvm;
#define DEBUG_TYPE "mldst-motion"
+namespace {
//===----------------------------------------------------------------------===//
// MergedLoadStoreMotion Pass
//===----------------------------------------------------------------------===//
@@ -135,6 +136,7 @@ private:
bool sinkStore(BasicBlock *BB, StoreInst *SinkCand, StoreInst *ElseInst);
bool mergeStores(BasicBlock *BB);
};
+} // end anonymous namespace
///
/// \brief Remove instruction from parent and update memory dependence analysis.
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 9e531e30fb9..8a3c4d14fec 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3426,6 +3426,7 @@ void BoUpSLP::computeMinimumValueSizes() {
MinBWs[Scalar] = MaxBitWidth;
}
+namespace {
/// The SLPVectorizer Pass.
struct SLPVectorizer : public FunctionPass {
SLPVectorizerPass Impl;
@@ -3475,6 +3476,7 @@ struct SLPVectorizer : public FunctionPass {
AU.setPreservesCFG();
}
};
+} // end anonymous namespace
PreservedAnalyses SLPVectorizerPass::run(Function &F, FunctionAnalysisManager &AM) {
auto *SE = &AM.getResult<ScalarEvolutionAnalysis>(F);
OpenPOWER on IntegriCloud