mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-01 15:51:55 +00:00
Give helper classes/functions internal linkage. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275014 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0f313e56b8
commit
a27e16e477
@ -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);
|
||||
});
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user