2 changes: 2 additions & 0 deletions llvm/lib/Target/X86/X86ReturnThunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ using namespace llvm;
#define PASS_KEY "x86-return-thunks"
#define DEBUG_TYPE PASS_KEY

namespace {
struct X86ReturnThunks final : public MachineFunctionPass {
static char ID;
X86ReturnThunks() : MachineFunctionPass(ID) {}
StringRef getPassName() const override { return "X86 Return Thunks"; }
bool runOnMachineFunction(MachineFunction &MF) override;
};
} // namespace

char X86ReturnThunks::ID = 0;

Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Transforms/Scalar/LoopFlatten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ static cl::opt<bool>
cl::desc("Widen the loop induction variables, if possible, so "
"overflow checks won't reject flattening"));

namespace {
// We require all uses of both induction variables to match this pattern:
//
// (OuterPHI * InnerTripCount) + InnerPHI
Expand Down Expand Up @@ -288,6 +289,7 @@ struct FlattenInfo {
return true;
}
};
} // namespace

static bool
setLoopComponents(Value *&TC, Value *&TripCount, BinaryOperator *&Increment,
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(StoreInst *SI,
StoreEv, LoadEv, BECount);
}

namespace {
class MemmoveVerifier {
public:
explicit MemmoveVerifier(const Value &LoadBasePtr, const Value &StoreBasePtr,
Expand Down Expand Up @@ -1315,6 +1316,7 @@ class MemmoveVerifier {
public:
const bool IsSameObject;
};
} // namespace

bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(
Value *DestPtr, Value *SourcePtr, const SCEV *StoreSizeSCEV,
Expand Down
4 changes: 4 additions & 0 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ static std::optional<unsigned> getSmallBestKnownTC(ScalarEvolution &SE,
return std::nullopt;
}

namespace {
// Forward declare GeneratedRTChecks.
class GeneratedRTChecks;
} // namespace

namespace llvm {

Expand Down Expand Up @@ -1867,6 +1869,7 @@ class LoopVectorizationCostModel {
};
} // end namespace llvm

namespace {
/// Helper struct to manage generating runtime checks for vectorization.
///
/// The runtime checks are created up-front in temporary blocks to allow better
Expand Down Expand Up @@ -2131,6 +2134,7 @@ class GeneratedRTChecks {
return MemCheckBlock;
}
};
} // namespace

// Return true if \p OuterLp is an outer loop annotated with hints for explicit
// vectorization. The loop needs to be annotated with #pragma omp simd
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Transforms/Vectorize/VectorCombine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ static bool isMemModifiedBetween(BasicBlock::iterator Begin,
});
}

namespace {
/// Helper class to indicate whether a vector index can be safely scalarized and
/// if a freeze needs to be inserted.
class ScalarizationResult {
Expand Down Expand Up @@ -1001,6 +1002,7 @@ class ScalarizationResult {
ToFreeze = nullptr;
}
};
} // namespace

/// Check if it is legal to scalarize a memory access to \p VecTy at index \p
/// Idx. \p Idx must access a valid vector element.
Expand Down