forked from OSchip/llvm-project
Move helpers into anonymous namespaces. NFC.
llvm-svn: 277916
This commit is contained in:
parent
70c93fa69a
commit
b7d3311c77
|
@ -14,8 +14,6 @@
|
|||
|
||||
using namespace llvm;
|
||||
|
||||
class MCExpr;
|
||||
|
||||
unsigned AddressPool::getIndex(const MCSymbol *Sym, bool TLS) {
|
||||
HasBeenUsed = true;
|
||||
auto IterBool =
|
||||
|
|
|
@ -349,7 +349,7 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) {
|
|||
return !getLabelAfterInsn(Ranges.front().second);
|
||||
}
|
||||
|
||||
template <typename Func> void forBothCUs(DwarfCompileUnit &CU, Func F) {
|
||||
template <typename Func> static void forBothCUs(DwarfCompileUnit &CU, Func F) {
|
||||
F(CU);
|
||||
if (auto *SkelCU = CU.getSkeleton())
|
||||
F(*SkelCU);
|
||||
|
|
|
@ -70,9 +70,10 @@ void LiveRegMatrix::releaseMemory() {
|
|||
}
|
||||
}
|
||||
|
||||
template<typename Callable>
|
||||
bool foreachUnit(const TargetRegisterInfo *TRI, LiveInterval &VRegInterval,
|
||||
unsigned PhysReg, Callable Func) {
|
||||
template <typename Callable>
|
||||
static bool foreachUnit(const TargetRegisterInfo *TRI,
|
||||
LiveInterval &VRegInterval, unsigned PhysReg,
|
||||
Callable Func) {
|
||||
if (VRegInterval.hasSubRanges()) {
|
||||
for (MCRegUnitMaskIterator Units(PhysReg, TRI); Units.isValid(); ++Units) {
|
||||
unsigned Unit = (*Units).first;
|
||||
|
|
|
@ -98,8 +98,9 @@ STATISTIC(NumTrytoPipeline, "Number of loops that we attempt to pipeline");
|
|||
STATISTIC(NumPipelined, "Number of loops software pipelined");
|
||||
|
||||
/// A command line option to turn software pipelining on or off.
|
||||
cl::opt<bool> EnableSWP("enable-pipeliner", cl::Hidden, cl::init(true),
|
||||
cl::ZeroOrMore, cl::desc("Enable Software Pipelining"));
|
||||
static cl::opt<bool> EnableSWP("enable-pipeliner", cl::Hidden, cl::init(true),
|
||||
cl::ZeroOrMore,
|
||||
cl::desc("Enable Software Pipelining"));
|
||||
|
||||
/// A command line option to enable SWP at -Os.
|
||||
static cl::opt<bool> EnableSWPOptSize("enable-pipeliner-opt-size",
|
||||
|
|
|
@ -22,7 +22,7 @@ using namespace llvm;
|
|||
|
||||
#define DEBUG_TYPE "ip-regalloc"
|
||||
|
||||
cl::opt<bool> DumpRegUsage(
|
||||
static cl::opt<bool> DumpRegUsage(
|
||||
"print-regusage", cl::init(false), cl::Hidden,
|
||||
cl::desc("print register usage details collected for analysis."));
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ bool ShrinkWrap::useOrDefCSROrFI(const MachineInstr &MI,
|
|||
|
||||
/// \brief Helper function to find the immediate (post) dominator.
|
||||
template <typename ListOfBBs, typename DominanceAnalysis>
|
||||
MachineBasicBlock *FindIDom(MachineBasicBlock &Block, ListOfBBs BBs,
|
||||
static MachineBasicBlock *FindIDom(MachineBasicBlock &Block, ListOfBBs BBs,
|
||||
DominanceAnalysis &Dom) {
|
||||
MachineBasicBlock *IDom = &Block;
|
||||
for (MachineBasicBlock *BB : BBs) {
|
||||
|
|
|
@ -762,7 +762,7 @@ static bool isScope(const Metadata *MD) { return !MD || isa<DIScope>(MD); }
|
|||
static bool isDINode(const Metadata *MD) { return !MD || isa<DINode>(MD); }
|
||||
|
||||
template <class Ty>
|
||||
bool isValidMetadataArrayImpl(const MDTuple &N, bool AllowNull) {
|
||||
static bool isValidMetadataArrayImpl(const MDTuple &N, bool AllowNull) {
|
||||
for (Metadata *MD : N.operands()) {
|
||||
if (MD) {
|
||||
if (!isa<Ty>(MD))
|
||||
|
@ -775,13 +775,11 @@ bool isValidMetadataArrayImpl(const MDTuple &N, bool AllowNull) {
|
|||
return true;
|
||||
}
|
||||
|
||||
template <class Ty>
|
||||
bool isValidMetadataArray(const MDTuple &N) {
|
||||
template <class Ty> static bool isValidMetadataArray(const MDTuple &N) {
|
||||
return isValidMetadataArrayImpl<Ty>(N, /* AllowNull */ false);
|
||||
}
|
||||
|
||||
template <class Ty>
|
||||
bool isValidMetadataNullArray(const MDTuple &N) {
|
||||
template <class Ty> static bool isValidMetadataNullArray(const MDTuple &N) {
|
||||
return isValidMetadataArrayImpl<Ty>(N, /* AllowNull */ true);
|
||||
}
|
||||
|
||||
|
|
|
@ -869,7 +869,7 @@ static bool produceCompactUnwindFrame(MachineFunction &MF) {
|
|||
Attrs.hasAttrSomewhere(Attribute::SwiftError));
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
struct RegPairInfo {
|
||||
RegPairInfo() : Reg1(AArch64::NoRegister), Reg2(AArch64::NoRegister) {}
|
||||
unsigned Reg1;
|
||||
|
@ -879,6 +879,7 @@ struct RegPairInfo {
|
|||
bool IsGPR;
|
||||
bool isPaired() const { return Reg2 != AArch64::NoRegister; }
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
static void computeCalleeSaveRegisterPairs(
|
||||
MachineFunction &MF, const std::vector<CalleeSavedInfo> &CSI,
|
||||
|
|
|
@ -1028,6 +1028,7 @@ static bool areCFlagsAliveInSuccessors(MachineBasicBlock *MBB) {
|
|||
return false;
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct UsedNZCV {
|
||||
bool N;
|
||||
bool Z;
|
||||
|
@ -1042,6 +1043,7 @@ struct UsedNZCV {
|
|||
return *this;
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
/// Find a condition code used by the instruction.
|
||||
/// Returns AArch64CC::Invalid if either the instruction does not use condition
|
||||
|
|
|
@ -1583,6 +1583,7 @@ int HexagonDAGToDAGISel::getHeight(SDNode *N) {
|
|||
return RootHeights[N];
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct WeightedLeaf {
|
||||
SDValue Value;
|
||||
int Weight;
|
||||
|
@ -1673,6 +1674,7 @@ public:
|
|||
LeafPrioQueue(unsigned Opcode) :
|
||||
HaveConst(false), Opcode(Opcode) { }
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
WeightedLeaf LeafPrioQueue::findSHL(uint64_t MaxAmount) {
|
||||
int ResultPos;
|
||||
|
|
|
@ -51,6 +51,7 @@ using namespace llvm;
|
|||
|
||||
#define DEBUG_TYPE "misched"
|
||||
|
||||
namespace {
|
||||
class HexagonCallMutation : public ScheduleDAGMutation {
|
||||
public:
|
||||
void apply(ScheduleDAGInstrs *DAG) override;
|
||||
|
@ -58,6 +59,7 @@ private:
|
|||
bool shouldTFRICallBind(const HexagonInstrInfo &HII,
|
||||
const SUnit &Inst1, const SUnit &Inst2) const;
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
// Check if a call and subsequent A2_tfrpi instructions should maintain
|
||||
// scheduling affinity. We are looking for the TFRI to be consumed in
|
||||
|
|
|
@ -44,12 +44,6 @@ static cl::opt<bool>
|
|||
STATISTIC(NumSubstLEAs, "Number of LEA instruction substitutions");
|
||||
STATISTIC(NumRedundantLEAs, "Number of redundant LEA instructions removed");
|
||||
|
||||
class MemOpKey;
|
||||
|
||||
/// \brief Returns a hash table key based on memory operands of \p MI. The
|
||||
/// number of the first memory operand of \p MI is specified through \p N.
|
||||
static inline MemOpKey getMemOpKey(const MachineInstr &MI, unsigned N);
|
||||
|
||||
/// \brief Returns true if two machine operands are identical and they are not
|
||||
/// physical registers.
|
||||
static inline bool isIdenticalOp(const MachineOperand &MO1,
|
||||
|
@ -63,6 +57,7 @@ static bool isSimilarDispOp(const MachineOperand &MO1,
|
|||
/// \brief Returns true if the instruction is LEA.
|
||||
static inline bool isLEA(const MachineInstr &MI);
|
||||
|
||||
namespace {
|
||||
/// A key based on instruction's memory operands.
|
||||
class MemOpKey {
|
||||
public:
|
||||
|
@ -95,6 +90,7 @@ public:
|
|||
// Address' displacement operand.
|
||||
const MachineOperand *Disp;
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
/// Provide DenseMapInfo for MemOpKey.
|
||||
namespace llvm {
|
||||
|
@ -168,6 +164,8 @@ template <> struct DenseMapInfo<MemOpKey> {
|
|||
};
|
||||
}
|
||||
|
||||
/// \brief Returns a hash table key based on memory operands of \p MI. The
|
||||
/// number of the first memory operand of \p MI is specified through \p N.
|
||||
static inline MemOpKey getMemOpKey(const MachineInstr &MI, unsigned N) {
|
||||
assert((isLEA(MI) || MI.mayLoadOrStore()) &&
|
||||
"The instruction must be a LEA, a load or a store");
|
||||
|
|
|
@ -1703,6 +1703,7 @@ bool llvm::callsGCLeafFunction(ImmutableCallSite CS) {
|
|||
return false;
|
||||
}
|
||||
|
||||
namespace {
|
||||
/// A potential constituent of a bitreverse or bswap expression. See
|
||||
/// collectBitParts for a fuller explanation.
|
||||
struct BitPart {
|
||||
|
@ -1718,6 +1719,7 @@ struct BitPart {
|
|||
|
||||
enum { Unset = -1 };
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
/// Analyze the specified subexpression and see if it is capable of providing
|
||||
/// pieces of a bswap or bitreverse. The subexpression provides a potential
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
// Compute a "unique" hash for the module based on the name of the public
|
||||
// functions.
|
||||
class ModuleHasher {
|
||||
|
@ -57,6 +58,7 @@ public:
|
|||
return TheHash;
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
// Rename all the anon functions in the module
|
||||
bool llvm::nameUnamedFunctions(Module &M) {
|
||||
|
|
|
@ -3942,7 +3942,7 @@ static Value *createRdxShuffleMask(unsigned VecLen, unsigned NumEltsToRdx,
|
|||
return ConstantVector::get(ShuffleMask);
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
/// Model horizontal reductions.
|
||||
///
|
||||
/// A horizontal reduction is a tree of reduction operations (currently add and
|
||||
|
@ -4228,6 +4228,7 @@ private:
|
|||
return Builder.CreateExtractElement(TmpVec, Builder.getInt32(0));
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
/// \brief Recognize construction of vectors like
|
||||
/// %ra = insertelement <4 x float> undef, float %s0, i32 0
|
||||
|
|
Loading…
Reference in New Issue